2009-04-11, 10:37 PM
I hope this hasen't been answered before, but here goes:
I'm trying to modify the Overview mod. Specifically, I want the latest threads box to show the threads which have the newest posts in them. In other words, I want to see a list of all the threads which have the latest posts in them.
Here is the latest threads query being used in the Overview mod:
And here is the latest posts query used in the Overview mod:
My SQL-foo is weak, but I imagine I need some kind of join between those two tables to get what I want. Something that will let me capture 'subject', 'username',' 'uid', 'tid', 'views', and[/php] 'replies' from those posts that are newest.
Can anyone give me a hand with this?
I'm trying to modify the Overview mod. Specifically, I want the latest threads box to show the threads which have the newest posts in them. In other words, I want to see a list of all the threads which have the latest posts in them.
Here is the latest threads query being used in the Overview mod:
$query3 = $db->query ("SELECT subject,username,uid,tid,views,replies FROM ".TABLE_PREFIX."threads
WHERE visible='1' ".get_unviewable()." AND closed NOT LIKE 'moved|%'
ORDER BY dateline DESC LIMIT 0,".$mybb->settings['overview_max']."");
And here is the latest posts query used in the Overview mod:
$query6 = $db->query ("SELECT subject,username,uid,pid,tid FROM ".TABLE_PREFIX."posts WHERE visible='1' ".get_unviewable()."
ORDER BY dateline DESC LIMIT 0,".$mybb->settings['overview_max']."");
My SQL-foo is weak, but I imagine I need some kind of join between those two tables to get what I want. Something that will let me capture 'subject', 'username',' 'uid', 'tid', 'views', and[/php] 'replies' from those posts that are newest.
Can anyone give me a hand with this?