I found the script below in internet and I want it to create a page with
links for each date changing according to date. For example:
For August 10, the link in calendar page should point to:
/cgi-bin/calendar_day.pl?userdir=calend&dept=boys&weekends= 1&datestamp=20040
810
For August 11, the link in calendar page should point to:
/cgi-bin/calendar_day.pl?userdir=calend&dept=boys&weekends= 1&datestamp=20040
811
So far I did not succeed, any hints please?
Thanks in advance.
Webminor
-------
<html>
<head>
<title>Takvim</title>
</head>
<body bgcolor="#FFFFFF" link="#008000" vlink="#800040" text="#000000">
<!-- begin calendar -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
title="javascript for Calendar";
// if you comment url and un-comment new_url a click on any day links to
edit-day
// otherwise a click on any day simply brings up the whole calendar
// note - there are two places where this choice is made , see later in the
script
// CHANGE HERE!
//url="<a
href=\"/cgi-bin/calendar.pl\?userdir=calend\&dept=boys\&weekends=1 \">";
new_url="<a
href=\"/cgi-bin/calendar_day.pl\?userdir=calend\&dept=boys\&weeken ds=1\&date
stamp=thisyear\"";
monthnames = new Array(
"January",
"Februrary",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"Decemeber");
var linkcount=0;
function addlink(month, day, href) {
var entry = new Array(3);
entry[0] = month;
entry[1] = day;
entry[2] = href;
this[linkcount++] = entry;
}
Array.prototype.addlink = addlink;
linkdays = new Array();
monthdays = new Array(12);
monthdays[0]=31;
monthdays[1]=28;
monthdays[2]=31;
monthdays[3]=30;
monthdays[4]=31;
monthdays[5]=30;
monthdays[6]=31;
monthdays[7]=31;
monthdays[8]=30;
monthdays[9]=31;
monthdays[10]=30;
monthdays[11]=31;
todayDate=new Date();
thisday=todayDate.getDay();
thismonth=todayDate.getMonth();
thisdate=todayDate.getDate();
thisyear=todayDate.getYear();
thisyear = thisyear % 100;
thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear));
if (((thisyear % 4 == 0)
&& !(thisyear % 100 == 0))
||(thisyear % 400 == 0)) monthdays[1]++;
startspaces=thisdate;
while (startspaces > 7) startspaces-=7;
startspaces = thisday - startspaces + 1;
if (startspaces < 0) startspaces+=7;
document.write("<table border=2 bgcolor=white ");
document.write("bordercolor=black>");
document.write("<tr><th colspan=7 bgcolor=yellow><font color=black><strong>"
+ title + "<br>"
+ monthnames[thismonth] + " " + thisdate + ", " + thisyear
+ "</strong></font></th></tr>");
document.write("<tr>");
document.write("<td align=center><b><font color=red>Su</font></b></td>");
document.write("<td align=center>M</td>");
document.write("<td align=center>Tu</td>");
document.write("<td align=center>W</td>");
document.write("<td align=center>Th</td>");
document.write("<td align=center>F</td>");
document.write("<td align=center><b><font color=red>Sa</font></b></td>");
document.write("</font></tr>");
document.write("<tr>");
for (s=0;s<startspaces;s++) {
document.write("<td></td>");
}
count=1;
while (count <= monthdays[thismonth]) {
for (b = startspaces;b<7;b++) {
if (count==thisdate) {
document.write("\n<td bgcolor=yellow>");
}
else {document.write("\n<td>");}
if (count==thisdate) {
document.write("<font size=+1><strong>");
}
if (count <= monthdays[thismonth]) {
// CHANGE HERE!
//document.write(url + count + "</a>");
document.write(new_url + thisyear + thismonth + count + "\">" +
count + "</a>");
}
else {
document.write(" ");
}
if (count==thisdate) {
document.write("</strong></font>");
}
document.write("</td>");
count++;
}
document.write("</tr>");
document.write("<tr>");
startspaces=0;
}
document.write("<tr><th colspan=7 bgcolor=yellow><strong>"
+ "Click on a day"
+ "</strong></font></th></tr>");
document.write("</table></p>");
// End -->
</SCRIPT>
<!-- end calendar -->
</body>
</html>