How it works…
When a normal user visits your site. Their browser will use the CSS within the “advertisement.js” file, which will override the previously posted CSS. When this happens, the “Notice” is not displayed, the page is shown to the viewer.
However, if the user has enabled ad-block, they will not download the advertisement.js file, thinking it is a advertisement. Then CSS will not be overrideen, and the page will be blocked from view, and a notice displayed.
Example: http://d3xt3r.net/development/adblock_banner_test.php
Instructions…
Copy SCRIPT-B into a blank text file. Name the file “advertisement.js” and upload to the root of your webserver.
Input SCRIPT-A directly below on any and all pages you wish to use this system. Be sure to modify the location of the .JS file to the location on your server.
Modify SCRIPT-A to fit your needs, but DO NOT remove the link to D3xt3r.net, only if you purchase the system.
Notes…
Make sure that there are no unneeded tags within your pages. Otherwise the system will only block the page to that point.
This system has been tested on many browsers, working on 68 out of 69 tested. However, I am not responsible for the use of this system, you agree to that by using it.
If a person has javascript disabled, the system automatically shows the override codes, and the person is not shown the ad-block notice.
SCRIPT-A
<style type="text/css">
#blockblockA {
position:absolute;
top:0px;left:0px;
background-color:#000000;
width:100%;
height:100%;}
#blockblockA td {
text-align:center;
width:100%;
height:100%;}
#blockblockA td p {
font: bold 20px Verdana;
color:#ffffff;}
#blockblockB {
visibility:invisible;
display:none;}
</style><noscript>
<style type=”text/css”>
#blockblockA {
visibility:invisible!important;
display:none!important;}
#blockblockA td {
visibility:invisible!important;
display:none!important;}
#blockblockA td p {
visibility:invisible!important;
display:none!important;}
#blockblockB {
visibility:visible!important;
display:block!important;}
</style>
</noscript><script type=”text/javascript” src=”http://www.example.com/advertisement.js”></script>
<table id=”blockblockA”><tr><td>
<p align=”center”><i>Please</i> Disable Ad-Block To View This Website.</p>
<p align=”right”>Anti-AdBlock V2 By <a href=”http://d3xt3r.net”>D3xt3r.net</a></p></td></tr></table>
<span id=”blockblockB”>
SCRIPT-B
document.write('<style type="text/css"> #blockblockA { visibility:invisible!important; display:none!important;} #blockblockA td { visibility:invisible!important; display:none!important;} #blockblockA td p { visibility:invisible!important; display:none!important;} #blockblockB { visibility:visible!important; display:block!important;} </style>');