Help - Search - Members - Calendar
Full Version: How To Find The Entries That Have Most Number Of Comments
Movable Type Community Forum > Using Movable Type > Commenting System
gani
Hi,

I am trying to find the entries with most number of comments or how could i display the entries based on the no. of comments?

Thank you,

Gani
bart johnston
I've been trying to do the same thing, but haven't had any success... It seemed like it would be pretty straightforward:

CODE
<mt:Entries sort_by="comment_count" limit="4">
     ...
</mt:Entries>


Not only does it not get the 4 most-commented posts in that blog, the articles that do get displayed aren't even sorted by their comment_count. (btw - I'm using MT 4.13)

If anybody has any insight on a solution, it would be greatly appreciated!
david
Sorting entries in an <MTEntries> tag by comment_count requires at least MT 4.2.
bart johnston
Well, perhaps I was just being stubborn since it seems this need should be easily handled by existing MT template tags. I finally just caved and installed the MTContentiousEntries plugin that I came across in the comments for the MTEntries Tag.

The plugin worked perfectly for me right off the bat.
bart johnston
QUOTE (david @ Nov 10 2008, 10:24 AM) *
Sorting entries in an <MTEntries> tag by comment_count requires at least MT 4.2.


Thanks for the tip, David. I'd been putting off upgrading, but I may go ahead and bite the bullet.
gani
QUOTE (bart johnston @ Nov 10 2008, 08:40 AM) *
QUOTE (david @ Nov 10 2008, 10:24 AM) *
Sorting entries in an <MTEntries> tag by comment_count requires at least MT 4.2.


Thanks for the tip, David. I'd been putting off upgrading, but I may go ahead and bite the bullet.



Thanks for your reply.

I am using the code in that page.

works well if it is inside category tag, but it gives an error when i try to put the code inside the entry Any idea.

I am trying to use this for all entries in the blog instead of going through the each category. how can i do that?

Thanks

gani
I tried this one too. But its sorting only the entries with in that page. But i need to do that for entire blog(from all categories)

<mt:Entries lastn="5" sort_by="comment_count">

<mt:If tag="EntryCommentCount">
<ul>
<mt:Comments lastn="1" sort_order="descend">
<mt:CommentEntry>
<li><a href="<$mt:CommentLink$>"><$mt:EntryTitle$>(<$mt:EntryCommentCount$>)</a>
<br/>
<$mt:CommentBody remove_html="1" trim_to="25"$>
</mt:CommentEntry>
<br/>

</li>
</ul>

</mt:Comments>
</mt:If>


any help please?
</mt:Entries>
OtherNiceMan
Try swapping the lastn and the sort_by
gani
QUOTE (OtherNiceMan @ Nov 11 2008, 01:43 PM) *
Try swapping the lastn and the sort_by



That didn't work either.

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