PDA

View Full Version : Custom Global Variables


Boeman
06-05-2003, 07:05 PM
One of my external scripts referenced in PHPInclude requires the use of a global variable called $count_border to which it adds a count each time the script is called (it could be several times on a single page).

The script uses the counter only as a means of testing whether or not it was called for the first time with forumbit 1. If this is the first call go to option 1, if it has been called before go to option 2. Laid out like this:

If ($count_border < 1) {
Do this
} else {
Do this instead
}

Since I was told that the php code for formbit templates are processed after phpinclude, this is impossible without some kind of modification to the php files that are included with Vbulletin. I tried putting in $count_border variable as a global right after the line "return $forumbits;" as $count_border++; so it wouldn't equal 1 when forumbit is used next time. Of course it didn't work but implanting some kind of variable and altering its value right after the function is called so the external script would know the value has changed might just be all I need.

Is there a straightforward to do this with VB?

Thanks.