| Author | Topic: [RD] Advent Calendar help - reset? (Read 91 times) |
dramsay7s New Member
 member is offline
![[avatar]](http://s1.images.proboards.com/avatars/baby.gif)
Joined: Jul 2009 Posts: 29
|  | [RD] Advent Calendar help - reset? « Thread Started on Nov 7, 2009, 3:38am » | |
I made this advent calendar (http://support.proboards.com/index.cgi?board=codedatabase&action=display&thread=298537) but it let me click on the dates for Next month even though it's only November, so now I have the first 7 boxes open already. It says it uses cookies to remember which ones are already open, is there any way to reset it??
Code:<script type="text/javascript"> <!-- /* ADVENT CALENDAR - by Wormopolis Do not repost - keep header intact [url]wormocodes.proboards.com[/url] v 1.1 */
//edit year and month for calander, (jan=1 ... dec=12) var chosenMonth = 12;
var hideImage='http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449922.jpg'; //image before reveal
var images = [ ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449755.jpg'], // 1 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449758.jpg'], // 2 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449769.jpg'], // 3 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449775.jpg'], // 4 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449788.jpg'], // 5 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449793.jpg'], // 6 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449794.jpg'], // 7 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449806.jpg'], // 8 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449809.jpg'], // 9 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449812.jpg'], // 10 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449814.jpg'], // 11 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449816.jpg'], // 12 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449832.jpg'], // 13 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449837.jpg'], // 14 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449841.jpg'], // 15 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449844.jpg'], // 16 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449856.jpg'], // 17 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449866.jpg'], // 18 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449872.jpg'], // 19 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449879.jpg'], // 20 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449884.jpg'], // 21 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377450319.jpg'], // 22 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449908.jpg'], // 23 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449900.jpg'], // 24 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449904.jpg'], // 25 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449889.jpg'], // 26 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449909.jpg'], // 27 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449913.jpg'], // 28 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449915.jpg'], // 29 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449918.jpg'], // 30 ['http://pic60.picturetrail.com/VOL1740/12310469/22691424/377449920.jpg'] // 31 ];
// DONT EDIT BELOW HERE
function XBrowserAddHandler(target,eventName,handlerName) { if ( target.addEventListener ) { target.addEventListener(eventName, function(e){target[handlerName](e);}, false); } else if ( target.attachEvent ) { target.attachEvent("on" + eventName, function(e){target[handlerName](e);}); } }
if (location.href.match(/ion=calendar/)) { nwDate=new Date(); // check URL.. no "month" assume current month if (location.href.match(/month=(\d+)/)) { var calMonth=RegExp.$1;
} else { calMonth=nwDate.getMonth()+1; } if (chosenMonth==calMonth || (document.cookie.match('adv'+calMonth))) { tds=document.getElementsByTagName('td'); var place=0; for (i=0; i<tds.length; i++) { if ((tds[i].className=="windowbg2" || tds[i].className=="windowbg") && tds[i].vAlign=="top" && (tds[i].width=="14%" || tds[i].width=="15%") && tds[i].firstChild && tds[i].firstChild.nodeName=='TABLE') {
rgxp = new RegExp("adv"+calMonth+"=(\\d+)"); if (document.cookie.match(rgxp)){ bef=RegExp.$1; } else { bef="0000000000000000000000000000000"; }
dv=tds[i].getElementsByTagName('div')[0]; ig=document.createElement('img'); newpic=images[place++]; with (ig) { if (bef.charAt(place-1)!="1") { src=hideImage; } else { src=newpic; } width=100; height=80; border=0; style.borderColor=tds[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.bgColor; }
function swapPic(e) { this.src=this.storesrc; //000 0000 0000 0000 0000 0000 0000 0000 rgxp = new RegExp("adv"+calMonth+"=(\\d+)"); if (document.cookie.match(rgxp)){ bef=RegExp.$1; } else { bef="0000000000000000000000000000000"; } bef=bef.substring(0,this.keepnum-1)+"1"+bef.substring(this.keepnum,bef.length) tmpDate=new Date(); if (tmpDate.getMonth()<10) { tmpDate.setMonth(tmpDate.getMonth()+3); } else { tmpDate.setMonth(tmpDate.getMonth()-9); tmpDate.setYear(tmpDate.getFullYear()+1); } document.cookie="adv"+calMonth +"="+bef+"; expires="+tmpDate; }
calDay=dv.firstChild.firstChild.innerHTML;
ig.storesrc=newpic; ig.cHandler=swapPic; ig.keepnum=place;
if (calDay<=nwDate.getDate() || calDay=="TODAY") { ig.border=2; XBrowserAddHandler(ig,"click","cHandler");
} dv.parentNode.insertBefore(ig, dv.nextSibling); } } }
}
// --> </script> |
|
| |
|
Todge Moderator
     Official Code Helper member is offline
![[avatar]](http://todge.bishsite.com/avatars/10.jpg)
**
Joined: Jan 2004 Gender: Male  Posts: 5,517 Location: *Shrug*
|  | Re: Advent Calendar help - reset? « Reply #1 on Nov 7, 2009, 7:29am » | |
Delete the cookies..
|
![[image]](http://i3.photobucket.com/albums/y100/ProSaxPlayer/pbsoscars2/bestcoder_todge.png) |
|
Wormopolis Pro Member
     member is offline
![[avatar]](http://i197.photobucket.com/albums/aa250/WORMOPOLIS/worm_unblink.jpg)
AKA SK-Bundy
Joined: Jun 2008 Gender: Male  Posts: 3,171 Location: Las Vegas
|  | Re: Advent Calendar help - reset? « Reply #2 on Nov 7, 2009, 7:48am » | |
did it put the pictures in November or December?
|
|
|
dramsay7s New Member
 member is offline
![[avatar]](http://s1.images.proboards.com/avatars/baby.gif)
Joined: Jul 2009 Posts: 29
|  | Re: Advent Calendar help - reset? « Reply #3 on Nov 7, 2009, 9:46am » | |
it put the picture in December, but some of them had a border so I clicked on them to see if it worked, and all of the numbers of the month that had passed were clickable, despite it being the wrong month.
I don't know how to delete the cookies lol... maybe hubby does, will ask him!
| |
|
dramsay7s New Member
 member is offline
![[avatar]](http://s1.images.proboards.com/avatars/baby.gif)
Joined: Jul 2009 Posts: 29
|  | Re: Advent Calendar help - reset? « Reply #4 on Nov 7, 2009, 9:55am » | |
lol managed to delete the cookies, sorry about stupid post lol!
| |
|
Wormopolis Pro Member
     member is offline
![[avatar]](http://i197.photobucket.com/albums/aa250/WORMOPOLIS/worm_unblink.jpg)
AKA SK-Bundy
Joined: Jun 2008 Gender: Male  Posts: 3,171 Location: Las Vegas
|  | Re: Advent Calendar help - reset? « Reply #5 on Nov 7, 2009, 10:36am » | |
did you change your computer date or did it let you click them while still in November?
|
|
|
dramsay7s New Member
 member is offline
![[avatar]](http://s1.images.proboards.com/avatars/baby.gif)
Joined: Jul 2009 Posts: 29
|  | Re: Advent Calendar help - reset? « Reply #6 on Nov 7, 2009, 11:37am » | |
No, it lets me click them while still in November.
| |
|
Wormopolis Pro Member
     member is offline
![[avatar]](http://i197.photobucket.com/albums/aa250/WORMOPOLIS/worm_unblink.jpg)
AKA SK-Bundy
Joined: Jun 2008 Gender: Male  Posts: 3,171 Location: Las Vegas
|  | Re: Advent Calendar help - reset? « Reply #7 on Nov 7, 2009, 11:56am » | |
hmmm.. I will investigate.
|
|
|
dramsay7s New Member
 member is offline
![[avatar]](http://s1.images.proboards.com/avatars/baby.gif)
Joined: Jul 2009 Posts: 29
|  | Re: Advent Calendar help - reset? « Reply #8 on Nov 7, 2009, 12:38pm » | |
Thanks I have a lot of impatient nosey people on my site who might peek if I put it up too early now! :lol:
| |
|
Wormopolis Pro Member
     member is offline
![[avatar]](http://i197.photobucket.com/albums/aa250/WORMOPOLIS/worm_unblink.jpg)
AKA SK-Bundy
Joined: Jun 2008 Gender: Male  Posts: 3,171 Location: Las Vegas
| |
dramsay7s New Member
 member is offline
![[avatar]](http://s1.images.proboards.com/avatars/baby.gif)
Joined: Jul 2009 Posts: 29
|  | Re: Advent Calendar help - reset? « Reply #10 on Nov 10, 2009, 9:18am » | |
Fantastic, thank you!
| |
| |
|