I figure out how to solve it:
hook: process_templates_complete code: $footer .= 'text added to footer'; No idea if was the best solution, but that worked very well. |
1 Attachment(s)
Quote:
PHP Code:
Attachment 106372 Using str_replace, you can also add stuff in the middle of the template like so: PHP Code:
|
Hi,
I'm trying to add something that requires PHP under the navbar. Back in vb 3.8.x I just used plugins for this. But, I'm not sure which hook to use if I want to display something under the navbar. |
@David: This is not related to the topic of this article. You should open your own thread on this..
Also, I just added the bonus track about template caching. |
Quote:
It's $cache[] = 'xxx'; and not $globaltemplate now;) ;) |
Ah, damn, of course you're right. I had my example code for vB3 and the one I was about to change for vB4 side by side and then obviously copied/pasted the wrong one. Stupid me :)
|
Quote:
I made the mistake in all my add-ons on porting them to vB4:D |
Thanks for the "cache your templates" info, I made use of this info after making my own Terms of Service and Privacy custom pages, very helpful, thank you.:up:
|
Quote:
<hookname>showthread_query</hookname> $vbulletin->templatecache['postbit'] = str_replace($find, $replace, $vbulletin->templatecache['postbit']); Also can this be used on variables? ex: {vb:raw variable} |
This isn't working for me. I'm probably doing something wrong, but at the moment I have a custom php page (I created following another tutorial elsewhere) that is calling a custom template.
The code for the php page: PHP Code:
And the HTML template (called TESTPAGE): HTML Code:
{vb:stylevar htmldoctype} PHP Code:
Where have I gone wrong? I've spent a good half an hour going through the tutorial and trying various things but can't seem to get it working. It always makes the whole site blank, but if I call another template (e.g. contactus instead of TESTPAGE) it works fine, so the problem seems to lie with the plugin. Any help greatly appreciated - thanks in advance :) |
All times are GMT. The time now is 03:09 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|