The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Using Custom Template from FORUMDISPLAY
I am having issues trying to display a modified version of the FORUMDISPLAY style in my custom displayresources style. I then defined the variable named $displayresources. What I am trying to achieve is a custom Forumdisplay for a particular forumid for a particular forum that matches the condition if forumids equaled x.
I have defined the custom template in a variable as below using the Global_Start hook: Code:
eval('$displayresources = "' . fetch_template('displayresources') . '";'); PHP Code:
*Check the FORUMDISPLAY.txt attachment for the FORUMDISPLAY modification. So to sum things up, I basically took the forum content from forumdisplay and pasted it in my displayresources template, but it doesnt show for some reason. For further display, you can see the custom forum display not properly showing in this link. Make sure the skin is set to WC3 Night Elf. Someone please help me. |
#2
|
|||
|
|||
I found out that I needed to define the forumslist variable, but how? I tested the one below and it shows the forums but, it doesnt use the displayforuim.php variables and conditions.
PHP Code:
PHP Code:
PHP Code:
|
#3
|
|||
|
|||
Try using hook location forumdisplay_complete instead of global_start, and go back to your original code (except you don't need $GLOBALS[displayresources], just use $displayresources).
A hook location is a place in the code. If you open the file global.php and search for global_start, you can see what a hook location looks like. It basically just inserts the plugin code at that point. The reason global_start didn't work is that it's a location that doesn't have the variables defined that you need, and it's not the right place to include a file like forumdisplay.php (in fact forumdisplay.php includes global.php, so that couldn't really work). Also, you defined the $show['forumdisplay'] correctly, but if it's just going to be defined as 'true' always, then you don't really need it, you could just remove that condition from the template instead. |
#4
|
|||
|
|||
Wow, after several days of searching and looking up how to use Hooks, I think that it makes sense now. Since the forumdisplay.php includes the globals.php and is not the globals itself, I would have to use the forumdisplay_complete hook.
It works perfectly now! May I ask how exactly I can determine which hook to use in the future? I somewhat understand, but I just dont know entirely how to completely determine. Theres so many hooks. Also if I wanted to display my customized forumdisplay I would do the condition like below? PHP Code:
|
#5
|
|||
|
|||
Quote:
Quote:
Code:
if (in_array($foruminfo['forumid'], array(35,36,12,15))) eval('$displayresources = "' . fetch_template('displayresources') . '";'); else $displayresources = ''; Quote:
BTW, having an editor or other program that lets you search a set of files (on your local computer) helps immensely. Also, I use this site a lot for PHP reference: http://us2.php.net/tut.php |
#6
|
|||
|
|||
Thank you that helped a lot!
Also I realized that I can just look at the forumdisplay.php or any .php file and search for the "Eval Hooks" used for different templates |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|