Nifty Script To Check For Google Ad Blocking

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bama
    Confirmed User
    • Nov 2001
    • 2727

    #1

    Nifty Script To Check For Google Ad Blocking

    PHP Code:
    <script type="text/javascript">
    
    function check()
      {
      var giframe = document.getElementsByTagName("iframe");
      var bod = document.getElementsByTagName("body");
      var blocked=1;  
    
      for (var i = 0; i < giframe.length; i++)
        {
        var name = giframe[i].getAttribute("name");
        if(name == "google_ads_frame" && giframe[i].style.display != 'none')
          {
          var blocked=0;
          }
        }
      if (blocked) {
        bod[0].innerHTML = '<br>&nbsp;<br><p align="center"><font color="red" size="+6" style="font-size:5em"><strong>WARNING!</strong></font><br /><br /><font color="#ffffff" face="Arial"><b>An ad blocking software has been detected. <br /><br />This site is supported only by contextual ads, <br /><br />so we ask you to whitelist this site or disable the ad blocking software completely. <br /><br /> Thank you.<br /><br />When you are done, you may click <a href="">Continue</a></font></b></p>';
        }
      }
    
    setTimeout('check()', 2000);
    </script>
    </head> 
    
  • seeandsee
    Check SIG!
    • Mar 2006
    • 50945

    #2
    Nice script to prevent "free loaders" on your site. This is anti adblocking script
    BUY MY SIG - 50$/Year

    Contact here

    Comment

    • munki
      Do Fun Shit.
      • Dec 2004
      • 13393

      #3
      You jedi coder you...

      I have the simplest tastes. I am always satisfied with the best.” -Oscar Wilde

      Comment

      Working...