Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

[Resolved] Need a Splash Screen Script!

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
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

Each character of a domain name in its own box, with how to type one of them
Bookmarks: see bookmarks without a label
You can now show only the bookmarks you have not labeled. Open the label filter in the Bookmarks tab of your account menu, or on your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back