![]() |
Quote:
|
Hello everyone, I have been reading this article over and over again trying to figure out what I am doing wrong. Basically I am trying to put the contents of one template into another using a plug in. The template in question are:
-OFTW -COFTW_FAQ I want to be able to put the contents of template COFTW_FAQ into a variable that I can then use in OFTW template. I am using a script (oftw.php) which uses the OFTW template; I need to be able to insert the contents of COFTW_FAQ into that template using a plug-in. So this is what I have so far: Plug-in 1: Hook: Global Start PHP Code:
PHP Code:
Code:
{vb:raw COFTW_FAQ} Please Help I have been hitting myself in the head for the last 4 hours! :( --------------- Added [DATE]1310166367[/DATE] at [TIME]1310166367[/TIME] --------------- UPDATE!!! After more thinking... I can see that I was a bit off, I am now using only plug in to try and accomplish what I want but still just blank... Hook Location: Process Templates Complete PHP Code:
--------------- Added [DATE]1310224935[/DATE] at [TIME]1310224935[/TIME] --------------- GOT IT!!! FINALLLLY!!!!! xD I had to just register my variable in the actual oftw.php file . Since it was a custom page the script did not have the variable registered so I added PHP Code:
|
Congrats - good to see you got it working :D
|
Quote:
global_bootstrap_init_start should be used instead of global_start in most circumstances. |
Quote:
|
If you are going to assign several variables in a row, you may want to use the quickRegister function, as it is a lot more readable and clear what is happening (IMO).
PHP Code:
|
Quote:
|
As a general rule: Use a hook that is only called where you need the variable. Normally, you execute code before registering to get the values, and you want to run that only if it's needed. Of course, using stuff like if THIS_SCRIPT will do the job, too.
|
i learned how to make custom templates like this. I have a variable that i want to be able to use on the header on every page in vbulletin. I cant get it to save my variable globaly tho. I'm only able to use this var within the template. I read the part where it talked about Save into an array and preregister to use in an existing/stock template. but could not get it to work. by the way, I have no idea how to show code on here
Code:
$eventlist = mysql_query("SELECT * FROM thread WHERE forumid = 8 ORDER BY dateline DESC", $connection); |
Quote:
[code.]your code here[./code] Would be Code:
your code here Would be PHP Code:
Would be HTML Code:
your code here |
All times are GMT. The time now is 02:15 PM. |
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:
|