The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
static variable in plugin is not static, always gets re-initialized - problem solved.
Created a plugin at the parse_templates hook. Every time the screen is refreshed it keeps echoing '0', and does not increment as expected - 0, 1, 2, 3, 4, 5, 6...
Help? function Test() { static $a = 0; $a++; echo $a; } Test(); --------------- Added [DATE]1222142702[/DATE] at [TIME]1222142702[/TIME] --------------- Quote:
function Test() { static $a = 0; $a++; echo $a; } Test(); Test(); Test(); Test(); Will indeed output 1, 2, 3, 4 etc. When a page is refreshed it re-initializes the variable "a" to 0. Seems static variables could be useful but not for what I am trying to accomplish, "session variable" is what might work best. More information over here: https://vborg.vbsupport.ru/showthrea...ble#post255557 --------------- Added [DATE]1222142845[/DATE] at [TIME]1222142845[/TIME] --------------- The "Auto-Merged DoublePost " feature of vBulletin.org is interesting, not sure that is something I can appreciate though. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|