Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: dougiefresh on September 25, 2016, 03:29:26 PM

Title: Real Popup with AdBlock Detection
Post by: dougiefresh on September 25, 2016, 03:29:26 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=4096)


REAL POPUP WITH ADBLOCK DETECTION v1.8
By Dougiefresh (http://www.simplemachines.org/community/index.php?action=profile;u=253913) -> Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=4096)


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... (http://www.simplemachines.org/community/index.php?topic=543125.0)

Javascript Source Files
o Blossom Opt-in feature box script v1.1 (http://www.dynamicdrive.com/dynamicindex16/featurebox/index.html) on DynamicDrive.com
o BlockAdBlock (https://github.com/sitexw/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 (http://www.xptsp.com/board/index.php?topic=669.msg991#msg991).

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.
Title: Re: Real Popup with AdBlock Detection
Post by: 4Kstore on September 25, 2016, 04:33:40 PM
Great mod! thanks for share I would like to help with the spanish translation

Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh 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.
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh 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.
Title: Re: Real Popup with AdBlock Detection
Post by: Study Force 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?
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh 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 (https://github.com/sitexw/BlockAdBlock) link, you will see that BlockAdBlock (https://github.com/sitexw/BlockAdBlock) is a fork of F**kAdBlock (https://github.com/sitexw/******AdBlock).  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).
Title: Re: Real Popup with AdBlock Detection
Post by: Study Force on September 26, 2016, 04:53:36 PM
I like how you incorporated this. Adblock remains a powerful force
Title: Re: Real Popup with AdBlock Detection
Post by: 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 ?
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh 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...
Title: Re: Real Popup with AdBlock Detection
Post by: aegersz 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 !

Title: Re: Real Popup with AdBlock Detection
Post by: MarkoKg on September 27, 2016, 08:11:05 AM
Nicely done! Thanks for such a great mod!
Title: Re: Real Popup with AdBlock Detection
Post by: 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?

 
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh 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" />
Title: Re: Real Popup with AdBlock Detection
Post by: gomzy 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
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh 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....
Title: Re: Real Popup with AdBlock Detection
Post by: 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
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh 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.
Title: Re: Real Popup with AdBlock Detection
Post by: ms_ukyankee 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. :)
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh 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.....
Title: Re: Real Popup with AdBlock Detection
Post by: Black Tiger 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>
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh on November 17, 2016, 09:06:40 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?
Care to share the website?  I don't understand what it's checking for.....
Title: Re: Real Popup with AdBlock Detection
Post by: Black Tiger on November 18, 2016, 04:36:44 AM
Sure, maybe you can find more then I do, I'm no coder.
The website is webwereld.nl it's a dutch languaged site.
Title: Re: Real Popup with AdBlock Detection
Post by: PyroTech03 on November 24, 2016, 11:35:33 PM
I'm curious if someone can help me understand if this relates to my issue...

I run 4 ad sections on every page that runs some direct sales ads as well as adsense. I was making some money via adsense for this.

I found this mod and installed it. Shows once every 30 minutes to same user.

It seems I have not made any income from adsense from the point I enabled this mod. The ads were still showing up on board.

Is there something with how this ad comes up that adsense is invalidating the impression? Coincidence? Anywhere someone can recommend asking this?

I have disabled the mod to test but was wondering if anyone else has noticed this behavior?

Thanks in advance!
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh on November 25, 2016, 09:04:41 PM
I don't know why this would be happening, but I would guess that AdSense is checking the page for the ad code.  Since the ad code technically isn't on the page when it loads, you aren't getting credit for the ad.  So, I'm adding an option to include the contents of the popup inline in the HTML.
Title: Re: Real Popup with AdBlock Detection
Post by: PyroTech03 on November 25, 2016, 11:05:06 PM
I have/had it set to display immediately, I wonder if using delay would have any effect (if this is in fact what's happening).
Title: Re: Real Popup with AdBlock Detection
Post by: nend on November 26, 2016, 12:06:52 AM
I don't know why this would be happening, but I would guess that AdSense is checking the page for the ad code.  Since the ad code technically isn't on the page when it loads, you aren't getting credit for the ad.  So, I'm adding an option to include the contents of the popup inline in the HTML.
How is your pop up being displayed? If it covers the page then it violates the terms.

I say this because when the Adsense Bot crawls the page it blocks its own ads in the render, so it will see the warning just like if it had a Ad Blocker installed. The same goes for GoogleBot as well.

I ran into my own problems with it.
http://www.sicomm.us/t/229/?start=msg370#msg370
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh on November 30, 2016, 09:51:56 PM
Interesting....  I guess no changes in the mod will be needed to address this, as it is something that I can't change....
Title: Re: Real Popup with AdBlock Detection
Post by: snadge on December 28, 2016, 02:00:04 PM
i cant get this to work on 2.0.12 - when i enabled adblocplus on both firefox or chrome then visit my site i dont get any warning?

thanks
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh on December 29, 2016, 09:50:54 AM
i cant get this to work on 2.0.12 - when i enabled adblocplus on both firefox or chrome then visit my site i dont get any warning?
Did you enable adblock detection in the mod?  If not, then that's why you aren't seeing anything there.....
Title: Re: Real Popup with AdBlock Detection
Post by: snadge on December 29, 2016, 11:04:04 AM
duh! lol


works a charm ta! ;)
Title: Re: Real Popup with AdBlock Detection
Post by: nicotoine on January 22, 2017, 11:05:31 AM
Hello,
I love your mod, is it possible to add an option to open the popup from a link
and to be able to open several different ones.
thank you very much.  ;)
Title: Re: Real Popup with AdBlock Detection
Post by: BellGab.com on March 16, 2017, 04:47:21 AM
Seems to work great. Thanks.
Title: Re: Real Popup with AdBlock Detection
Post by: DeveloperMcD on March 19, 2017, 08:39:41 PM
How do you implement a close button?

I wrote up some HTML, and all the other settings work well. I'm getting the pop-up every time I enable ad-block (for the session, always, etc. depending on what I have set in the control panel)

However, there is no way to get rid of the window, aside from turning off AdBlock and hitting "refresh". As tempting as that is, I can't force that on my users at this time.

I tried <ESC>, clicking the window, etc. but nothing will make it go away.

Do I have to put in some custom javascript? And if so, what kind? What do I have to trigger to make the window go away?

Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh on March 21, 2017, 06:51:35 AM
@DeveloperMcD:  Go into the mod settings and check Can close Popup on AdBlock detection?.  That SHOULD allow users to close the popup while using Adblock detection.  If it doesn't, let me know.
Title: Re: Real Popup with AdBlock Detection
Post by: PLAYBOY on March 25, 2017, 04:59:20 PM
1- Popup doesn`t show no matter what I did. I applied all those things you said above. I also use enotify and ad management mods. So maybe a conflict there?

2- When you add a Turkish character in opt-in field and save, it removes everything in that field. I think this is a bug. Cause I can`t add any Turkish characters in the popup
Title: Re: Real Popup with AdBlock Detection
Post by: KyrrTube on May 03, 2017, 04:05:31 AM
Weird problem, How can I fix these?
Title: Re: Real Popup with AdBlock Detection
Post by: andsim on May 23, 2017, 09:53:25 PM
i have a problem
when i changes html to blockadblock.com they provide the code to in ur plugin html it say in as default html as before i put my. also when i turn can "Can close Popup on AdBlock detection?' disable the close when on enabled
by the way in my HTML contents of Opt-In file:
is empty should display nothing

Title: Re: Real Popup with AdBlock Detection
Post by: maglix04 on September 03, 2017, 08:17:36 AM
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" />
Congratulations for your mod, but I can't insert image whit code html
Code: [Select]
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title></title>
</head>
<body>
<span style="text-decoration: underline;"><img
style="width: 342px; height: 253px;" alt="antiadblock"
src="antiadblock.jpeg"></span><br>
</body>
</html>

Pop-up is empty, Why?
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh on September 04, 2017, 12:17:38 AM
You don't need the html and body tags, as it isn't a whole webpage you're including.  Try just this:
Code: [Select]
<img style="width: 342px; height: 253px;" alt="antiadblock" src="antiadblock.jpeg">Only make sure the full path to the file is included, as relative image links may or may not work.....
Title: Re: Real Popup with AdBlock Detection
Post by: maglix04 on September 04, 2017, 10:52:31 AM
Thanks, now all ok.
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh on September 12, 2017, 10:48:19 AM
Uploaded v1.4 - September 12th, 2017
o Added code so that contents of body tags are used instead of whole document.



@maglix04:  I've updated the code so that when the sample code given is used, the contents of the body tag are used instead of the entire sample.  This should prevent future confusion of this kind using this mod.  Thank you for the question!
Title: Re: Real Popup with AdBlock Detection
Post by: maglix04 on September 14, 2017, 03:11:01 PM
Thank you for update. Great mod!
Title: Re: Real Popup with AdBlock Detection
Post by: Ian Mc on September 24, 2017, 05:36:47 AM
First of all, great mod !!  I've been using it for some time now as a drop down to encourage registration and had great results.

I've encountered a minor problem recently having moved the site over to a new server and url. I've set up a 301 redirect in htaccess on the old site which takes visitors straight to the new site, the problem I'm having is when redirected to the new site the drop down appears straight away (I have it set at 60 seconds) and only partially loads as in the information box doesn't appear just a little unhappy face in it's place !!  Hope that makes sense !!

Is there anything I can change so that the mod doesn't activate straight away when redirected to the site?

Thanks in advance.
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh on November 19, 2017, 11:08:09 PM
Uploaded v1.5 - November 19th, 2017
o Added check to make sure the optincontent.txt file exists before continuing.
o Removed the forum path from the Javascript calling the Blossum Opt-in code.



@Ian Mc:  Sorry to address your bug report so late!  Hopefully, this update should fix the issue that you're experiencing!  If not, please let me know!
Title: Re: Real Popup with AdBlock Detection
Post by: Cola-Coca on January 10, 2018, 08:59:43 AM
Helo,

This mode has problems if you have the 'PrettyURL' installed. If you have 'PrettyURL' installed then the popup message does not come out, I just get this sign ' :-( '
I leave you a picture as a proof in the attach.

When I shut down 'PrettyURL' then the mod 'Real Popup with AdBlock Detection' works properly.
How to solve this problem?
Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh on January 10, 2018, 10:54:46 AM
Uploaded v1.6 - January 10th, 2018
o Added option to use optincontent.txt inline with HTML output.



@Cola-Cola:  Thank you for the bug report!  This update should solve the issue you reported.
Title: Re: Real Popup with AdBlock Detection
Post by: Cola-Coca on January 10, 2018, 05:36:20 PM
Uploaded v1.6 - January 10th, 2018
o Added option to use optincontent.txt inline with HTML output.



@Cola-Cola:  Thank you for the bug report!  This update should solve the issue you reported.

@dougiefresh
I have installed your last 1.6 version but the problem is the same if i have it turned on 'PrettyURL' mod.
If I have it turned on 'PrettyURL' mod and 'Real Popup with AdBlock Detection v1.6' the popup is displayed correctly only on home page, for example: 'www.smfforumsite.com/index.php'. If I go on board or post forum page I get error ' :-( ' which I have described before.

When it was turned off 'PrettyURL' the mod works 'Real Popup with AdBlock Detection' normally in all parts (board page, post page) of forum.

EDIT:
I solved the problem because i got activated option 'Include popup contents in each page load'.
But there is another problem, when i turn on the option ''Include popup contents in each page load' at the bottom of the forum on all forum pages (home page, board page, post page, etc...) a popup message is displayed. I leave the picture in attach.
I repeat, this message goes out on all forum pages at the bottom.





Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh on January 11, 2018, 11:02:04 AM
Uploaded v1.7 - January 11th, 2018
o Moved RealPopup files under the Themes directory.



@Cola-Cola:  I can't reproduce this issue that you reported.  However, since it appears that the CSS files aren't being loaded, I moved the RealPopup support files under Themes.  Hopefully, that'll stop your forum from interfering with the CSS loading statements.  It might even stop the issue that caused me to insert the "insert inline into HTML" stuff from last update....  Let me know if this solves the problem for you!  Thanks!
Title: Re: Real Popup with AdBlock Detection
Post by: Cola-Coca on January 11, 2018, 11:24:14 AM
Uploaded v1.7 - January 11th, 2018
o Moved RealPopup files under the Themes directory.



@Cola-Cola:  I can't reproduce this issue that you reported.  However, since it appears that the CSS files aren't being loaded, I moved the RealPopup support files under Themes.  Hopefully, that'll stop your forum from interfering with the CSS loading statements.  It might even stop the issue that caused me to insert the "insert inline into HTML" stuff from last update....  Let me know if this solves the problem for you!  Thanks!

Thanks for your reply. Do I have to download again 'Real Popup with AdBlock Detection' mod and install it ?

Thanks.


Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh on January 11, 2018, 12:13:33 PM
Yup, actually recommended.  Unless you want to manually move the RealPop folder to underneath the Themes, and alter the Sources/Subs-RealPopup.php file and change all occurrances of /RealPopup to /Themes/RealPopup....
Title: Re: Real Popup with AdBlock Detection
Post by: skb on February 22, 2018, 03:49:02 AM
Thanks for the Mod.

I'm using it on the forum index page to urge Guests to register. My forum is located at www.diabetic.pub/forum.

Is there a way to also use it on the website page/s ?
Title: Re: Real Popup with AdBlock Detection
Post by: Rock Lee on February 22, 2018, 05:24:22 AM
This comes to me as a ring to the finger I'm just progando some things and notice the adblock blocks more than just advertising if to use it: D


Regards!
Title: Re: Real Popup with AdBlock Detection
Post by: RFD on April 01, 2018, 09:50:11 AM
can't get this to work as a one time popup by setting the popup as immediate but only once, with a 365 day replay.  i can drop the browser, open it back up, enter the forum and the popup displays.  i'd expect it shouldn't / wouldn't .... ?  smf 2.0.15

mod list attached, too.

Title: Re: Real Popup with AdBlock Detection
Post by: dougiefresh on April 03, 2018, 07:06:23 PM
Uploaded v1.8 - April 3rd, 2018
o Fixed Subs-RealPopup.php so that days duration setting works properly.



@RFD:  Thank you for reporting this bug!  It's been fixed for this version!
Title: Re: Real Popup with AdBlock Detection
Post by: RFD on April 03, 2018, 07:48:39 PM
thanx dougie!