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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-10-2010, 05:27 PM
GTX2 GTX2 is offline
 
Join Date: May 2006
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default conditionals help (exclude certain forums)

Hi All !


I've been advised by google to remove adsense ads from my adult forum sections (i just just a couple, forum is technology related).

Could you please help me out correcting this codes?


This code stand alone works fine to exclude certain forums
Code:
<if condition="!in_array($forumid, array(472,417,474,475,473,476))">
adsense here
</if>

How about this conditionals, how to add the above code to exclude the same forums?
Code:
<if condition="THIS_SCRIPT == 'showthread' AND !$GLOBALS['FIRSTPOSTID'] AND $bbuserinfo['usergroupid'] == '1, 3' AND (!$show[member])">

And for last, how to add the exclude conditionals here also:
Code:
<if condition="THIS_SCRIPT == 'showthread' AND !$GLOBALS['FIRSTPOSTID'] AND ($show[member])">


Thank you
Reply With Quote
  #2  
Old 01-10-2010, 06:09 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not sure what you are asking. You should be able to add the condition from your first code block into the conditions in the other two code boxes. Is it not working?
Reply With Quote
  #3  
Old 01-10-2010, 10:53 PM
GTX2 GTX2 is offline
 
Join Date: May 2006
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

First sorry if i'm not explaining OK, english is my second language.

No, they are not working. They are not excluding ads from those forumsID.
But maybe i'm doing something wrong and not putting the conditional code in the right way.

I've tried in different ways:


Code:
<if condition="!in_array($forumid, array(472,417,474,475,473,476))">
<if condition="THIS_SCRIPT == 'showthread' AND !$GLOBALS['FIRSTPOSTID'] AND $bbuserinfo['usergroupid'] == '1, 3' AND (!$show[member])">
adsense code here
</if>
</if>
and

Code:
<if condition="THIS_SCRIPT == 'showthread' AND !$GLOBALS['FIRSTPOSTID'] AND $bbuserinfo['usergroupid'] == '1, 3' AND (!$show[member]) AND !$foruminfo['forumid'] == '472, 417, 474, 475, 473, 476'">
adsense code here
</if>

I'm trying also to make this work with vb ad management mod here: https://vborg.vbsupport.ru/showthrea...39#post1952139

Code:
<if condition="$forum['forumid'] != '472 , 417 , 474 , 475 , 473, 476'">
<div align="left">$template_hook[navbar_below]</div>
</if>

nothing from this is excluding ads from those forumID ...
Reply With Quote
  #4  
Old 01-11-2010, 03:27 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not sure why the first code box doesn't work as it looks like it should. But, you can try this which combines the two:
HTML Code:
<if condition="!in_array($forumid, array(472,417,474,475,473,476)) AND (THIS_SCRIPT == 'showthread' AND !$GLOBALS['FIRSTPOSTID'] AND $bbuserinfo['usergroupid'] == '1, 3' AND (!$show[member]))">
adsense code here
</if>
You may want to try $threadinfo['forumid'] instead of $forumid if it still isn't working.
Reply With Quote
  #5  
Old 03-30-2010, 06:09 PM
MuhammadC MuhammadC is offline
 
Join Date: May 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would do it with custom forum styles... and just remove the adsense tag from those styles.
Reply With Quote
  #6  
Old 12-15-2011, 04:55 AM
struff struff is offline
 
Join Date: Aug 2008
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MuhammadC View Post
I would do it with custom forum styles... and just remove the adsense tag from those styles.
Just stumbled upon this. Has this worked for people? Think this would work in vB4 too?

I don't have much experience in custom styles. In theory I should just be able to pick the style I want to use, search the templates for "adsense", and remove those instances, right?

Thanks.
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 03:50 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.04409 seconds
  • Memory Usage 2,216KB
  • Queries Executed 13 (?)
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
  • (6)bbcode_code
  • (1)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete