News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Real Popup with AdBlock Detection

Started by dougiefresh, September 25, 2016, 03:29:26 PM

Previous topic - Next topic

dougiefresh

Link to Mod



REAL POPUP WITH ADBLOCK DETECTION v1.9
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 can be viewed at XPtsp.com.

License
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.

4Kstore

Great mod! thanks for share I would like to help with the spanish translation


¡¡NEW MOD: Sparkles User Names!!!

dougiefresh

Uploaded v1.1 - September 25th, 2016
o Fixed "Use black overlay on AdBlock detection" functionality.
o Added "Can close Popup on AdBlock detection?" option.

dougiefresh

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.

Biology Forums

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?

dougiefresh

Quote from: Stylus on September 26, 2016, 04:08:35 PM
Incredible mod.

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

Quote from: Stylus on September 26, 2016, 04:08:35 PM
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).

Biology Forums

I like how you incorporated this. Adblock remains a powerful force

aegersz

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 ?
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

dougiefresh

Quote from: aegersz 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 ?
O:) ::) The Admin (15) thingy is the result of a screenshot where I hadn't emptied the error log before making the screenshot...

aegersz

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 !

The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

MarkoKg

Nicely done! Thanks for such a great mod!

Kiriakos GR

Is it possible Pop-up this to be a JPG file instead of  HTML code?


dougiefresh

Quote from: Kiriakos GR on October 13, 2016, 06:33:33 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:
<img src="/link/to/the/image" />

gomzy

i installed this mod, but i cannot see any popup being shown. anything i missed?

thanks for the help

dougiefresh

Updated v1.3 - October 19th, 2016
o Modified package-info.xml to add redirect to mod admin settings upon install.



Quote from: gomzy on October 19, 2016, 11:35:40 AM
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....

gomzy

thanks dougiefresh, i checked all the settings, really great module. would be better if it worked with various adblockers

dougiefresh

Quote from: gomzy 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
Give me an example.

ms_ukyankee

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

dougiefresh

Quote from: godinperson on November 15, 2016, 03:28:07 PM
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.....

Black Tiger

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?
<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):
<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

Advertisement: