Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Sorting articles by last comment published
Is there any way to list articles not by the number of comments but by the posted date of comments?
Even using some PHP magic…
Thanks,
Loz
Offline
#2 2008-09-18 15:23:22
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Sorting articles by last comment published
I think Lawrence wants to sort the articles, not the comments… :)
Offline
Re: Sorting articles by last comment published
Thanks for pointing that out (I’ve deleted my earlier post).
Lawrence, it’s not impossible, but the comments and articles are stored in separate tables in the database (textpattern and txp_discuss). If you want to sort the article (textpattern table) based on information stored in the comments table (txp_discuss), you’d have to manually query the database using a SQL JOIN between those tables, grouping it by article ID and sorting on the MAX value of the column in txp_discuss that contains the posted date.
Perhaps the smd_query plugin can help you do this (although I haven’t tried it yet myself).
Offline
Re: Sorting articles by last comment published
Hi,
Thanks for the feedback.
Sounds like more of a hassle than anything.
Alternatively there is wet_recent_comments, but I am using that already (and modified for formatting purposes).
Is there a way to run two of the same plugins?
Offline