vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to show ad only on the homepage? (https://vborg.vbsupport.ru/showthread.php?t=246222)

yaskevic 07-09-2010 04:00 PM

How to show ad only on the homepage?
 
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

PHP Code:

<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

Quote:

Originally Posted by BirdOPrey5 (Post 2067331)
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.


All times are GMT. The time now is 02:19 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00997 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete