Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Anti Adblock Message in Threads Details »»
Anti Adblock Message in Threads
Version: v2.0024, by vijayninel vijayninel is offline
Developer Last Online: Sep 2015 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.8.7 Rating:
Released: 11-26-2011 Last Update: Never Installs: 8
Template Edits
 
No support by the author.

Ad blocking plugins like Adblock Plus are one of the most popular addon fors browsers today. However these addons deny publishers revenue to operate their sites.

One way to force users to disable Adblock is to deny them site content until they disable adblock. The following template modification is the vBulletin implementation for the antiblock script from http://antiblock.org/ . This script will prevent users from viewing thread content and ask them to disable Adblock.

Implementing this hack is very easy. In your style manager select the style that you are using and open

Show Thread Templates > SHOWTHREAD

In showthread go to the bottom of the page and just before

HTML Code:
</body>
</html>
Paste the following code.

HTML Code:
<style>#u539880{position:fixed!important;position:absolute;top:0;top:expression((t=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+"px");left:0;width:100%;height:100%;background-color:#fff;-moz-opacity:0.9;-khtml-opacity:0.9;filter:alpha(opacity=90);opacity:0.9}#u539880 p{-moz-opacity:1;-khtml-opacity:1;filter:none;opacity:1;font:bold 16px Verdana,Arial,sans-serif;text-align:center;margin:20% 0}#u539880 p a,#u539880 p i{font-size:12px}</style><noscript><style>html,body{margin:0;padding:0;height:100%}</style><div id=u539880><p>Please enable JavaScript!<br>Bitte aktiviere JavaScript!<br>S'il vous pla&icirc;t activer JavaScript!<br>Por favor,activa el JavaScript!<br><a href="http://antiblock.org/">antiblock.org</a></p></div></noscript><script>(function(){function a(a){if(c){return}c=1;d.body.innerHTML+='<style>html,body{margin:0;padding:0;height:100%}</style><div id=u539880><p>Please disable your ad blocker!<br>Bitte deaktiviere Deinen Werbeblocker!<br>Veuillez d&eacute;sactiver votre bloqueur de publicit&eacute;!<br>Por favor, desactive el bloqueador de anuncios!<br><a href="http://antiblock.org/?d=2.0024'+')$('+escape(a)+')$('+t+'">antiblock.org</a> <i>v2.0024</i></p></div>'}function $(a){return d.getElementById(a)}function r(a){return Math.floor(Math.random()* a)}var w=window,d=document,u='undefined',s='',c,t=2000,U=['adireland.com','baronsoffers.com','boo-box.com','as.devbridge.com','break.com/ads/preroll/','images.mylot.com','themes420.com/bnrsbtns/','loveme.com','johnbridge.com/vbulletin/images/tyw/cdlogo-john-bridge.jpg','madskristensen.net/discount2.js'],l=U.length,I=['AdServer','HeaderAdsBlock','VM-footer-adspace','ads728bottom','adtxt','header-advertisement','spotlightad','textAd','video_overlay_ad','whoisRightAdContainer'],L=I.length,P=document.getElementsByTagName('img'),p=['ad&program=revshare&','.net/ads/','/adpeeps/ad','/adrotate/ad','/bigad.','/dcloadads/ad','/linkedads/ad','/premium_ad.','/top-ad-','/top728.html'],b,j='',S=d.getElementsByTagName('script'),i;for(i=0;i<L;i++){if(!$(I[i])){s+='<a id="'+I[i]+'"></a>'}}d.body.innerHTML+=s;setTimeout(function(){for(i=0;i<L;i++){s=$(I[i]);if(s.offsetParent==null||(w.getComputedStyle?d.defaultView.getComputedStyle(s,null).getPropertyValue('display'):s.currentStyle.display)=='none'){a('#'+I[i])}}b=r(P.length-1);if(typeof P[b].src!=u){s=new Image();s.onload=function(){s=new Image();s.onerror=function(){a(b)};b=P[b].src+(P[b].src.indexOf('?')==-1?'?':'&')+p[r(p.length-1)];s.src=b};s.src=P[b].src}for(i=S.length-1;i>=0;--i){if(S[i].src){j=S[i].src.substr(7,20);s={'js.adscale.de/getads':'adscale','view.binlayer.com/ad':'blLayer','www.sponsorads.de/sc':'preferrer','get.mirando.de/miran':'Mirando','bdv.bidvertiser.com/':'report_error','ads.adtiger.de/adscr':'adspirit_pid','www.contaxe.com/go/g':'HLSysBannerUrl','ads.w3hoster.de/adsi':'w3Fixv','exchangecash.de/laye':'excash_scriptloaded'};if(typeof s[j]!=u&&typeof w[s[j]]==u){a(j+':'+s[j])}}}try{s=new XMLHttpRequest()}catch(e){s=0}if(s){try{for(i=0;i<l;i++){s.open('GET','http://'+U[i],true)}}catch(e){if(typeof e=='object'&&e.message.substr(0,9)=='Component'){a(U[i]+e.message)}}}},t)})();</script>
That's it.

The code is for v2.0024 and may be updated as adblock develops countermeasures for it.

To further customise the script please see this link. http://antiblock.org/?p=script

Demo: http://antiblock.org/?p=script&demo

Please click install if you want info on updates.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
CarpCharacin

Comments
  #22  
Old 06-11-2013, 06:28 AM
denman75 denman75 is offline
 
Join Date: Aug 2006
Location: Netherlands
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i wanted to use this to ,but is this save ,since some say it contains hidden ads from publisher?
no harm to the dev ,but i am not a coder ,is this save?
Reply With Quote
  #23  
Old 10-09-2013, 12:09 AM
JalsaTime JalsaTime is offline
 
Join Date: Jun 2013
Location: Hong Kong
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When i do this, reply box is been blocked, and also many problems with this.
Some one kindly help me to do it...

Code:
<style>#u539880{position:fixed!important;position:absolute;top:0;top:expression((t=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+"px");left:0;width:100%;height:100%;background-color:#fff;-moz-opacity:0.9;-khtml-opacity:0.9;filter:alpha(opacity=90);opacity:0.9}#u539880 p{-moz-opacity:1;-khtml-opacity:1;filter:none;opacity:1;font:bold 16px Verdana,Arial,sans-serif;text-align:center;margin:20% 0}#u539880 p a,#u539880 p i{font-size:12px}</style><noscript><style>html,body{margin:0;padding:0;height:100%}</style><div id=u539880><p>Please enable JavaScript!<br>Bitte aktiviere JavaScript!<br>S'il vous pla&icirc;t activer JavaScript!<br>Por favor,activa el JavaScript!<br><a href="http://jalsatime.com/">JalsaTime/a></p></div></noscript><script>(function(){function a(a){if(c){return}c=1;d.body.innerHTML+='<style>html,body{margin:0;padding:0;height:100%}</style><div id=u539880><p>Please Disable Your AdBlocker Plugin To View This Site ! <br> Advertisements Are Very Safe And Trusted In Our Site! <br> Kindly Disable In Add-ons And Refresh The Page ! <br><a href="http://jalsatime.com/?d=2.0024'+')$('+escape(a)+')$('+t+'">JalsaTime.Com</a> <i>Official Message</i></p></div>'}function $(a){return d.getElementById(a)}function r(a){return Math.floor(Math.random()* a)}var w=window,d=document,u='undefined',s='',c,t=2000,U=['adireland.com','baronsoffers.com','boo-box.com','as.devbridge.com','break.com/ads/preroll/','images.mylot.com','themes420.com/bnrsbtns/','loveme.com','johnbridge.com/vbulletin/images/tyw/cdlogo-john-bridge.jpg','madskristensen.net/discount2.js'],l=U.length,I=['AdServer','HeaderAdsBlock','VM-footer-adspace','ads728bottom','adtxt','header-advertisement','spotlightad','textAd','video_overlay_ad','whoisRightAdContainer'],L=I.length,P=document.getElementsByTagName('img'),p=['ad&program=revshare&','.net/ads/','/adpeeps/ad','/adrotate/ad','/bigad.','/dcloadads/ad','/linkedads/ad','/premium_ad.','/top-ad-','/top728.html'],b,j='',S=d.getElementsByTagName('script'),i;for(i=0;i<L;i++){if(!$(I[i])){s+='<a id="'+I[i]+'"></a>'}}d.body.innerHTML+=s;setTimeout(function(){for(i=0;i<L;i++){s=$(I[i]);if(s.offsetParent==null||(w.getComputedStyle?d.defaultView.getComputedStyle(s,null).getPropertyValue('display'):s.currentStyle.display)=='none'){a('#'+I[i])}}b=r(P.length-1);if(typeof P[b].src!=u){s=new Image();s.onload=function(){s=new Image();s.onerror=function(){a(b)};b=P[b].src+(P[b].src.indexOf('?')==-1?'?':'&')+p[r(p.length-1)];s.src=b};s.src=P[b].src}for(i=S.length-1;i>=0;--i){if(S[i].src){j=S[i].src.substr(7,20);s={'js.adscale.de/getads':'adscale','view.binlayer.com/ad':'blLayer','www.sponsorads.de/sc':'preferrer','get.mirando.de/miran':'Mirando','bdv.bidvertiser.com/':'report_error','ads.adtiger.de/adscr':'adspirit_pid','www.contaxe.com/go/g':'HLSysBannerUrl','ads.w3hoster.de/adsi':'w3Fixv','exchangecash.de/laye':'excash_scriptloaded'};if(typeof s[j]!=u&&typeof w[s[j]]==u){a(j+':'+s[j])}}}try{s=new XMLHttpRequest()}catch(e){s=0}if(s){try{for(i=0;i<l;i++){s.open('GET','http://'+U[i],true)}}catch(e){if(typeof e=='object'&&e.message.substr(0,9)=='Component'){a(U[i]+e.message)}}}},t)})();</script>
This is what i want exactly. But when i place it in Showthread, some functions are not working...
Reply With Quote
  #24  
Old 10-24-2013, 05:10 PM
blue7's Avatar
blue7 blue7 is offline
 
Join Date: Aug 2007
Location: Turkey/Ankara
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How ironic... Just right click on pop up warning page and say block with adblock then your anti block message disappear and not appear again )
Reply With Quote
  #25  
Old 11-18-2013, 08:24 AM
mattballew mattballew is offline
 
Join Date: Jan 2011
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good work! I noticed the numbers slowly decreasing, and i knew it was time to do something. Your addon did exactly what i wanted it to do
Reply With Quote
  #26  
Old 11-19-2013, 12:18 PM
mattballew mattballew is offline
 
Join Date: Jan 2011
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After installing this, i noticed that it prevented my QuickReply to work, Saying: The message you have entered is too short. Please lengthen your message to at least 2 characters.

I ended up removing the code. Does anyone know a good workaround for this?
Reply With Quote
  #27  
Old 02-24-2014, 01:29 PM
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Posts: 1,314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This I believe is due to adblock being able to find the #div identifier. So if that were removed, then it should be harder to block.
And yes this works with vbulletin 4. Just throw it in the headinclude template.



Quote:
Originally Posted by blue7 View Post
How ironic... Just right click on pop up warning page and say block with adblock then your anti block message disappear and not appear again )
Reply With Quote
  #28  
Old 09-30-2014, 02:44 PM
autoescala autoescala is offline
 
Join Date: Oct 2011
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

doesnt work with vbseo or dbtec seo, dont know why

If I disable vbseo works fine
Reply With Quote
  #29  
Old 10-20-2014, 10:28 PM
leemart44 leemart44 is offline
 
Join Date: Oct 2013
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

code updated
Reply With Quote
  #30  
Old 10-29-2014, 12:03 PM
RELAX13 RELAX13 is offline
 
Join Date: Nov 2013
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good Id
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 08:54 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.06045 seconds
  • Memory Usage 2,323KB
  • Queries Executed 25 (?)
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)bbcode_code
  • (2)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete