View Full Version : Passing variables to vBulletin on non-vB pages
inthezone
04-17-2008, 03:47 AM
Is it possible to set a variable on a non-vB page, then pass it to vB so it can be used in a template? e.g.
$headline = "Welcome to our site!"
eval('$vbheader = "' . fetch_template('header') . '";');
echo $vbheader;
And somehow pass $headline to the 'header' template, so it can display "Welcome to our site!"?
Dismounted
04-17-2008, 05:47 AM
<a href="http://www.vbulletin.com/docs/html/main/templates_externalfiles" target="_blank">http://www.vbulletin.com/docs/html/m..._externalfiles</a>
inthezone
04-17-2008, 12:34 PM
It looks like that will let me include an entire file, but I don't see how it lets me include a single variable.
Another issue is that the $headline variable can change multiple times within the script:
switch ($action) {
case add:
$headline = "Add Item";
break;
case delete:
$headline = "Delete Item";
break;
case edit:
$headline = "Edit Item";
break;
}
Would the above be possible with plugins?
Dismounted
04-17-2008, 12:47 PM
I though you maybe wanted to include a file for your "headline". If all you wanted to do was assign a few variables based on conditions, yes, that could be done using plugins. Hell, it could probably be done using templates only.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.