The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I'm trying to add this into my template...
<?php echo file_get_contents("http://site.net/site/onlineplayers.php"); ?> there are [..] online</font></p> <br> but.. i get this. ![]() It's not showing the text any way to do this? I'm trying to get the number from that page it works fine if i just add that code into a .php file. |
#2
|
||||
|
||||
![]()
You can't add php code into a template. You can only run php code from a hook or from a php file.
|
#3
|
|||
|
|||
![]()
Mind giving me an example?
|
#4
|
|||
|
|||
![]()
How does that code work? I guess the number of players online is supposed to appear in place of [..], but I've never seen that before.
Anyway, in a plugin you'd do something like: Code:
$players_online = file_get_contents("http://site.net/site/onlineplayers.php"); vB_Template::preRegister('template', array('players_online' => $players_online)); then in your template you'd use something like: Code:
there are {vb:var players_online} online |
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|