Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 10-06-2005, 04:46 AM
6impy 6impy is offline
 
Join Date: Oct 2001
Location: Seattle
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Show Google Adsense only on pages that guests can view

I've been trying to figure out how to do this on my own, but I thought I'd post it here to see if anyone has any ideas.

I've seen posts/hacks that explain how to not have Adsense appear when a guest can't view the thread, but I have Adsense appear on every page.

Is there any "easy" way to check if a guest has permission to view a page?
Reply With Quote
  #2  
Old 10-07-2005, 10:37 PM
6impy 6impy is offline
 
Join Date: Oct 2001
Location: Seattle
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No one has any ideas?
Reply With Quote
  #3  
Old 10-07-2005, 10:45 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does it matter if it is included on pages that guests cannot view?
(Except that Goolge most likely will display PSAs)
Reply With Quote
  #4  
Old 10-08-2005, 02:18 AM
SVZ SVZ is offline
 
Join Date: Oct 2005
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes it's against their Terms of Service
Reply With Quote
  #5  
Old 10-08-2005, 04:17 AM
6impy 6impy is offline
 
Join Date: Oct 2001
Location: Seattle
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yah, and I'm thinking it may have adverse effects on the Adsense bot when it keeps getting the same content for a bunch of different URLs.
Reply With Quote
  #6  
Old 10-09-2005, 05:12 AM
jdingman jdingman is offline
 
Join Date: Jul 2005
Location: Canada
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Was there an answer to this? I was hoping to create a subscription based system where if they were subscribed, no ads would be displayed so they can purchase subscription to have an ad-free forum. Anything of the sort come about yet?
Reply With Quote
  #7  
Old 10-09-2005, 08:56 AM
CommuneZoom CommuneZoom is offline
 
Join Date: Sep 2005
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jdingman
Was there an answer to this? I was hoping to create a subscription based system where if they were subscribed, no ads would be displayed so they can purchase subscription to have an ad-free forum. Anything of the sort come about yet?
You can use a conditional for subscription members such as:

PHP Code:
<if condition="is_member_of($bbuserinfo, 9)">
&
nbsp;
<else />
Ad Code Here
</if> 
Basically, you can stick that bit of coding anywhere you like and if the member is subscribed, it will show nothing, for non-subscribed members (i.e. guests, members, admins, ect) it will show the ads.

You can further it by using:

PHP Code:
<if condition="is_member_of($bbuserinfo, 5) OR is_member_of($bbuserinfo, 6) OR is_member_of($bbuserinfo, 7) OR is_member_of($bbuserinfo, 9)">
&
nbsp;
<else />
Ad Code Here
</if> 
This should keep the ads away from Mods, Super Mods, Admins and the Subscribed group.
Reply With Quote
  #8  
Old 11-27-2005, 12:15 AM
Bellinis's Avatar
Bellinis Bellinis is offline
 
Join Date: Aug 2005
Location: Amsterdam, the Netherland
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have an additional question:

I've put my adsense code at the end of the navbar template and looks like this:

PHP Code:
<if condition="in_array($bbuserinfo[usergroupid], array(1))">
<
div align="center">
===== 
adsense code here =====
</
div>
<
br />
</if> 
This way adsense is shown on every page for only guests.
Now I also have custom pages where I DO NOT want to show the adsense ads.
How can I change the IF condition to work like "if the current page is blabla.php, then do not show the adsense code" ?

Any help much appreciated!
Reply With Quote
  #9  
Old 11-27-2005, 02:03 AM
derekivey derekivey is offline
 
Join Date: Apr 2005
Location: Pennsylvania, USA
Posts: 1,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could prolly change the conditional to something like this:

PHP Code:
<if condition="in_array($bbuserinfo[usergroupid], array(1)) && THIS_SCRIPT != 'page_name'"
page_name would be what ever is defined for THIS_SCRIPT in the php file of the pages you don't want the ad to be shown on.

For more than one page you can keep adding && THIS_SCRIPT != 'page_name' to that conditional. Thats how I would do it, but maybe someone else has a better way.

Derek
Reply With Quote
  #10  
Old 11-27-2005, 02:13 AM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wrote a mod for showthread in 3.0 that kept them off of private forums. I haven't ported it up, but I need to. That in combination with the THIS_SCRIPT conditionals should do what you want.

Amy
Reply With Quote
Reply

Thread Tools
Display Modes

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 05:10 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08503 seconds
  • Memory Usage 2,253KB
  • 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
  • (4)bbcode_php
  • (1)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
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (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
  • 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