Unstoppable Domains

[Resolved] Need a Splash Screen Script!

Spaceship Spaceship
Watch

boot2.com

Established Member
Impact
1
Need a Splash Screen Script!

Hi,
I have a joomla based websites and is running normally!

I want an cookie based script that will show the user with terms and conditions upon each visit!
Basically I want a banner type(as on freshdrop.net) shown with terms and conditions with agree and disagree button. When the agree button is pressed only then the page is shown. I want that to be cookie based so that the same user donot have to agree within a limited time.


Any helps would be appreciated!
Thanks
-Kate
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
Hi,

I don't mess with joomla too much, but this is a pretty quick method of doing this. Basically it's just php to check for the cookie, and css to style the splash.

Add this php code to the top of the home page:

Code:
<?php if ($_POST['accept_terms']) setcookie('accepted_terms', $_POST['accept_terms']); ?>

This assumes you have a post field with name="accept_terms"

And add the following php code right after the opening body tag:

Code:
<?php
$cookie = (isset($_COOKIE['accepted_terms'])) ? $_COOKIE['accepted_terms'] : 0;
if (!$cookie) showSplash();
function showSplash() {
	$html = '
<div id="splashBg">
	<div id="splash">
		<< ADD TERMS AND CONDITIONS HTML HERE >>
	</div>
</div>';
	echo $html;
}
?>

This is pretty self explanatory. If there is no cookie, or cookie = 0, show the splash.

And finally, add your CSS for the splashBg and splash divs

Code:
#splashBg {
	position: absolute;
	width: 100%;
	min-height: 800px;
	_height: 800px;
	height: 100%;
	background: #000;
	filter:alpha(opacity=60);
	-moz-opacity:.60;
	opacity:.60;
	z-index: 99998;
}
#splash {
	background: #0cc;
	width: 600px;
	height: 300px;
	position: absolute;
	top: 15%;
	left: 25%;
	z-index: 99999;
}

This is just a rough shot at the styling simple transparent background black 60% and a blue box, 600x300.


Does this help?
 
1
•••
Thanks lpxtech.. I appreciated that!!
 
0
•••
No problem, glad I could help.
 
0
•••

We're social

Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back