The warning popup plugin!?

To talk about everything
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

The warning popup plugin!?

Post by axew3 »

I'm building a site for a shop (that is reduced to a stunning presentation with nice impressive backgrounds) that need to have a simply warning that show up every time an user visit the site and let him accept to enter or leave based on what the message will show (example: if you are 18> enter OR leave).
I've not find out one very simple, perhaps because i've not search with right terms on plugin's repository.
I start to build a very simple and working one, using the modal CSS code abandoned into phpBB Wordpress integration.
Any suggestion?
User avatar
kaspir
Moderator
Moderator
Posts: 88
Joined: Mon Mar 20, 2017 2:38 pm
Location: USA
Contact:

Re: The warning popup plugin!?

Post by kaspir »

Take a look at the "COOKIE NOTICE" in phpBB overall_footer.html

Here it is:

Code: Select all

<script src="{T_ASSETS_PATH}/cookieconsent/cookieconsent.min.js?assets_version={T_ASSETS_VERSION}"></script>
	<script>
		window.addEventListener("load", function(){
			window.cookieconsent.initialise({
				"palette": {
					"popup": {
						"background": "#0F538A"
					},
					"button": {
						"background": "#E5E5E5"
					}
				},
				"theme": "classic",
				"content": {
					"message": "{LA_COOKIE_CONSENT_MSG}",
					"dismiss": "{LA_COOKIE_CONSENT_OK}",
					"link": "{LA_COOKIE_CONSENT_INFO}"
				}
			})});
	</script>
Good start, no?
Image
World of Phaos RPG online is making it's come back! Play free now!
Check out phpBB contributions & extension downloads. :P
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: The warning popup plugin!?

Post by axew3 »

hey thank you, but i was refer to a WP plugin. I've write already a pseudo code yesterday, that aim to use pure php/css solution.
It work fine, as posted into php.net in bad way also (i'm really shamed of myself often), the starting easy pseudo php code, that is may obvious for many, was this:

Code: Select all

if( !session_id() ){
session_start();
}
if(isset($_SESSION['w3_count'])){
$count = $_SESSION['w3_count'];
$count++; 
$count = $_SESSION['w3_count'] = $count;

} else {

$count = $_SESSION['w3_count'] = 0;
//... load popup in some way

}

//unset($_SESSION['w3_count']);
//unset($count);
//session_destroy();
//exit;
I need pure css/php because (it now is very rare that happen) maybe the user could have js disabled on browser.
But in this site i'm doing, in any case, for various reasons, the warning need to show up in any case, for reasons of laws ...
The plugin will be published for free. Very light and with custom message that is possible to format with easy as you like due to a ... not common, but smarty solution (almost it appear to me!)
Post Reply