Mango



Thread: Pulling posts by popularity

Created on: 11/05/08 12:56 PM

New topic Reply    Page: 1  

Replies: 7
russjohnson


russjohnson's Gravatar
Joined: 10/18/08
Posts: 11

11/05/08 12:56 PM

Is there anyway to pull posts by the amount of comments they have?

I have briefly looked through the Posts tag but came up empty. I just want a list very similar to the Recent posts list you would use in a sidebar pod but pulled by popularity.

I dont mind writing the code in my theme to do it but I would prefer the tag method if possible.

Thanks for a great app!
Link | Top | Bottom
visual28


visual28's Gravatar
Joined: 05/18/08
Posts: 421

11/05/08 1:00 PM

A plugin for this should not be too difficult to create. Sadly, I have had this on my to-do list since Adam created the Recent posts plugin. I know it's something that I have wanted to add to my site as well.

Maybe Adam could throw something together real fast like ;)
Mark - www.visual28.com | www.mangowear.com
Link | Top | Bottom
russjohnson


russjohnson's Gravatar
Joined: 10/18/08
Posts: 11

11/05/08 1:07 PM

Im actually looking at what it would take to add it to the Posts tag now. I dont want to run a custom version of Mango but after running BlogCFC for years, you get kind of used to it...
Link | Top | Bottom
TuttleTree


TuttleTree's Gravatar
Joined: 07/22/08
Posts: 38

11/05/08 1:27 PM

Off the top of my head, I don't think there is functionality built into Mango for this (closest is probably getting an array of post objects, getting comment count from each); so your two options are to loop over all posts and keep track of their comment counts, or to poll the database manually for the data. Obviously the latter is more scalable, at the cost of being less future-proof should the Mango database structure change.

I've been meaning to look into what it takes to build custom pods, so perhaps this is a good entry into that. :)

-Adam
Link | Top | Bottom
TuttleTree


TuttleTree's Gravatar
Joined: 07/22/08
Posts: 38

11/06/08 2:00 PM

Russ, I emailed you and Mark a beta version of the plugin I just wrote to do this. Let me know how it works for you.
Link | Top | Bottom
billybob476


billybob476's Gravatar
Joined: 06/24/09
Posts: 3

06/24/09 9:32 AM

Hi guys,

I was wondering if anything came of this. I need to do exactly this on a new project where I'm using Mango Blog.
Link | Top | Bottom
billybob476


billybob476's Gravatar
Joined: 06/24/09
Posts: 3

06/24/09 9:32 AM

Hi guys,

I was wondering if anything came of this. I need to do exactly this on a new project where I'm using Mango Blog.
Link | Top | Bottom
billybob476


billybob476's Gravatar
Joined: 06/24/09
Posts: 3

06/24/09 9:33 AM

Sorry for the double post, forums are erroring out with a mail server exception.
Link | Top | Bottom

New Post

Please login to post a response.