MyBB Community Forums

Full Version: A little help about getting UID
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm working on a plugin to use on "Who Posted" area (i.e. Who posted popup box). I'm using $mybb->input['uid'] to fetch posts (with links) in front of the Username (who posted in that thread). But with a lot of efforts its returning 0.

The query is;
$query = $db->query ("
            SELECT pid,tid 
            FROM ".TABLE_PREFIX."posts 
            WHERE visible='1' AND tid='".$mybb->input['tid']."' AND uid='".$mybb->input['uid']."'
            ORDER BY dateline DESC 
            LIMIT 0,5");

Its returning uid=0 Sad
Because there is no $mybb->input['uid'], $mybb->input is the $_POST and $_GET values merged, there is no uid value submitted via $_POST or $_GET, just the tid of the thread. If you do print_r($mybb->input), you'll see there is no uid in there, the uid is not input.
Quick question, what is this Who's Posted box? I've never seen it before, so I was just curious as to what it is.
(2011-05-23, 01:48 PM)euantor Wrote: [ -> ]Quick question, what is this Who's Posted box? I've never seen it before, so I was just curious as to what it is.

Click on the amount of posts of a thread in the forumdisplay page Wink
Ah, thanks a lot! Can't believe I've never noticed that before.