Log in

View Full Version : adding valuse to global variables


Ranma2k
03-01-2005, 09:33 PM
hi all,
well i'm in the process of writing my hack for my site ..
and i was wondering how can i add a value in the global variables such as
$vboptions or $user

for example i want
$vboptions[somevar]=some value

so i can use it anywhere in the board ?!

where does these variables get initiated ?!

Thanks

Ranma2k
03-03-2005, 12:17 PM
well anyone can help ?
i'll refrase my Q ..

in VB the global variables $vboption & $vbuserinfo can be used any where in the files ..
so that Vbuserinfo have all the user info
and vboption have all the board options

what i need to know is where is the varibales get initiated
cuz i want to add some more options to the board and more user date in the user data variable

so i can use it anywere in vb ..

Hope someone can help me with this

Thanks

Marco van Herwaarden
03-04-2005, 07:56 AM
You could do that anywhere.

just use:
global $vboptions;
$vboptions['myvar'] = 'myvalue';

Deaths
03-04-2005, 08:00 AM
I believe he means that he wants to be able to use the var anywhere...

You can do so by adding this code to your global.php:

global $vboptions;
$vboptions['myvar'] = 'myvalue';

Xenon
03-04-2005, 03:36 PM
i suggest to add those things to phpinclude_start ;)

but to answer the question, the session.php is responsible for the bbuserinfo array for example