2011-02-28, 08:57 PM
This seems like something very simple, but I'm not too familiar with the wording in the coding to get everything working. Hopefully one of you pros can help.
Currently, the Latest Threads block on my home page lists the most recently created threads in order by when they were created. What I would like to do (which seems like the default everywhere else), is change this into a list of threads most recently replied-to.
The problem is, I'm not sure what terms to "call" to get this information for ordering everything. Here's what I have currently:
Any help would be greatly appreciated!
Ah, it was t.lastpost, of course.
Currently, the Latest Threads block on my home page lists the most recently created threads in order by when they were created. What I would like to do (which seems like the default everywhere else), is change this into a list of threads most recently replied-to.
The problem is, I'm not sure what terms to "call" to get this information for ordering everything. Here's what I have currently:
$threadlimit = 10;
$query = $db->query("
SELECT t.*, t.subject AS threadsubject, u.username, u.usergroup, u.displaygroup, i.*, i.name AS iconname,
t.dateline AS threaddate, t.lastpost AS threadlastpost
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."icons i ON (i.iid=t.icon)
LEFT JOIN ".TABLE_PREFIX."users u ON (t.lastposter=u.username)
WHERE t.visible = '1'
$unviewwhere
GROUP BY t.tid
ORDER BY threaddate DESC
LIMIT 0, $threadlimit
");
Any help would be greatly appreciated!
Ah, it was t.lastpost, of course.