![]() |
A bit confused about new hooks calls
Hi, i'm little confused about using template hooks in vB 4, so i just ask here for little help. Hope someone helps me
On vB 3.8.x i had a little server status check in navbar. Template edit was: Code:
[ SERVER1 status: $status1 | SERVER2 status: $status2 ]<br /> Product: vBulletin Hook location: global_start Code:
include "/var/www/mysite.com/misc/serverstatus.php"; But now, on vB 4, it just looks like: [ SERVER1 status: $status1 | SERVER2 status: $status2 ] So i miss something and i cant figure out what ... Thanks in advance for help Holy |
Any help please?
|
You probably haven't registered the variables and used the new variable syntax in the template. Download a vB4 mod and look at how they register variables.
|
change $status1 to <vb:var status1> in the template. You'll also need to pre-register them to the navbar.
|
Thanks, now it is ok, but it ignores html tags :/
My PHP: Code:
include "/var/www/mysite.com/files/status.php"; Template mod is: Code:
[ SERVER1 status: {vb:var status1} | SERVER2 status: {vb:var status2} ]<br /> And it shows as: [ SERVER1 status: <font color=green>ONLiNE</font> | SERVER2 status: <font color=green>ONLiNE</font> ] Any ideas? Thanks |
The font tag has been deprecated since 1996. Use CSS to achieve the colour effect instead.
|
Yep, i know and i tried CSS too, but same problem. For example
Code:
if ($server1 == 1) { So i think, there are some restrictions or something with that var pre-register, because if i use this on normal PHP, everything is fine, so the script is fine. |
What are you using in the template? {vb:raw status1}?
From Wayne's article: Quote:
|
A million thanks for Lynne! That three chars almost killed me. Now it works perfect!
I'll send some Tequilla shots to California ^^ |
All times are GMT. The time now is 07:09 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|