...

View Full Version : Floating banner that shows once per visitor



bigvito19
11-13-2011, 10:13 PM
I have this floating banner code and I want to show it once per visitor. How could I have it to show once per visitor?


<style>
#floating_banner_bottom {
text-align: left;
width: 00%;
bottom: 00px;
margin-bottom: 0px;
height: 50px;
position: fixed;
z-index: 50;
left: 0px;
</style>


<div id="floating_banner_bottom">
<!-- Button to Close Banner -->



<a style="display:scroll;position:fixed;bottom:50px;left:0px">

banner code

<br />

<div class="close">
<a href="#" onclick="document.getElementById('floating_banner_bottom').style.display='none';return false;">


<i style="font-family: Georgia,&quot;Times New Roman&quot;,serif;"><span style="background-color: #999999; color: white; font-size: small;"></span></i>

<center>
<img border="0" width="20" height="20" src="http://lh5.ggpht.com/_9vgJ1nwu_xA/S1jSp2ZhA7I/AAAAAAAAB8A/2AEBd4mR9qA/x.png" />
</center>
</a>
</div>

<a/>
</a></a></div>
<!-- End Here -->

Adee
11-13-2011, 11:29 PM
try sessions

or cookies for that matter

bigvito19
11-14-2011, 12:21 AM
I have this floating banner code and I want to show it once per visitor. How could I have it to show once per visitor?


<style>
#floating_banner_bottom {
text-align: left;
width: 00%;
bottom: 00px;
margin-bottom: 0px;
height: 50px;
position: fixed;
z-index: 50;
left: 0px;
</style>


<div id="floating_banner_bottom">
<!-- Button to Close Banner -->



<a style="display:scroll;position:fixed;bottom:50px;left:0px">

banner code

<br />

<div class="close">
<a href="#" onclick="document.getElementById('floating_banner_bottom').style.display='none';return false;">


<i style="font-family: Georgia,&quot;Times New Roman&quot;,serif;"><span style="background-color: #999999; color: white; font-size: small;"></span></i>

<center>
<img border="0" width="20" height="20" src="http://lh5.ggpht.com/_9vgJ1nwu_xA/S1jSp2ZhA7I/AAAAAAAAB8A/2AEBd4mR9qA/x.png" />
</center>
</a>
</div>

<a/>
</a></a></div>
<!-- End Here -->




<?php
# 24 hour cookie
if (isset($_COOKIE["ad_shown"]))
echo ""; //do nothing
else
echo "YOUR HTML AD CODE HERE";
$expire=time()+60*60*24*1;
setcookie("ad_shown", "1", $expire);
?>




How would I imply that inside the code?

Adee
11-14-2011, 12:39 AM
just do


if(!isset($_COOKIE['ad_shown']))
{
//show banner
setcookie( ... );
}


then if they come back it checks for cookie set and if its set it wont do anything.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum