MyBB Community Forums

Full Version: User array in postbit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I suggest that the $mybb->user array be available in the postbit as a value in the $post array.

Eg. $post['user']['username']

That way there doesn't need to be duplicated data for the postbit array, and developers can assume the same data in $mybb->user is available in the postbit for that particular user.
Isn't it already set to that? $post is all the data in the user table for the user who posted the post, and $mybb->user is all the data in the user table for the current user.
(2013-05-02, 08:05 AM)Seabody Wrote: [ -> ]Isn't it already set to that? $post is all the data in the user table for the user who posted the post, and $mybb->user is all the data in the user table for the current user.

I was under the impression that $post (or $postbit) is the data for the current post so you can populate your template, but it only gave you basic information about the author (not all of their data) as you'd expect to find in $mybb->user.

I haven't tested it out yet so this is just my assumption.
Correct me if I am wrong, but I think the query pulls everything?

		$query = $db->query("
			SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername
			FROM ".TABLE_PREFIX."posts p
			LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
			LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
			LEFT JOIN ".TABLE_PREFIX."users eu ON (eu.uid=p.edituid)
			WHERE $pids
			ORDER BY p.dateline
		");