vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Show Google Adsense only on pages that guests can view (https://vborg.vbsupport.ru/showthread.php?t=97697)

6impy 10-06-2005 04:46 AM

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?

6impy 10-07-2005 10:37 PM

No one has any ideas?

Andreas 10-07-2005 10:45 PM

Does it matter if it is included on pages that guests cannot view?
(Except that Goolge most likely will display PSAs)

SVZ 10-08-2005 02:18 AM

Yes it's against their Terms of Service

6impy 10-08-2005 04:17 AM

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.

jdingman 10-09-2005 05:12 AM

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?

CommuneZoom 10-09-2005 08:56 AM

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.

Bellinis 11-27-2005 12:15 AM

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! :)

derekivey 11-27-2005 02:03 AM

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

amykhar 11-27-2005 02:13 AM

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


All times are GMT. The time now is 06:17 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.01023 seconds
  • Memory Usage 1,743KB
  • 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
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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