PDA

View Full Version : Fetching user id in showthread.php


Craigjb12
05-14-2010, 11:59 AM
Writing a simple query in showthread.php for which I need the user's id.

I see that this is used many times in the showthread.php file:
$vbulletin->userinfo['userid'];

but using

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

seems to result in no value for $user_id. I've been testing it by registering the variable:
$templater->register('user_id', $user_id);

and displaying it in the template:
userid: {vb:raw user_id}

Feels like I'm missing something fairly obvious here, but I'm just a hack when it comes to php/MYSQL, appreciate any help you can render!

--------------- Added 1273843263 at 1273843263 ---------------

On closer inspection, it seems that there is something fundamentally wrong with the way I'm registering the variables on this php page as even a dummy variable isn't being passed through to the template. :erm:

--------------- Added 1273844747 at 1273844747 ---------------

Problem solved, little syntax mistake on my part as usual :rolleyes: