PDA

View Full Version : PHP - retrieve profile field


Duckface
07-12-2015, 03:07 PM
Hiya,

With what variable can I retrieve a user's profile field off a user's id. I already have declared the userid:

$userid = $vbulletin->userinfo['userid'];

bridge2heyday
07-12-2015, 03:42 PM
if you have $vbulletin->userinfo already exist you can use
$vbulletin->userinfo['fieldxx'];
where xx is the field number

Duckface
07-12-2015, 04:11 PM
Thanks. Where can I find the entire array of userinfo variables?

bridge2heyday
07-12-2015, 09:18 PM
you can use var_dump to see the contents of the array

Duckface
07-13-2015, 08:26 AM
you can use var_dump to see the contents of the array


Where do I use that?

kh99
07-13-2015, 11:13 AM
You would need to put it somewhere where you can see the output. One thing you could do it make a plugin using hook misc_start and code like this:
if ($_REQUEST['do'] == 'var_dump')
{
echo "<pre>";
var_dump($vbulletin->userinfo);
echo "</pre>";
exit;
}

Then to see it go to misc.php?do=var_dump . (You'd probably want to disable the plugin when you're done).

Duckface
07-13-2015, 01:40 PM
Thanks man!