Help - Search - Members - Calendar
Full Version: Going Beyond 'CommentCount'
Movable Type Community Forum > Additional Resources > Tips and Tricks
craigf
This seems like such a simple and obvious idea, but I've come up empty on my browsings of the plug-in and script collections, so...

What I'm hoping to do is produce two lists of blog entries:

1) The "most commented" entries -- the N (N=5, 10, whatever) entries with the most comments. Some entries have fairly active discussions going on, but once these entries disappear off the main page, they seem to get lost.

2) The "most recently commented" entries -- the N (N=5, 10, whatever) entries that have comments. I can do this now using the code shown in the tag manual (under MTCommentEntry), but it doesn't work so well. If two of the most recent, say, 10 comments were made on the same entry, that entry will show up in the list twice. Obviously, that isn't ideal.

Any suggestions on how to do either or both of these?

Thanks much in advance.
- Craig
http://www.gearbits.com
maddy
1. Most Commented On (see the SQL code in the comments, too).

2.
CODE
<MTEntries recently_commented_on="5" sort_order="descend">
<a href="<$MTEntryLink$>"><$MTEntryTitle$></a> (<$MTEntryCommentCount$>)<br>
<MTComments lastn="1">
<$MTCommentAuthorLink spam_protect="1"$> said:
<$MTCommentBody trim_to="35" remove_html="1" convert_breaks="0"$>...
[<a href="<$MTEntryLink$>#<$MTCommentID$>">go</a>]<br>
</MTComments></MTEntries>


smile.gif
khalido
Isn't there a way to use MTSQL to get the most commented on? the scripty goddess method seems a bit ungainly.
maddy
Yes. As I mentioned, it's the comments to that post. smile.gif
craigf
Thanks a heap, Maddy -- that code did the trick (and my apologies for waiting this long to thank you!). I wouldn't have thought of using MTEntries (/me mutters "stupid brain!") -- very clever!

Here's a link to see it in action if you want: www.gearbits.com

Thanks again.
- Craig
Tom Alday
the links under "Recent Comments" on your page don't go to the specific entry, they all go to the main page (gearbits.com).
forsv
QUOTE (maddy @ Oct 16 2003, 06:15 AM)
1. Most Commented On (see the SQL code in the comments, too).

2.
CODE
<MTEntries recently_commented_on="5" sort_order="descend">
<a href="<$MTEntryLink$>"><$MTEntryTitle$></a> (<$MTEntryCommentCount$>)<br>
<MTComments lastn="1">
<$MTCommentAuthorLink spam_protect="1"$> said:
<$MTCommentBody trim_to="35" remove_html="1" convert_breaks="0"$>...
[<a href="<$MTEntryLink$>#<$MTCommentID$>">go</a>]<br>
</MTComments></MTEntries>


smile.gif

This did not work for me. I use mblog.com for my blog and had used the php code before for most commented post and worked fine. But not mblog has disabled php so am wondering if anyone has a java script to do the same. Note I do not have access to SQL database.
TweezerMan
QUOTE
I use mblog.com for my blog...

As your weblog is being hosted by mBlog, I feel it is only fair to point out that mBlog running a hacked copy of MT and is blatantly violating MT's license by providing MT hosting to its users. See my post "mBlog Users - Beware!" for details.

I understand that you may not have been aware that mBlog's service is not a legitimate one, but no one who respects MT's licenses (and in turn, MT and the good people at Six Apart) can in good conscience provide any support to mBlog's users.

I would suggest moving your blog off of mBlog ASAP. If you want to run a Movable Type weblog, I would further suggest getting your own hosting account and downloading a licensed copy of MT.

If you would rather not have to deal with installing and running your own copy of MT, but still want to have the power of Movable Type running your weblog, I'd suggest giving TypePad a try. You can get a 90-day free trial by using the code "movable" when you sign up.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.