Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-15-2012, 02:38 PM
sadiq6210 sadiq6210 is offline
 
Join Date: Sep 2005
Posts: 684
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 02-15-2012, 07:29 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you tried dropping the ".php" ?
Reply With Quote
  #3  
Old 02-15-2012, 09:50 PM
Kraxell's Avatar
Kraxell Kraxell is offline
 
Join Date: Jun 2010
Location: Germany
Posts: 481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The best way i think is, you put your adsense-code in the template of your choise.
Reply With Quote
  #4  
Old 02-16-2012, 10:57 AM
sadiq6210 sadiq6210 is offline
 
Join Date: Sep 2005
Posts: 684
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Simon Lloyd View Post
Have you tried dropping the ".php" ?
Yes, It is not working

Quote:
Originally Posted by Kraxell View Post
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
Reply With Quote
  #5  
Old 02-16-2012, 02:18 PM
Iain M's Avatar
Iain M Iain M is offline
 
Join Date: Jul 2005
Location: Glasgow, Scotland
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Благодарность от:
sadiq6210
  #6  
Old 02-16-2012, 04:01 PM
sadiq6210 sadiq6210 is offline
 
Join Date: Sep 2005
Posts: 684
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Iain M View Post
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
Reply With Quote
  #7  
Old 02-17-2012, 10:07 AM
Iain M's Avatar
Iain M Iain M is offline
 
Join Date: Jul 2005
Location: Glasgow, Scotland
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #8  
Old 02-20-2012, 06:22 AM
sadiq6210 sadiq6210 is offline
 
Join Date: Sep 2005
Posts: 684
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Iain M View Post
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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:39 PM.


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.05680 seconds
  • Memory Usage 2,244KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (7)bbcode_code
  • (2)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (1)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete