Template Club Package Silver Pacakage Gold Pacakage Developer Pacakage Accepted Payments Member Login
Welcome, Guest
Please Login or Register.    Lost Password?
StopPress to show once per week (1 viewing) (1) Guest
Go to bottomPost New TopicPost Reply Favoured: 0
TOPIC: StopPress to show once per week
#28849
StopPress to show once per week 8 Months, 3 Weeks ago  
Hi I would like the popup to show once per week. So basically, I would like to cookie to set for one week.

Would this work:

37 function createCookie(name,value,hours) {
38 if (hours) {
39 var date = new Date();
40 //Here is change 60*60 to 60*10080 to cause the popup to only appear after 7 days (604,800/60) = 10080
41 date.setTime(date.getTime()+(hours*60*10080));
42 var expires = "; expires="+date.toGMTString();
43 }
44 else expires = "";
45 document.cookie = name+"="+value+expires+"; path=/";
46 }
Enter code here   
Please note, although no boardcode and smiley buttons are shown, they are still useable
narsaw (Visitor)

Logged Logged  
 
Reply Quote  
Go to topPost New TopicPost Reply