News:

Create A Forum Installed

Author Topic: [Code] Adblock Detector V2.1  (Read 869 times)

0 Members and 1 Guest are viewing this topic.

Offline aIURbliS

  • Hero Member
  • *****
  • Posts: 1215
  • Karma: 45
  • Gender: Male
  • Location: U.S.
    • View Profile

Badges: (View All)
Level 6 Sixth year Anniversary Fifth year Anniversary
[Code] Adblock Detector V2.1
« on: September 22, 2012, 11:17:40 pm »
Description: Detects if an adblocker is blocking ads on your forum and sends you a pm.
Version 2.1: Fixed a bug where guests were forced to send pms


This code utilizes jQuery, please use the latest version found in this thread: http://support.createaforum.com/5/jquery-v1-8-update/

Footers:
Code: [Select]
<script>var xboi209_AdblockDetectorV2="USERNAME";if($("div[align='center'] > img").length<1&&$("li.greeting").length>1){sessionStorage.setItem("adblock","true")}else{sessionStorage.setItem("adblock","false")}if(sessionStorage.getItem("adblock")=="true"&&sessionStorage.getItem("adblock_pm")!=="executed"){$("#content_section").load(smf_scripturl+"?action=pm;sa=send #postmodify",function(){sessionStorage.setItem("adblock_pm","executed");$("input[name='to']").prop("value",xboi209_AdblockDetectorV2).hide();$("input[name='bcc']").remove();$("input[name='subject']").prop("value","Adblock detected").hide();$("dt:eq(0)").remove();$("dt:eq(1)").remove();$("#bcc_div").remove();$("#bbcBox_message").remove();$("#smileyBox_message").remove();$("hr.clear").remove();$("label[for='outbox']").remove();$("#shortcuts").remove();$("textarea[name='message']").prop("value","This user was detected using an ad blocker.").hide();$("input.button_submit").trigger("click").hide()})}</script>

Editing instructions: Look at the beginning of the code for USERNAME and replace that with your username.
« Last Edit: November 04, 2012, 06:48:22 am by xboi209 »
All codes I make are tested on the latest version of Google Chrome and upon request of other browsers.

Share on Facebook Share on Twitter


 

Related Topics

  Subject / Started by Replies Last post
12 Replies
4478 Views
Last post December 02, 2014, 06:57:57 pm
by CyanProductions
1 Replies
1339 Views
Last post March 14, 2012, 04:53:55 pm
by aIURbliS
6 Replies
971 Views
Last post March 20, 2012, 04:04:43 pm
by aIURbliS
2 Replies
903 Views
Last post August 28, 2012, 05:13:08 pm
by CreateAForum
0 Replies
724 Views
Last post September 16, 2012, 09:02:42 pm
by aIURbliS