Advertisement:

Author Topic: Real Popup with AdBlock Detection  (Read 9970 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,504
    • XPtsp.com Community
Real Popup with AdBlock Detection
« on: September 25, 2016, 03:29:26 PM »
Link to Mod


REAL POPUP WITH ADBLOCK DETECTION v1.7
By Dougiefresh -> Link to Mod


Introduction
This hooks-only mod adds the ability to show a customizable popup message to the user, optionally when AdBlock is detected.

Admin Settings
Available settings under Admin -> Configuration -> Modification Settings -> Real Popups are:
o Enable Real Popup mod?
o Include popup contents in each page load?
o Special Effect mode for Popup Box (Swing, Slide Down, Star Wars, Newspaper, Wiggle)
o When to display the popup (Immediately, Scrolled Percentage, Wait for # Seconds)
o Period to wait before displaying
o How often to show the Popup box? (Always, Once per Session/x minutes/hours/days)
o Duration to wait before re-displaying
o Maximum Width of Popup (specified either as pixel or percentage)
o Text Color of Popup (expressed as 6-digit hexadecimal)
o Background Color of Popup (expressed as 6-digit hexadecimal)
o Display Popup only on AdBlock detection?
o Use black overlay on AdBlock detection?
o Can close Popup on AdBlock detection?
o Hide Popup from non-admin membergroups?
o Membergroups to hide Popup from:

Discussion Threads
o Need a REAL popup mod...

Javascript Source Files
o Blossom Opt-in feature box script v1.1 on DynamicDrive.com
o BlockAdBlock on GitHub

Compatibility Notes
This mod was tested on SMF 2.0.11, but should work on SMF 2.0 and up.  SMF 1.x is not and will not be supported.

Changelog
The changelog has been removed and can be seen at XPtsp.com.

License
Quote
Copyright (c) 2016 - 2018, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline 4Kstore

  • SMF Hero
  • ******
  • Posts: 4,301
  • Gender: Male
    • agustintari on Facebook
    • @agustintarifa on Twitter
    • SSIMPLE TEAM PAGE
Re: Real Popup with AdBlock Detection
« Reply #1 on: September 25, 2016, 04:33:40 PM »
Great mod! thanks for share I would like to help with the spanish translation

¡¡NEW MOD: Sparkles User Names!!!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,504
    • XPtsp.com Community
Re: Real Popup with AdBlock Detection
« Reply #2 on: September 25, 2016, 10:23:27 PM »
Uploaded v1.1 - September 25th, 2016
o Fixed "Use black overlay on AdBlock detection" functionality.
o Added "Can close Popup on AdBlock detection?" option.
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,504
    • XPtsp.com Community
Re: Real Popup with AdBlock Detection
« Reply #3 on: September 26, 2016, 09:29:16 AM »
Uploaded v1.2 - September 26th, 2016
o Added option to enable hiding Popup by membergroups.
o Added option to select membergroups to hide Popup from.
o Added additional error checking around Popup content file writing code.
o Added error message upon unsuccessful Popup content file write.
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,107
    • @studyforceps on Twitter
    • Study Force
Re: Real Popup with AdBlock Detection
« Reply #4 on: September 26, 2016, 04:08:35 PM »
Incredible mod.

Your modifications to this software are by-far the best.

On a side note, I don't like the name they chose for BlockAdBlock script. Does it actually prevent adblock from removing the ad, or it shows a message that an ad exists here?

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,504
    • XPtsp.com Community
Re: Real Popup with AdBlock Detection
« Reply #5 on: September 26, 2016, 04:25:17 PM »
Incredible mod.

Your modifications to this software are by-far the best.
Thank you!

On a side note, I don't like the name they chose for BlockAdBlock script. Does it actually prevent adblock from removing the ad, or it shows a message that an ad exists here?
No, it doesn't block AdBlock from functioning.  If you look at the GitHub link, you will see that BlockAdBlock is a fork of F**kAdBlock.  I chose BlockAdBlock because it would be better looking in a "corporate" environment than F**kAdBlock would....  That being said, they perform the same task: Allows you to detect the AdBlock (and other) extension(s).
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,107
    • @studyforceps on Twitter
    • Study Force
Re: Real Popup with AdBlock Detection
« Reply #6 on: September 26, 2016, 04:53:36 PM »
I like how you incorporated this. Adblock remains a powerful force

Online aegersz

  • Sophist Member
  • *****
  • Posts: 1,183
  • Gender: Male
  • "mods" junkie
    • dopetalk
Re: Real Popup with AdBlock Detection
« Reply #7 on: September 26, 2016, 05:24:08 PM »
on a side note, i noticed that your app button 'Admin' has a number next to it: Admin(15) - what is that all about, please ?
SMF 2.0: 135+ mods installed (the full list can be seen at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,504
    • XPtsp.com Community
Re: Real Popup with AdBlock Detection
« Reply #8 on: September 26, 2016, 07:06:44 PM »
on a side note, i noticed that your app button 'Admin' has a number next to it: Admin(15) - what is that all about, please ?
O:) ::) The Admin (15) thingy is the result of a screenshot where I hadn't emptied the error log before making the screenshot...
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Online aegersz

  • Sophist Member
  • *****
  • Posts: 1,183
  • Gender: Male
  • "mods" junkie
    • dopetalk
Re: Real Popup with AdBlock Detection
« Reply #9 on: September 26, 2016, 07:43:15 PM »
thanks for explaining that ... i have heaps of stuff in my error logs, it's embarrassing but my system seems to work (for the most part  ::))

i'd love this mod, i think it's great BUT i hate pop-ups !

good job, though. well done !

SMF 2.0: 135+ mods installed (the full list can be seen at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline MarkoKg

  • Jr. Member
  • **
  • Posts: 352
  • Gender: Male
Re: Real Popup with AdBlock Detection
« Reply #10 on: September 27, 2016, 08:11:05 AM »
Nicely done! Thanks for such a great mod!

Offline Kiriakos GR

  • Jr. Member
  • **
  • Posts: 140
  • Gender: Male
    • @ITTSB_EU on Twitter
Re: Real Popup with AdBlock Detection
« Reply #11 on: October 13, 2016, 06:33:33 PM »
Is it possible Pop-up this to be a JPG file instead of  HTML code?

 

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,504
    • XPtsp.com Community
Re: Real Popup with AdBlock Detection
« Reply #12 on: October 13, 2016, 08:10:08 PM »
Is it possible Pop-up this to be a JPG file instead of  HTML code?
No, you must use HTML code to refer to the image, like this:
Code: [Select]
<img src="/link/to/the/image" />
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline gomzy

  • Semi-Newbie
  • *
  • Posts: 12
Re: Real Popup with AdBlock Detection
« Reply #13 on: October 19, 2016, 11:35:40 AM »
i installed this mod, but i cannot see any popup being shown. anything i missed?

thanks for the help

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,504
    • XPtsp.com Community
Re: Real Popup with AdBlock Detection
« Reply #14 on: October 19, 2016, 09:25:17 PM »
Updated v1.3 - October 19th, 2016
o Modified package-info.xml to add redirect to mod admin settings upon install.


i installed this mod, but i cannot see any popup being shown. anything i missed?
My answer assumes you are running the latest version of the mod. 

Several questions first:
FIRST: Have you enabled the mod?  If not, go to Admin => Configuration => Modification Setttings => Real Popups, then check the Enable Real Popup mod? checkbox.  After you press Save, then you should start seeing the popup.

SECOND: Assuming you have the mod enabled, do you have the Display Popup only on AdBlock detection? checkbox checked?  If this is checked and AdBlock isn't running in your browser, you won't see the popup.

THIRD: (Once again assuming you have the mod enabled) Do you have the Hide Popup from non-admin membergroups? checkbox checked?  If so, then administrators and membergroups with the  Keep Popup from being shown permission are automatically excluded from seeing the popups.

Let me know what is the case.  Meanwhile, I'm going to update the mod to redirect to the Real Popups setting area upon install....  O:)  I apologize for forgetting to add that little bit to the mod....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline gomzy

  • Semi-Newbie
  • *
  • Posts: 12
Re: Real Popup with AdBlock Detection
« Reply #15 on: October 20, 2016, 11:35:15 PM »
thanks dougiefresh, i checked all the settings, really great module. would be better if it worked with various adblockers

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,504
    • XPtsp.com Community
Re: Real Popup with AdBlock Detection
« Reply #16 on: October 21, 2016, 06:50:40 AM »
thanks dougiefresh, i checked all the settings, really great module. would be better if it worked with various adblockers
Give me an example.
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline ms_ukyankee

  • Full Member
  • ***
  • Posts: 529
  • Gender: Female
Re: Real Popup with AdBlock Detection
« Reply #17 on: October 22, 2016, 10:15:24 AM »
Thank you for this mod, it was a great way to warn users that the site was going down for maintenance/site transfer. I'm sure I will find more marketing related uses for it later though. :)
SMF since 2004 <3

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,504
    • XPtsp.com Community
Re: Real Popup with AdBlock Detection
« Reply #18 on: November 16, 2016, 09:28:54 AM »
I can't seem to make it work. I have a forum and I use uBlock Origin. It doesn't detect uBlock.
This mod doesn't support uBlock at this time.  It may in the future, if I can figure out how to adapt the code.....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline Black Tiger

  • Full Member
  • ***
  • Posts: 543
  • Gender: Male
    • Satellite Fun
Re: Real Popup with AdBlock Detection
« Reply #19 on: November 17, 2016, 04:28:53 PM »
I would also like to use this mod, if it can detect ublock. I found a site which can do that and looked at the page source.

This is a script i found in the page source, could this be of any help to you do adapt the code?
Code: [Select]
<script>
function checkAdBlocker()
{
//var status = $('.adsBlock:visible').length == 0;
var adBlockStatus = (typeof(adsAreShown) == 'undefined');
var adBlockMsg = adBlockStatus? 'On (ads blocked)' : 'Off (ads shown)';
ga('send', { 'hitType': 'event', 'eventCategory': 'AdBlocker', 'eventAction': adBlockMsg, 'eventLabel': adBlockMsg, 'nonInteraction': 1 });
if(adBlockStatus)
{
$('#we-dont-like-blockers').show();
}
return adBlockStatus;
}

$(document).ready(checkAdBlocker);
                       
            $(window).load(function(){
                $('.image-wrapper').find('img').each(function(){
                    var imgClass = (this.width/this.height > 1) ? 'wide' : 'tall';
                    $(this).addClass(imgClass);
                });
            });
        </script>

And then this call a little higher (div id slightly adjusted):
Code: [Select]
<div id="we-dont-like-blockers">
    <div class="message">
        Dear visitor,<br /><br />

You are using an adblocker, please make an exception for us.       
        <div class="seriously">!</div>
       
    </div>
</div>
Greetings, Black Tiger