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
Nag Users Using Ad Block - Popup Alert For Adblock Users Details »»
Nag Users Using Ad Block - Popup Alert For Adblock Users
Version: 1.00, by BirdOPrey5 (Senior Member) BirdOPrey5 is offline
Developer Last Online: Aug 2023 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.8.x Rating:
Released: 11-29-2010 Last Update: 11-29-2010 Installs: 15
Template Edits
Re-useable Code Additional Files Translations  
No support by the author.

First let me state that while I had used this for a while I have since turned it off. Personally I'd rather have the traffic then potentially lose someone who won't or can't figure out how to turn off Ad Block. That said, if you're interested, keep reading...

I've tested this on 3.8 but I'm very confident it will indeed work on 4.x as well, this is just javascript and doesn't tend to be affected by VB versions.

I've also tested this on Firefox with Ad Block Plus and Chrome with it's Ad Block and both showed the alert. I've been told it also works with Safari ad-block but can't confirm since I can get ad-block for Safari to install...

Download the .txt file for a backup of these instructions.

This is a couple of fairly simple template edits. One thing you need to do before hand though is download the "jquery" library. jquery is set of advanced javascript functions freely available and distributed. It is use in many websites all over for advanced functionality.

Download the latest copy HERE.
Scroll down to "Current Release" (1.4.4 as of this writing)
I suggest you download the "minified" version (smaller file size)
Download it and then upload it to your forums /clientscript directory.

Now go to your Admin CP -> Style Manager
Go to "All Style Options"

In the headinclude template scroll to the very bottom and add the following lines:

Code:
<script src="/forums/clientscript/jquery-1.4.4.min.js" language="javascript" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
function WebCheck() 
 {
   if ($('.forumAd').height() == 0)
     alert("OMG YOU HAVE ADBLOCK INSTALLED. TURN IT OFF, TURN IT OFF NOW!!!");
 }
$(WebCheck);
</script>
You must CUSTOMIZE the text in red.

First set the path to the jquery file you uploaded, usually /forums/clientscript/ or simply /clientscript/ followed by the file name of the library you downloaded. The exact version may differ.

Second customize your ALERT message. This text will appear in a standard javascript alert box with an [OK] button for the user to press to dismiss the box. THIS IS ANNOYING. Plus it will pop up again every time someone goes to a new page, so this is VERY ANNOYING.

One more step... now you need to find an ad that is displayed on every page of your forum for every member... Personally for me it was the footer ad.

You need to enclose this ad in a new <div> element.

For me this was in my footer template.

Code:
<div class="forumAd" style=" text-align:center;margin:1px">
$ad_location[ad_footer_start]
</div>
It's very important you find an ad on every page for all members... if an ad doesn't appear due to the page it's on or due to the member/usergroup viewing it then the special <div> will have zero dimension and the alert will show for them.

If you have pages or members ads are disabled for you should use the same <IF> conditionals around the headinclude code above to make sure this script doesn't run in those instances. The script at top is what matters here, the <div> can remain whether the top code is present or not, it won't hurt anything.

Please Mark as Installed if you use this.


There are some interesting things you can do by surrounding the <script> code in template conditions. For instance you can have the message show only when actually viewing a thread instead of on every single page by enclosing it in the following condition:

Code:
<if condition="THIS_SCRIPT == 'showthread'">
-Original code here-
</if>
VB3 Users can find more Template Conditionals HERE.
And VB4 User can look HERE.

Download Now

File Type: txt adblocknag_install.txt (3.2 KB, 91 views)

Screenshots

File Type: png ss_adblock.png (100.1 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 12-24-2010, 05:52 PM
michael24179 michael24179 is offline
 
Join Date: Nov 2007
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have now inserted in ad_footer_start. I get the popup still does not matter whether adblocker off or on. The Microsoft Internet explorer I get the POPUP not!, only with Firefox
Reply With Quote
  #13  
Old 12-24-2010, 06:05 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Again, please post the full contents of your ad_footer_start template- I can't help if I can't see the code.

What advertising service do you use?
Reply With Quote
  #14  
Old 12-24-2010, 06:21 PM
michael24179 michael24179 is offline
 
Join Date: Nov 2007
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<div class="forumAd" style=" text-align:center;margin:1px">
$ad_location[ad_footer_start]
</div>

<script
  language="JavaScript1.1"
  type="text/javascript"
  src="http://www.contaxe.com/go/go.js?atp=bnr&amp;c=20274&amp;pi=2077">
</script>
Reply With Quote
  #15  
Old 12-24-2010, 06:26 PM
michael24179 michael24179 is offline
 
Join Date: Nov 2007
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HI I found the error
Reply With Quote
  #16  
Old 12-24-2010, 10:50 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad you got it working. :up:
Reply With Quote
  #17  
Old 12-31-2012, 04:49 PM
Nirjonadda Nirjonadda is offline
 
Join Date: Dec 2011
Location: Italy
Posts: 739
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please can you update this mod? without manual template edit for work on 4.1.10
Reply With Quote
  #18  
Old 01-01-2013, 07:39 PM
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Posts: 1,314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

IMO I think this belongs in the articles forum as it is just JS as stated & can be applied to vb3 4 or 5.
Reply With Quote
  #19  
Old 08-29-2013, 12:39 AM
dougdirac's Avatar
dougdirac dougdirac is offline
 
Join Date: Nov 2011
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any way to log the users using adblock. That way maybe I can just personally remind them they can become supporting members if they don't want to see ads.

Or perhaps put the remainder under where the ad would normally show?
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 02:47 PM.


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.04538 seconds
  • Memory Usage 2,306KB
  • Queries Executed 24 (?)
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
  • (4)bbcode_code
  • (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
  • (1)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (2)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete