steven s
08-31-2008, 05:34 PM
I have several templates that require minor editing after reverting.
I figure it's time to learn how to use plugins to do my editing.
I've read a few tutorials and still not grasping it.
For my first plugin I simply want to add the background color black to my header template.
The reverted template looks like this
<!-- logo -->
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
<td align="$stylevar[right]" id="header_right_cell">
<if condition="$ad_location['ad_header_logo']">$ad_location[ad_header_logo]<else /> </if>
</td>
</tr>
</table>
<!-- /logo -->
<!-- content table -->
$spacer_open
$_phpinclude_output
$ad_location[ad_header_end]
The bottom of the index.php file is
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTTA HERE... ###
($hook = vBulletinHook::fetch_hook('forumhome_complete')) ? eval($hook) : false;
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('FORUMHOME') . '");');
My plugin is
Product: vBulletin
Hook Location: forumhome_complete
$find = '<td align=\"$stylevar[left]\">';
$replace = ' bgcolor=\"black\"';
$vbulletin->templatecache['FORUMHOME'] = str_replace($find, $replace . $find, $vbulletin->templatecache['FORUMHOME']);
Can someone please point me in the right direction or shed some light?
I figure it's time to learn how to use plugins to do my editing.
I've read a few tutorials and still not grasping it.
For my first plugin I simply want to add the background color black to my header template.
The reverted template looks like this
<!-- logo -->
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
<td align="$stylevar[right]" id="header_right_cell">
<if condition="$ad_location['ad_header_logo']">$ad_location[ad_header_logo]<else /> </if>
</td>
</tr>
</table>
<!-- /logo -->
<!-- content table -->
$spacer_open
$_phpinclude_output
$ad_location[ad_header_end]
The bottom of the index.php file is
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTTA HERE... ###
($hook = vBulletinHook::fetch_hook('forumhome_complete')) ? eval($hook) : false;
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('FORUMHOME') . '");');
My plugin is
Product: vBulletin
Hook Location: forumhome_complete
$find = '<td align=\"$stylevar[left]\">';
$replace = ' bgcolor=\"black\"';
$vbulletin->templatecache['FORUMHOME'] = str_replace($find, $replace . $find, $vbulletin->templatecache['FORUMHOME']);
Can someone please point me in the right direction or shed some light?