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."

Trackbacks

MostActiveEntries
Excerpt: ...
Weblog: Movable Type Plugin Directory
Tracked: January 24, 2005 12:26 AM
MovableType Plugin: MostActiveEntries
Excerpt: MostActiveEntries erzeugt eine Auflistung der am meisten gefragten Beiträge auf Basis von Kommentaren und Trackbacks.
Weblog: einfach-persoenlich Sideblog
Tracked: January 24, 2005 01:51 AM
MostActiveEntries.pl─最も活気ã®ã‚るエントリã¯ï¼Ÿ
Excerpt: Movable Type Plugin: MostActiveEntries v...
Weblog: 国際ニュース::Ishikawa-News.com
Tracked: January 24, 2005 06:59 AM

Comments

Nice plugin :)
Can you also set the days variable to effectively be 'open' so that it will display the lastn most active entries in the entire life of the entire weblog (without having to adjust the days value ever once it's set to open)?

Posted by demonsurfer on January 24, 2005 01:03 AM

..altho I guess just set the days variable to 99999 and that would solve it? (haven't installed it yet)

Posted by demonsurfer on January 24, 2005 01:16 AM

I receive an error saying that i'm using 'MTEntryLink' tag outside of the context of an entry.

The code is the same as in your example and i'm placing it in weblog's sidebar.

How can i solve it?

Posted by yakoff.ru on January 25, 2005 04:59 AM

hey jeremy and yakoff.ru, I'm getting the same problem.

Posted by martine on January 25, 2005 09:23 AM

Yakoff and Martine:

When saving the code, make sure that the text remains unchanged. For some reason, if you are using 'vi' or 'vim', when I go to save the code; it ends up "automatically" commenting out the entire thing.

Posted by J$ on January 25, 2005 12:44 PM

demonsurfer:

Yes, setting the 'days' attribute to be an arbitrarily high number should effectively do what you want.

I could change the default value for 'days' to mean "at any point in time." That may be what I'll do.

I wish there were some way to come to a consensus with how people would want to use it.

Posted by J$ on January 25, 2005 12:52 PM

I found where the problem was - you need to comment out line "use warnings" in the start of the file, then it starts working.

(I'm not a perl guru - just guessed when comparing your source with source of another plugin. Actually I don't even know WHY it started working and HOW it works :))

This solution is good for MT 3.14 and 3.15; don't know about other versions.

Posted by yakoff.ru on January 25, 2005 02:09 PM

"I wish there were some way to come to a consensus with how people would want to use it."

Seems good to me, I just wanted to clarify that setting. Perhaps put an option there that a setting of days="0" would mean the entire life of the weblog, or alternatively make the entire life of the blog the default setting, and if users want to limit it to only cover the last X amount of days, they can then add in the days="X" attribute to the tag.
:)

Posted by demonsurfer on January 27, 2005 06:41 AM

Nice Plugin - is there any way to narrow the results down to one blog? I have three blogs on my installation, but I'd only want it to report on one of the blogs...

Posted by Wibbler on January 31, 2005 04:26 AM

I would like to know how to narrow the results down to one blog, too.

Posted by Rob on February 3, 2005 11:15 PM

Yes, a fix for that would be awesome, I have a photoblog and a regular blog... and it doens't make sense to display the most recently commented entries for my blog - inside my photoblog.

Thanks!

Posted by Beth on February 4, 2005 07:14 PM

It's not as effective as if it was coded into the perl, but you can use PHP to do a quick hack to only show the active entries from one blog. Here's my code. The only thing you need to change is the extension of the files displaying this code to .php.
It's not a great fix, but it works:

<h1>Most Active Entries</h1>
<?php $MyBlogID = "<$MTBlogID$>"; ?>
<ul>
<MTMostActiveEntries lastn="10" days="365">
<?php
if(<$MTBlogID$> == $MyBlogID){?>
<li><a href="<$MTEntryPermalink$>" title="<$MTEntryTitle$>"><$MTEntryTitle$></a><br />
<$MTEntryCommentCount$> comment(s)</li>
<?php } ?>
</MTMostActiveEntries>
</ul>

Posted by Terri Ann on March 3, 2005 11:39 PM

Am I the only one getting 500 errors when trying to download the thing? How about you zip the script up so the server doesn't try to execute it?

Posted by Orestes on May 15, 2005 04:14 AM

In 3.2, setting the Days to any value kills it so that it wont produce any results, even if the number of days is high. Has anyone come up with a workaround?

Posted by JP on May 17, 2006 12:13 PM