Name.com: Automate your domain portfolio. Zero API fees. Claim your token.

[Resolved] Need a Splash Screen Script!

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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
Close
Thanks lpxtech.. I appreciated that!!
 
0
Close
No problem, glad I could help.
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

The forum home page in the new NamePros Dark style
NamePros Dark has a new look
The dark style of the forum is now darker. The page is close to black, with a slight blue tint. New style: NamePros Dim Do you...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back