MyBB Community Forums

Full Version: Grab extra information from users table on index
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Before I had upgraded MyBB, I had somehow adjusted the query so I could grab all user data of the last poster based off the last post in the forum. I can't seem to figure it out because it was a core file change that I forgot to write down to do.

This is the part that I believe influences it on the index.php file
// Build a forum cache.  
	$query = $db->query("
		SELECT f.*, fr.dateline AS lastread
                FROM ".TABLE_PREFIX."forums f
                LEFT JOIN ".TABLE_PREFIX."forumsread fr ON (fr.fid=f.fid AND fr.uid='{$mybb->user['uid']}')
        	WHERE f.active != 0
		ORDER BY pid, disporder
	");

I've tried this already
$query = $db->query("SELECT f.*, fr.dateline AS lastread, u.*
FROM ".TABLE_PREFIX."forums f
LEFT JOIN ".TABLE_PREFIX."users u ON (f.lastposteruid=u.uid)
LEFT JOIN ".TABLE_PREFiX."forumsread fr ON (fr.fid=f.fid AND fr.uid='{$mybb->user['uid']}')
WHERE f.active != 0
ORDER BY pid, disporder
");

I already have the template to what it should be.