View Full Version : Integrating into templates
General Ray
09-22-2009, 02:22 AM
Just another noob modding question of mine. From what script is all the PHP code inserted into the templates? If I have a variable, say $var[test], how would I integrate that page into the vB templates so I can reference that variable?
Brother Malachi
09-22-2009, 02:32 AM
Using plugins ;)
Which page are you trying to use that variable on? Where are you defining that variable?
General Ray
09-22-2009, 06:38 PM
It's all custom work, actually. I just need to know where or how to plugin to the templates.
Lynne
09-22-2009, 07:03 PM
If it is a custom page of yours, then you don't need to use the plugins.
You may want to read these regarding Plugins/Products:
https://vborg.vbsupport.ru/showthread.php?t=82625
https://vborg.vbsupport.ru/showthread.php?t=82923
General Ray
09-23-2009, 12:25 AM
I know I don't need the plugins, that was the point of my upper post. I need to know how to include custom script into the templates.
Lynne
09-23-2009, 03:58 AM
You cannot include custom script in a template. You do any sort of scripting in the php file, or plugin, and then just spit out the results in the template.
General Ray
09-23-2009, 06:57 PM
That's what I need to know. How do I get said results to spit out to the templates?
I may have misused the word include, if that is the case, apologies. I don't normally work with templates, so I'm at a slight disadvantage here.
Lynne
09-23-2009, 07:20 PM
You still haven't specified if you are writing your own php page or trying to add to an existing one. Either way, you will do the php code in your page, or in a plugin, and assign the results to a variable, $myvar = foo;, and then use that variable in the templates. It's very hard to answer your questions when you are being so vague.
General Ray
09-24-2009, 01:19 AM
The script is all custom. Custom php files.
Lynne
09-24-2009, 03:35 AM
OK, then in the custom script, you will assign results to variables and then use the variables in the templates. Have you seen these articles? How to create your own vBulletin-powered page! (uses vB templates) (https://vborg.vbsupport.ru/showthread.php?t=62164) or [How-To] vBulletin API Basics: Creating Custom Pages & Misc. (https://vborg.vbsupport.ru/showthread.php?t=98009)
General Ray
09-27-2009, 05:32 PM
No I haven't, but I will take a look at them. Anything else worth knowing?
Thanks for all your time!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.