Movable Type Plugin: MostActiveEntries v0.1

2005-01-20 5:39PM

Overview

MostActiveEntries is a Movable Type plugin that will create a container tag of entries that have been the most active (in terms of Trackbacks and comments) in a given period of time. Both the period of time and the number of entries referenced are configurable. By default, it will look for the 7 most active entries from the last week. Common usage would be:

<h1>Most Active Recent Entries</h1>
<ul>
<MTMostActiveEntries>
    <li><a href="<$MTEntryPermalink$>" title="<$MTEntryTitle$>"><$MTEntryTitle$></a>
    on <a href="<$MTBlogURL$>" title="<$MTBlogName$>"><$MTBlogName$></a><br />
    <$MTEntryCommentCount$> comment(s) and <$MTEntryTrackbackCount$> trackback(s)</li>
</MTMostActiveEntries>
</ul>

The source code for v0.1 is available at http://alpha-geek.com/mostactiveentries/mostActiveEntries-0.1.txt. The latest source code will always be available at http://alpha-geek.com/mostactiveentries/mostActiveEntries.txt.

Installation

Download the source code and place the mostActiveEntries.pl file in your installation of Movable Type's plugins directory.

Use

By default, MostActiveEntries will contain the 7 most active entries of the last week. This can be configured using the days or lastn attributes. Setting the days attribute can shorten or extend how far back the plugin will go to gather the entries. So, for example, if you set days to "3", it will display the 7 most active entries (assuming that there are, indeed, 7 entries posted in the last 3 days) in the last 3 days. Similarly, you can set days to "28" to get the 7 most active entries in the last 4 weeks.

Additionally, you can set the lastn attribute to configure the number of entries to gather. By default, MostActiveEntries gathers 7 entries; but that can be extended or shortened.

You can use both tags together to get, for example, the 19 most active entries in the past 37 days:

<MTMostActiveEntries lastn="19" days="37">
.
.
.
</MTMostActiveEntries>

Copyright and License

This source code is copyright Jeremy Smith (jeremy.smith@gmail.com), 2005. And, is released under the MIT License, which basically says, "do whatever you want with this code just don't come crying to me if it is broken or breaks something."