Log in

View Full Version : Small Mod question


Ipuck
04-23-2008, 09:37 PM
I'm making a small and simple mod for my site. Th users enters some data, the data is stored in a table and then every time the users access the page, the mod run a query and get the users data.

Problem:

I can only get the script to run the query and echo the results if the user access the page like this: http://xxx.com/forum/mypage.php?username=xxxxxx

Question:

Is there any way to run the query as soon as the user enter the page?

just by typing the page : http://xxx.com/forum/mypage.php

I don't have PHP experience and any help will be appreciated.

Dismounted
04-24-2008, 06:47 AM
The script still needs to know which user to process. Do you mean you want to just fetch the current user? This can be done by using the $vbulletin->userinfo array.

Ipuck
04-24-2008, 04:05 PM
The script still needs to know which user to process. Do you mean you want to just fetch the current user? Yes, yes, yes.

This can be done by using the $vbulletin->userinfo array. How? :o what line do I need to add to the php page?

I added this line: $username = $vbulletin->GPC['username']; (another user suggested) but it didn't work.

thanks


UPDATE: I used $username = $vbulletin->userinfo['username']; and it works, but for some reason only in that page, in the navbar I get: Your PM box is 50% full below the notifications.