vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How can I hide the ads banners from this page in forum? (https://vborg.vbsupport.ru/showthread.php?t=278615)

sadiq6210 02-15-2012 02:38 PM

How can I hide the ads banners from this page in forum?
 
I have a forum with some products such as (DownloadII, Gallery, classifieds, cms, ...)

I want to display the ads banners only in forum pages, I mean I want to hide the banners from some pages which is:

forum/downloads.php
forum/classifieds.php
gallery/index.php
/index.php

What is the (if statement) can I use?

__________________________

I have this code to hide the banners from the users profiles and it is working fine

Code:

<vb:if condition="THIS_SCRIPT!='member'">

I tried for example
Code:

<vb:if condition="THIS_SCRIPT!='downloads.php'">
but it is not working with me

Any hint?

Simon Lloyd 02-15-2012 07:29 PM

Have you tried dropping the ".php" ?

Kraxell 02-15-2012 09:50 PM

The best way i think is, you put your adsense-code in the template of your choise.

sadiq6210 02-16-2012 10:57 AM

Quote:

Originally Posted by Simon Lloyd (Post 2300038)
Have you tried dropping the ".php" ?

Yes, It is not working

Quote:

Originally Posted by Kraxell (Post 2300068)
The best way i think is, you put your adsense-code in the template of your choise.

I have a statistics box in navbar, I want to show the ads banners above that box
so I should add the ads banners code either in header or navbar

Iain M 02-16-2012 02:18 PM

Check what THIS_SCRIPT is defined as on each of the pages you don't want your ads to show on.

PHP Code:

define('THIS_SCRIPT''XXX'); 

Should be near the top of the file.

Then
Code:

<vb:if condition="THIS_SCRIPT != 'XXX'">Ad</vb:if>
should work.

sadiq6210 02-16-2012 04:01 PM

Quote:

Originally Posted by Iain M (Post 2300214)
Check what THIS_SCRIPT is defined as on each of the pages you don't want your ads to show on.

PHP Code:

define('THIS_SCRIPT''XXX'); 

Should be near the top of the file.

Then
Code:

<vb:if condition="THIS_SCRIPT != 'XXX'">Ad</vb:if>
should work.


This is very helpful post
Now it is working
Thank you very much Iain, you are the best ^_^

This is the result:

Code:

<vb:if condition="THIS_SCRIPT!='member'">
<vb:if condition="THIS_SCRIPT!='downloads2'">
<vb:if condition="THIS_SCRIPT!='gallery_index'">
<vb:if condition="THIS_SCRIPT!='mc_classifieds'">

ADS
</vb:if></vb:if></vb:if></vb:if>

Last question, How can I make it in one <if condition> using '&&' or '||' ?

Thanks dear

Iain M 02-17-2012 10:07 AM

No worries =]

Yeah, you should be able to combine them into one by doing
Code:

<vb:if condition="THIS_SCRIPT != 'member' OR THIS_SCRIPT != 'downloads2' OR THIS_SCRIPT != 'gallery_index' OR THIS_SCRIPT != 'mc_classifieds'">
ADS
</vb:if>


sadiq6210 02-20-2012 06:22 AM

Quote:

Originally Posted by Iain M (Post 2300458)
No worries =]

Yeah, you should be able to combine them into one by doing
Code:

<vb:if condition="THIS_SCRIPT != 'member' OR THIS_SCRIPT != 'downloads2' OR THIS_SCRIPT != 'gallery_index' OR THIS_SCRIPT != 'mc_classifieds'">
ADS
</vb:if>


Unfortunately, this is not working Iain


All times are GMT. The time now is 05:29 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.00984 seconds
  • Memory Usage 1,735KB
  • 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
  • (7)bbcode_code_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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