The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
I added a new template but how do I use it?
Hi,
I made a new template from my admin panel + I want to include it in my header. All the other templates seem to be included in one another just by adding "$templatename" but it doesn't work for the one I created. Do I need to do something to assign a "$name" to it? Thanks! -Gaz |
#2
|
||||
|
||||
You'll need to do these things:
1) Create your template, templatename, which you've already done and 2) Create 2 plugins Go to your admincp => Plugins & Products => Add New Plugin => Plugin 1 Product - vbulletin Hook Location - cache_templates Title - Title of Plugin 1 Plugin PHP Code - Code:
$globaltemplates[] = 'templatename'; Plugin 2 Product - vbulletin Hook Location - global_start Title - Title of Plugin 2 Plugin PHP Code Code:
global $db, $vbulletin; eval('$templatename .= "' . fetch_template('templatename') . '";'); |
#3
|
|||
|
|||
Hi David. Thanks for your help!
Using your method it now shows up on the forum pages. It is my ibproarcade pages I want it show up on though + it doesn't seem to work on those. Do you know of anything I can do to fix that? -Gaz |
#4
|
||||
|
||||
You may need to request help under that modification's support forum.
|
#5
|
|||
|
|||
David, your plugin advice got my added template to show up too, yet created an odd problem that I'm stuck on. What I did was literally cut a section of code (my custom navbar) that I had duplicated in the SHOWTHREADS, FORUMDISPLAY, etc templates and pasted it into a new added template called navbar_forums. I then referenced $navbar_forums in the aforementioned default templates and used your plugin code to get it to show up.
However, not all the cut and pasted code evaluates correctly through the $ reference, but if I remove the $ reference and paste the same code chunk directly back into SHOWTHREAD, it all works correctly. The problem seems to be that this <if> statement does not evaluate properly regardless of whether I use a browser with or without popups (I test in multiple browsers) Code:
<if condition="$show['popups']"> Code:
<if condition="$show['member']"> <if condition="$show['quicksearch']"> So how does a code chunk parse correctly, except when included through a new added template? Could this issue have something to do with the plugin code? Any other ideas? |
#6
|
||||
|
||||
It could possibly - I've had two hacks that both use global_start conflict with each other, depending on its contents. To test this out, if sort your plugins by hook location and find others that share global_start. Then try disabling others one at a time to see if there is a conflict.
Also, although Dreamweaver may be satisfied that all tags have ends, your total script may not start/end. When a page is displayed, it displays everything in that page inclusive of all templates. If one previous template has an unclosed tag, or one latter template does not close, then you might have issues. The same goes with the basics of html. What you see in Dreamweaver is only one section of code, which satisfies by closing all tags, as you state. That is just something to keep in mind. (I've run into this upon occasion when building non-vbulletin websites completely from scratch) Also, keep in mind, that although the code may satisfy tag closure, the code itself may have an issue within itself or with something else it is being used with. If you want, PM me the code or paste it here and I will try to look at it later. |
#7
|
|||
|
|||
No other plugins are using global_start, but my Downloads plugin was using cache_templates. I disabled that one, emptied my browser cache, but it made no difference.
I understand the idea that another template may not open or close properly, but in my tests I replace the template "$reference" with all of the code from the actual referenced template. In theory the same code gets exported in the end, so any improperly opened or closed tags in the rest of the page should have the same affects, no? I feel like I can't explain without a short, fake example (because my actual code is very long): If SHOWTHREADS contains: Code:
<p>Unclosed p tag here $navbar_forums <p>hello world</p> Code:
<p>this is the new template</p> Code:
Unclosed p tag here this is the new template hello world If I just wrote SHOWTHREADS as: Code:
<p>Unclosed p tag here <p>this is the new template</p> <p>hello world</p> |
#8
|
||||
|
||||
Are you calling another template within the custom template? If so, that will most likely not work (I've spent a couple hours working on an 7-day ad rotation hack that had similar issues).
|
#9
|
|||
|
|||
Quote:
|
#10
|
||||
|
||||
Quote:
If you do have 3.x are you getting any error at all? Are you double sure your plugins were set to ACTIVE (YES)? |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|