View Full Version : How to show ad only on the homepage?
yaskevic
07-09-2010, 04:00 PM
I?d like to show an ad in the header of my forum only on the homepage. Below is a code from Header template.
What should I add or change in the code? Thanks in advance.
<td width="125"><a href="*******link of the advertiser" rel="nofollow" target="_blank"><img src="advertiser/Emma.jpg" /></td></a>
<td style="background: url(images/bigred/gradients/gradient_banner.gif) repeat-x;"></td>
James Birkett
07-09-2010, 04:10 PM
<if condition="THIS_SCRIPT == 'index'"><td width="125"><a href="*******link of the advertiser" rel="nofollow" target="_blank"><img src="advertiser/Emma.jpg" /></td></a>
<td style="background: url(images/bigred/gradients/gradient_banner.gif) repeat-x;"></td></if>
BirdOPrey5
07-10-2010, 05:03 PM
And just to add to the above, that code works if your homepage is 'index.php' if you renamed it to 'forum.php' then use THIS_SCRIPT == 'forum' in the if statement, or whatever else you may have renamed it to without the .php.
James Birkett
07-11-2010, 09:55 AM
And just to add to the above, that code works if your homepage is 'index.php' if you renamed it to 'forum.php' then use THIS_SCRIPT == 'forum' in the if statement, or whatever else you may have renamed it to without the .php.
I thought THIS_SCRIPT is a constant? So even if it's index.php but the constant is defined "abracadabra" then he'd use "THIS_SCRIPT == 'abracadabra';
KProjects
07-11-2010, 11:47 AM
Near the top of every page is:
define('THIS_SCRIPT', 'xxxxxxxxx');
xxxxxxx usually is the name of the file w/o the extension.. ie: index is index.php, showthread for showthread.php but sometimes they're different..
so you're both right :)
BirdOPrey5
07-11-2010, 03:32 PM
oh, actually I didn't know about that- thanks.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.