SiteTalkZone
01-20-2011, 04:19 PM
Hi all,
I am researching to write my plug-in in vB3.x
I would like to insert addition information into header of my forum (header template).
I wrote a plug-in and used code following to insert:
global $vbulletin;
$additionalVar = "Additional Content";
$vbulletin->templatecache['header'] = str_replace('<!-- Additional-Content -->', '<!-- Additional-Content --><br />'.$additionalVar, $vbulletin->templatecache['header']);
I tried hook this plug-in to forumhome_start location.
And in the header template, I putted the text <!-- Additional-Content --> into location that I want to.
However, when I accessed to my forum, it changed nothing. But if I tried to use command print $additionalVar to print directly in plug-in, so "Additional Content" string displayed on top of the forum homepage, but when I accessed another page, the text disappeared.
So I would like to know:
- How to transfer content of variable from plug-in to template.
- Which location need to be hooked in order to change for all page of forum.
Thanks!
I am researching to write my plug-in in vB3.x
I would like to insert addition information into header of my forum (header template).
I wrote a plug-in and used code following to insert:
global $vbulletin;
$additionalVar = "Additional Content";
$vbulletin->templatecache['header'] = str_replace('<!-- Additional-Content -->', '<!-- Additional-Content --><br />'.$additionalVar, $vbulletin->templatecache['header']);
I tried hook this plug-in to forumhome_start location.
And in the header template, I putted the text <!-- Additional-Content --> into location that I want to.
However, when I accessed to my forum, it changed nothing. But if I tried to use command print $additionalVar to print directly in plug-in, so "Additional Content" string displayed on top of the forum homepage, but when I accessed another page, the text disappeared.
So I would like to know:
- How to transfer content of variable from plug-in to template.
- Which location need to be hooked in order to change for all page of forum.
Thanks!