PDA

View Full Version : Simple request for GLOBAL variable.


chilliboy
06-25-2001, 05:03 PM
Hi,

I've been messing with the $GLOBALS variables for several hours, but I can't find one which holds the name for the $styleid.

I want to use it for a hack in phpinclude - is there a variable that holds it? or is there a function in functions php I can use to get hold of it?

Cheers in advance.

Wayne Luke
06-28-2001, 03:04 AM
Well the styleid is attached to the user's info and stored in a cookie on their machine...

Since it is part of the user information you can find it in the $bbuserinfo array as $bbuserinfo[styleid]

chilliboy
06-29-2001, 08:58 AM
Thanks for the reply. I have found that quite a few variables hold the 'value' for styleid - simply $styleid seems to be globally available. However what I need is the 'name' of the style and not just the numerical value.

eg $styleid will hold numeric value eg 10
but how can I get its corresponding name eg FastCar

Wondering why the hell I want it?

Well the name is more flexible for use with scripts used in phpinclude, and you could use the 'name' for various stuff.

eg If I want to a certain image to appear for that style you could use:

$MyImage = $StyleName . ".gif";

Also

$MyTitle = $StyleName . " forum";

etc - then drop them in a template

Of course you could do it by adding different replacement sets and changing them in there, but my way would be much faster and less cumbersome.

If I can't get hold of the style 'name' as a variable I would have to Input these values by hand and run $styleid through a switch statement to get the 'name' as a variable. However it would be much better if I could get hold of the style 'name' as a variable without having to do this.