Log in

View Full Version : Trying to combine my game with vBulletin


c4smok
07-10-2007, 06:02 AM
So far I have set it up so it uses the same logins when created but I am having a problem with setting up the checks for the game itself. That is because I need to figure how to add vars into the template from more tables I added to the vbforum database, since you can not directly put php into the template. So far I have not touched any php in the files because I can not find where to start at. I simply want it to check if the person is in the game... How big they are and so on and show it on the nav bar, but I am having an issue on finding where I need to start out to do this.

Thanks,
c4smok

Dismounted
07-10-2007, 06:05 AM
Put your code in a plugin hooking at global_start. Make sure you assign the data to a variable. Then use that variable in templates.

c4smok
07-10-2007, 08:28 AM
Tried this but it does not seem to work.. put it in global_start


$gameuser = mysql_fetch_array($db->query("SELECT * FROM game_users WHERE username='$vbulletin->userinfo[username]';"));

trying to match up usernames so I can import the vars for my checks..

Dismounted
07-10-2007, 09:09 AM
$gameuser = $vbulletin->db->query_first("
SELECT *
FROM `game_users`
WHERE `username` = '" . $vbulletin->userinfo['username'] . "'
LIMIT 1
");

c4smok
07-10-2007, 09:14 AM
that works great =)

you own..