View Full Version : Blocking of Adsense on certain IPs
feverhost
05-03-2007, 03:31 AM
Is there a way to block adsense ads under my navbar by IP Address?
I have some members that I don't want to see the adsense IPs, but only want certain ones to not be able to see this?
Is this possible.. if so... how?
tobybird
05-03-2007, 07:12 PM
Possibly. You could place the members in a usergroup and then by the use of conditionals restrict access to the ads. Also, I'm fairly certain there is a mod or three out here that has the same ability.
feverhost
05-03-2007, 09:20 PM
That is a good idea, but curious if there is a way I can do this just by IP Address?
feverhost
05-07-2007, 01:45 AM
Does anyone have an idea how I can block ads to certain IP Addresses?
HMBeaty
05-07-2007, 02:48 AM
I really don't think this is possible as a similar question was asked a few months ago and nobody discovered how to do it
feverhost
05-07-2007, 09:33 PM
I was able to accomplish this using IFRAME and .htaccess. So if your interested this is what I did:
First I created a directory under my mainsite called /google
Secondly I created .htaccess and put this code into it:
<Limit GET HEAD POST>
order allow,deny
deny from IP.ADDRESS.HERE
allow from all
</LIMIT>
Thirdly I created google.php within /google
I then went into my navbar and pasted this info:
<CENTER>
<iframe src="/google/index.php" width="750" height="110" scrolling="no" name="content" frameborder="0"></iframe>
</CENTER>
It will show a blank area if you are on the IP Address that is blocked, and it shows the Google ads perfectly for any other IP Address. To get around the 403 Forbidden Denied error.. I had to change the apache config file to point to a blank page which I created /google/403.html then restarted apache.
I know its not a PHP fix, but it does seem to work. We have a programmer who is looking into making some code to coincide with VB that is PHP based. Once I have that, and its working, i'll paste that or create a Mod in the Mods Section. As everyone I asked said it can't be done, just as VB staff said it can't be done. I'm sure it can be done.. its just maybe know one has done it yet.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.