The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Customised $headinclude
I am currently trying to customise my default template. I would like slightly different headers to display on the forum depending on where in the forum somebody is browsing (i.e whether they are looking at the forum listings, viewing a thread, looking at the memberlist, etc).
Therefore I will need to create slightly different headinclude versions in the template (such as headinclude2, headinclude3, headinclude4, etc) and then insert these into the relevant parts of the forum (e.g. in SHOWTHREAD section in the template calling $headinclude2 instead of the default $headinclude). What do i need to do in order to make this work? I understand that i will need to write some sort of plugin to make these customisations available to the forum? Has anybody got any guidance as to the steps needed in this instance? Thanks in advance |
#2
|
|||
|
|||
Try creating a plugin which acts on global_start, and then have the code:
eval('$header2 = "' . fetch_template('header2') . '";'); eval('$header3 = "' . fetch_template('header3') . '";'); You can then name $header2, etc in the main template (SHOWTHREAD, etc) and it will call the alternate header template. |
#3
|
|||
|
|||
Thank you - this works like a dream!
If i just wanted this variable to only act on SHOWTHREAD would there be a more resourceful place to hook this into other than global_start? Thanks. |
#4
|
|||
|
|||
If you only want it in showthread, then I would just put it directly into the SHOWTHREAD template. No more calls, it's directly in there.
Otherwise, you may be able to create a plugin which acts on the hook showthread_start, which I think would be called just on showthread. |
#5
|
||||
|
||||
I would not use global start as it has been deprecated for a couple of years.
PHP Code:
|
#7
|
||||
|
||||
ACK!!!!
OK, forget my post. I will start looking at the forum title. I will start looking at the forum title. I will start looking..... |
Благодарность от: | ||
blind-eddie |
#8
|
|||
|
|||
Ok here's what i'm doing to simplify things.
I'm pasting my customised header into SHOWTHREAD. I'm copying the contents of headinclude and replacing the $headinclude call in SHOWTHREAD with the code which is then slightly modified. However, some users have reported weird behaviours on the thread pages ever since doing this (things such as white screens appearing when they try to post or buttons missing in their editor toolbar). The code copied from headinclude is exactly as is with just a couple of google ad tags added to it so im' not sure why it should affect the template in such a drastic way. Any ideas? |
#9
|
||||
|
||||
Ideally you should have created x amount of headinclude templates and replaced (using and IF condition and str_replace ) $headinclude with $headincludex (where x would be the defining number), you don't want to put all the headinclude code in showthread, this is beacuse the headinclude content goes in the header template, by adding it to the showthread you ar enot encapsulating it in the HEAD tags.
|
#10
|
||||
|
||||
Here's a quick product i knocked up so you can display stuff in the headinclude (you may need to go to plugins and activate the plugin as i cant remember if i did that
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|