View Full Version : Adding a function to a vbulletin page?
kpf1827
12-12-2008, 10:07 PM
I am trying to add a php function to my template... I made a script in PHP and put it in a file called "script.php" on my server.
Now Here is the problem, how can I call this function on the page, so I can use it? How does vbulletin currently call other functions? BTW this function will be used within the navbar. I cant use a HTML script because it will only work after the page fully loads up. What are your suggestions. Thanks!
Seven Skins
12-12-2008, 10:14 PM
May be this will help you.
http://www.vbulletin.com/docs/html/templates_externalfiles
.
kpf1827
12-12-2008, 11:04 PM
How does vbulletin make all their php functions work? How do hackers get all their php functions to work?
I tried what was posted above, but it is like copying and pasting everything in script.php into a html template. I dont get how vbulletin files are php, and yet their working on html templates?
Lynne
12-13-2008, 12:02 AM
All the pages in vb are php pages. Just because the templates require you to use valid html in them does not mean they are not part of a php page. (You can have html in the middle of a php page also.)
kpf1827
12-13-2008, 01:39 AM
I have a php script located in script.php
And I put this in my navbar template...
<?php
include "script.php";
?>
<?php
echo myfunction(blah blah,15)
?>
It is not working. It is obviously wrong, but I dont know how to fix it.
Lynne
12-13-2008, 03:55 AM
You can't put that in your template - you may only put valid html in your template.
Did you read the link that Seven Skins posted - the part about including a php file?
kpf1827
12-13-2008, 12:04 PM
You can't put that in your template - you may only put valid html in your template.
Did you read the link that Seven Skins posted - the part about including a php file?
Yea, but when I put $includedphp in my template, it was just like I went into my script.php file and copied everything in it and pasted it into the template.
This is what I have in my template as of now:
<?php
include "$includedphp";
?>
Lynne
12-13-2008, 02:33 PM
It simply says "Place $includedphp in one of your templates". So, just put:
$includedphp
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.