Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-14-2011, 05:54 PM
TommyC TommyC is offline
 
Join Date: Apr 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Prevent AdSense on Specified Threads

Running vBulletin 3.8, and utilizing AIN - Advanced Google Adsense ( https://vborg.vbsupport.ru/showthread.php?t=205713 ).

I'm seeking a way to prevent specified threads from having adsense ads displayed on them.

Does anyone know how this can be accomplished?

Thank you in advance.
Reply With Quote
  #2  
Old 09-28-2011, 12:09 AM
TommyC TommyC is offline
 
Join Date: Apr 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump.
Reply With Quote
  #3  
Old 09-28-2011, 12:30 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you had the code in an ad location template you could do this easily with a template conditional, something like:

Code:
<if condition="$thread[threadid] != XXXX"> 
Ad code here
</if>
But I don't know how that specific mod works. You should ask for help with mods in the mod thread itself. People who have it installed (or the developer) would be in the best situation to help you.
Reply With Quote
  #4  
Old 10-08-2011, 08:31 PM
TommyC TommyC is offline
 
Join Date: Apr 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much for the reply.

I decided to abandon the mod and just rely on template edits, using your idea of conditionals, which at first was working great. I setup my first ad block flawlessly (after much trial and error).

Then I move down to the footer, and suddenly it is as if vBulletin is unable to read IDs. That is, if I set a conditional to show the ad only if certain conditions are met, it NEVER displays the ad. If I set the conditional to show the ads with exceptions, it displays the ads EVERYWHERE regardless of the exceptions.

For example...

Using this to show my ads on forum 2:
Quote:
<if condition="in_array($forum, array(2))">
AD CODE
</if>
Result = no ads displayed on any forum, not even forum 2.

Using this to prevent my ads from showing on forum 2, 3, 4, 5:
Quote:
<if condition="!in_array($forum, array(2,3,4,5))">
AD CODE
</if>
Result = Ads displayed on EVERY forum, even forum 2,3,4,5


This carries over into other conditionals such as usergroup and threadid.

So to reiterate, one set of conditionals = working flawlessly. Other set appears to ignore IDs.

Why would this be happening? And how would I resolve it?

Thanks in advance.
Reply With Quote
  #5  
Old 10-08-2011, 08:45 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try $GLOBALS['forumid'] instead.
Reply With Quote
  #6  
Old 10-08-2011, 09:06 PM
TommyC TommyC is offline
 
Join Date: Apr 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Try $GLOBALS['forumid'] instead.
You are a scholar and a saint, that worked perfect! Thank you very much!

I'm a bit curious though, why is it that my first set of conditionals worked, yet the second set required this different variable? Is it an issue with my template?

I'm not complaining by any means as I'm very happy to have a solution, I'm just very curious.
Reply With Quote
  #7  
Old 10-08-2011, 09:20 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Different templates have access to different variables... Templates like header and footer are on every page, they need the "$GLOBALS" templates that are just on showthread might work with $thread or $threadinfo, templates that are just on forumdisplay make work with $forum or $forumdisplay.
Reply With Quote
  #8  
Old 11-21-2011, 06:29 AM
TommyC TommyC is offline
 
Join Date: Apr 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it possible to use "AND" with a conditional?

For example:
IF usergroup 3 AND forum id 2 then....
or
IF usergroup 3 AND NOT forum id 4 then ....

I've tried a few variations with no luck.
Reply With Quote
  #9  
Old 11-21-2011, 12:12 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

AND, yes... NOT is !

Code:
<if condition="is_member_of($bbuserinfo, 3) AND $GLOBALS[forumid] == 2">

<if condition="is_member_of($bbuserinfo, 3) AND $GLOBALS[forumid] != 4">
Reply With Quote
Благодарность от:
TommyC
  #10  
Old 11-21-2011, 04:29 PM
TommyC TommyC is offline
 
Join Date: Apr 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much!
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 02:33 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.06365 seconds
  • Memory Usage 2,255KB
  • 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
  • (2)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • 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