PDA

View Full Version : How to get PHP to work in the header in vBulletin


imported_Psybadek
12 Jan 2007, 11:26
Im trying to use the $totalonline php variable in the header, but it wont work, here what I got.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



the part im talking about is at the very bottom with the $totalonline. I put it under the "<!-- content table -->
$spacer_open

$_phpinclude_output"

figuring that needed to be before, otherwise it wont work. :/

help please :)

Tuk4
12 Jan 2007, 17:26
hmmz.. where did you define that var?

imported_Psybadek
12 Jan 2007, 22:31
It was defined in the FORUM HOME template, otherwise I dont know what to do

Kirk Y
13 Jan 2007, 00:29
If you're going to use a variable in the "header" template, you need to create a plugin at "global_start" with the contents of your variable, ie: $var = "hello world!";.

If you're using it on the "forumhome" template, then you can change the hook location to "forumhome_start".

Michael Morris
13 Jan 2007, 00:42
Addendum - if you are displaying a variable in the header template that gets set in the forumhome you'll need to use the first hook after it is set (most likely forumhome_complete) and then re-eval the header template (innefficient, but avoids code hacks).

Tuk4
13 Jan 2007, 02:10
Hmmz.. ok so in Forumhome template, and you added it in forumhome_complete template.
and its still not working, mind showing me the plugin?