AgaBoogaBoo
03-01-2003, 05:02 PM
This is a comic script and till today its worked without problem, but now its not working as it should, here is the code to the page I use it in:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.content {
font-family: verdana, arial, "ms sans serif", sans-serif;
font-size: 11px;
color: #101842;
background-color: #B5B5B5;
padding-right: 0px;
padding-left: 0px;
}
}
-->
</style>
</head>
<body bgcolor="#B5B5B5" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<td colspan=2 class="content">
<table border=0 width="100%" cellspacing="0" cellpadding="0" align="center">
<tr valign="top">
<td colspan=2 class="content">
<div align="center">
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript"><!--
var today=new Date();var thismonth=today.getMonth()+1;var thisyear=today.getYear();var thisday=today.getDate();
function comicwrite(year,month,day,name) {
var tempmonth;var shortyear;
if(year<1900) {year=year+1900;}
if(year>2000) {shortyear ="0"+(year-2000);}
else {shortyear=""+(year-1900);}
var montharray=new Array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
if(month>1) {tempmonth=month-1;} else {tempmonth=12;}
var maxdays=montharray[tempmonth-1];
if(tempmonth==2) {if(year % 100 == 0) {if(year % 400 == 0) { maxdays=29; }}
else {if((year%4)==0) {maxdays=29;}}}
if(day>1) {day--;}
else {if(month>1) {month--;day=maxdays;} else {month=12;year--;day=maxdays;}}
if(day < 10) {day ="0"+day;}
else {day = ""+day;}
if(month < 10) {month="0"+month;}
else {month = ""+month;}
document.write("<p><img src=http://images.ucomics.com/comics/"+name+"/"+year+"/"+name+shortyear+month+day+".gif border=0></p>");
}
comicwrite(thisyear,thismonth,thisday,"ga");
// --></script>
</div>
</td>
</tr>
</table>
</td>
</body>
<script language="JavaScript">
<!--
window.open = SymRealWinOpen;
//-->
</script>
</html>
The problem lies in the producing of the file name with the dates. For today, the end part should be 030301.gif instead it is 030229.gif so it doesn't show up
Any help is appreciated
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.content {
font-family: verdana, arial, "ms sans serif", sans-serif;
font-size: 11px;
color: #101842;
background-color: #B5B5B5;
padding-right: 0px;
padding-left: 0px;
}
}
-->
</style>
</head>
<body bgcolor="#B5B5B5" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<td colspan=2 class="content">
<table border=0 width="100%" cellspacing="0" cellpadding="0" align="center">
<tr valign="top">
<td colspan=2 class="content">
<div align="center">
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript"><!--
var today=new Date();var thismonth=today.getMonth()+1;var thisyear=today.getYear();var thisday=today.getDate();
function comicwrite(year,month,day,name) {
var tempmonth;var shortyear;
if(year<1900) {year=year+1900;}
if(year>2000) {shortyear ="0"+(year-2000);}
else {shortyear=""+(year-1900);}
var montharray=new Array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
if(month>1) {tempmonth=month-1;} else {tempmonth=12;}
var maxdays=montharray[tempmonth-1];
if(tempmonth==2) {if(year % 100 == 0) {if(year % 400 == 0) { maxdays=29; }}
else {if((year%4)==0) {maxdays=29;}}}
if(day>1) {day--;}
else {if(month>1) {month--;day=maxdays;} else {month=12;year--;day=maxdays;}}
if(day < 10) {day ="0"+day;}
else {day = ""+day;}
if(month < 10) {month="0"+month;}
else {month = ""+month;}
document.write("<p><img src=http://images.ucomics.com/comics/"+name+"/"+year+"/"+name+shortyear+month+day+".gif border=0></p>");
}
comicwrite(thisyear,thismonth,thisday,"ga");
// --></script>
</div>
</td>
</tr>
</table>
</td>
</body>
<script language="JavaScript">
<!--
window.open = SymRealWinOpen;
//-->
</script>
</html>
The problem lies in the producing of the file name with the dates. For today, the end part should be 030301.gif instead it is 030229.gif so it doesn't show up
Any help is appreciated