PDA

View Full Version : Quick Code Change



[lhomme]
January 24th, 2002, 18:40
<SCRIPT LANGUAGE="JavaScript" src="http://www.popuptraffic.com/assign.php?l=ap&mode=behind"> </script>

How would I make the following code for a popup generate a popup only once per day per visitor?


Also, on another note, whats the code to make a different css file load for netscape or IE?

Cheap Bastard
January 24th, 2002, 19:17
you could easily do this using php and cookies. I don't know how yet (i just asked how to myself) but it can't be hard.

Doesn't popuptraffic have that option though?

[lhomme]
January 24th, 2002, 19:37
Not that I can find.

Woofcat
January 24th, 2002, 19:51
in php at the top of the page put:


<?$t=time();if(empty($pop)||$pop<$t-86400)header('Set-Cookie: pop='.$t.'; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/');else $t=0?>

and where your ad code is use:


<?if($t){?><SCRIPT LANGUAGE="JavaScript" src="http://www.popuptraffic.com/assign.php?l=ap&mode=behind"> </script><?}?>

Woofcat
January 24th, 2002, 19:54
damn you'd with the php blocks this board wouldn't f**k up code but that's vbulletin for you...

obviously <?if($t) & # 123;?> should be <?if($t){?>

[lhomme]
January 24th, 2002, 20:18
Thanks. Question: would the code automatically adjust the date?

Cheap Bastard
January 24th, 2002, 20:33
no need to change date...
date/time is fetched from system, written to cookie.
if time in cookie is less than a day old, no popup. if it is older than a day, the cookie's updated and the popup's shown.

[lhomme]
January 25th, 2002, 15:20
I inserted the both lines of code and corrected the <?if($t){?>. The page still generates a popup everytime I refresh though. Was there something else I missed? Thanks.