PDA

View Full Version : hooks issue on 4.2.4


flox80
04-07-2017, 02:17 PM
Hello,

I've been trying to add some simple html hooks, but I can not get it to show at all. Below I tried to add a very simple html on the top of the page.

1. Plugin manager, add new plugin

Product: Vbulletin
Hook location: global_start
Title: $includedhtml
Execution order: 1
Plugin PHP code: $includedhtml = implode('', file('/home/web1/*****************.com/htdocs/test4567.html'));
Plugin is active: Yes

2. Styles&Templates - Search in templates - found the header for the default style
inserted at the beginning: {vb:raw includedhtml}

In Options - Plugin/Hook System - Yes

Am i missing something? Any input would be really helpful.

Thank you.

MarkFL
04-07-2017, 02:23 PM
In your plugin, you need something like:

vB_Template::preRegister($template_name, array('includedhtml' => $includedhtml));

Replace "$template_name" with the name of the template in which you want this variable to be available.

flox80
04-07-2017, 02:57 PM
In your plugin, you need something like:

vB_Template::preRegister($template_name, array('includedhtml' => $includedhtml));

Replace "$template_name" with the name of the template in which you want this variable to be available.

Got it.

Thanks a lot for your help - have a nice weekend.