zushiba
02-07-2011, 03:20 PM
Hey all. I am trying to write what should be an easy widgit using php but I'm struggling with finding out how to retrieve the username or userID.
I am trying to list forms the user has entered but to get to that point I need the users ID.
After searching and searching I find a lot of stuff for VB 3 that either no longer works or never worked. The last, simple code I found was
ob_start();
$myusername = $vbulletin->userinfo['username'];
echo $myusername;
$output .= ob_get_contents();
ob_end_clean();
But that outputs nothing. I tried looking through the VB4 articles but those seemed focused on creating templates and stuff, all of which is too big for what I'm trying to do and they STILL seem to leave out simple stuff like retrieving user info via php.
EDIT: Solved using the following code
ob_start();
$myusername = vB::$vbulletin->userinfo['username'];
echo $myusername;
$output .= ob_get_contents();
ob_end_clean();
required vB::
I am trying to list forms the user has entered but to get to that point I need the users ID.
After searching and searching I find a lot of stuff for VB 3 that either no longer works or never worked. The last, simple code I found was
ob_start();
$myusername = $vbulletin->userinfo['username'];
echo $myusername;
$output .= ob_get_contents();
ob_end_clean();
But that outputs nothing. I tried looking through the VB4 articles but those seemed focused on creating templates and stuff, all of which is too big for what I'm trying to do and they STILL seem to leave out simple stuff like retrieving user info via php.
EDIT: Solved using the following code
ob_start();
$myusername = vB::$vbulletin->userinfo['username'];
echo $myusername;
$output .= ob_get_contents();
ob_end_clean();
required vB::