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

Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2007, 03:03 PM
BigJimTheLug BigJimTheLug is offline
 
Join Date: Nov 2006
Posts: 354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default What is the conditional code to do this

I want to prevent my google adsense ads from being displayed to a specific domain.

The domain is

http://5centminimum.com/members/timerPTC.php


Can someone help me with the correct conditional statement to prevent adsense ads from being displayed to the above listed url?

Thank you.
Reply With Quote
  #2  
Old 04-04-2007, 03:27 PM
Snort_2005 Snort_2005 is offline
 
Join Date: May 2005
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

5CENTMINIMUM Please log into your account and try again.

That's all I see.. o_O;
Reply With Quote
  #3  
Old 04-04-2007, 04:07 PM
BigJimTheLug BigJimTheLug is offline
 
Join Date: Nov 2006
Posts: 354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh wait. sorry.. I did not explain myself properly.

Ok, some person submitted my board to that site without my permission.

But I don't want my Google adsense ads to be displayed on that url when my site is viewed.

I think that site is a banner exchange, I'm not sure.

But what I want to do is prevent my Google Adsense ads from being displayed on that domain.

Isn't there a code for this involving .htaccess and a rewrite of some kind?

I want those who use that domain to look at my site, but I do not want them to look at my Google Adsense ads. But I only want that domain to not "see" my Google ads.
Reply With Quote
  #4  
Old 04-04-2007, 05:12 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So basically preventing hotlinking?
Reply With Quote
  #5  
Old 04-04-2007, 05:27 PM
BigJimTheLug BigJimTheLug is offline
 
Join Date: Nov 2006
Posts: 354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, if it can prevent my Google Adsense ads from showing up on that domain when my board is viewed on that domain, then I guess it does prevent hot linking.

Although I'm not quite sure what hotlinking is...

Ok everyone, this is what I have so far, please correct me if I am wrong.

PHP Code:
$domain 'domainyouwantblocked.com';

If(
str_replace('www.'''$_SERVER['server_name']) == $domain) { die(); } 
Ok this is what I have:

PHP Code:
If(str_replace('www.'''$_SERVER['server_name']) == $domain)
{
    die();

And I also have this:

PHP Code:
function display_adsense()
{
    If(
str_replace('www.'''$_SERVER['server_name']) == $domain)
    {
        return 
FALSE;
    }
    else
    {
        return 
TRUE;
    }

And also this


PHP Code:
if(display_adsense())
    echo 
"adsense code";

Will these codes prevent Adsense from showing up in a domain I don't want them to, even if my site shows up on that domain?


Well, I have an idea as to how to block this type of cheap traffic, and it involves modifying the .htaccess file.

sweet!
Reply With Quote
  #6  
Old 04-06-2007, 02:37 AM
BigJimTheLug BigJimTheLug is offline
 
Join Date: Nov 2006
Posts: 354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, this is similar to preventing "hotlinking." I found out what that was...lol. Thanks for pointing me in the right direction Redlinemotorsports.
Here is what I was after


This code is for multiple referrer that you want to block

Code:
RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} badsite\.com [NC,OR]
RewriteCond %{HTTP_REFERER} anotherbadsite\.com
RewriteRule .* - [F]

This code here is for one referrer to block

Code:
RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} badsite\.com [NC]
RewriteRule .* - [F]

RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} badsite\.com [NC]
RewriteRule .* - [F]


This code is useful to block sites that you do not want traffic from, and in my case, this is very helpful as I do not need traffic from a few sites.

I just tested this using vbulletin.org and it works great!
Reply With Quote
  #7  
Old 04-06-2007, 02:55 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So you got it working now?
Reply With Quote
  #8  
Old 04-06-2007, 03:55 AM
BigJimTheLug BigJimTheLug is offline
 
Join Date: Nov 2006
Posts: 354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, I did.

I tried a plug in, but that wasn't working.

This does the trick!
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 09:52 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.04132 seconds
  • Memory Usage 2,235KB
  • 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
  • (2)bbcode_code
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (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
  • 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