At the end of the plugin code, we also need to declare the template that this variable is being pushed to.
Code:
vB_Template::preRegister('Template_name',array('HelloWorld' => $HelloWorld));
Step 1
Add the variable {vb:raw HelloWorld} to the first line within the header template.
Step 2
Create a new plugin from admincp->Plugin & Products->Plugin Manager and scroll all the way down and click Add new Plugin.
Step 3
The following would be the information that you would place into the input fields for this new plugin.
Product: vBulletin
(or whatever product you want to assign this plugin to)
Hook Location: global_start
(To simplify things for this example, we use global_start rather than parse_templates)
Title: Hello
Execution Order: 5
Plugin PHP Code:
Code:
$HelloWorld = "Hello World"; vB_Template::preRegister('header',array('HelloWorld' => $HelloWorld));
Step 4
Save your plugin.
Now with all of the steps complete, you should be able to visit your forum and see the words "Hello World" printed at the top.
Thanks,
-Nay