in case anybody cares, i figure it out. not the prettiest code, but it will generate a calendar for any year from the present on.
this php page assumes that you have a page passing it the $setmonth and $setyear variables.
<?
@$startnow="";
if (!@$setmonth){@$setmonth=date("n");}
if (!@$setyear){@$setyear=date("Y");}
$time=mktime(0,0,0,$setmonth,1,date($setyear));
$endtime=mktime(0,0,0,$setmonth+1,1,date($setyear));
$i=1;
while ($time<$endtime) {
$thedate[$i]=date("M j", $time);
$time=mktime(0,0,0,$setmonth,1+$i,date($setyear));
$i++;
}
$time=mktime(0,0,0,$setmonth,1,date($setyear));
?>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<a href="calendar.php"><<<Go back and pick another month/year</a>
<table cellpadding=4 cellspacing=4 border=0>
<tr>
<td>Sun</td>
<td>Mon</td>
<td>Tue</td>
<td>Wed</td>
<td>Thu</td>
<td>Fri</td>
<td>Sat</td>
</tr>
<?
$d=0;
for ($i=0;$i<6;$i++){
if (@$done!="1"){
echo "<tr>";
for ($t=0;$t<7;$t++){
echo "<td bgcolor=gray width=100 height=100 align=left valign=top>";
if (@$startnow){
if(@$thedate[@$startnow]){
echo "<font color=yellow><b>".@$thedate[@$startnow]."</font>";
if(!@$thedate[@$startnow+1])
{ @$done="1"; }
@$startnow++;
} else {echo "";}
} else if ($d==date("w", $time)){
echo "<font color=yellow><b>".@$thedate[1]."</font>";@$startnow=2;
} else {echo "";}
$d++;
echo "</td>";
}
echo "</tr>";
} else {break;}
}
?>
</body>
</html>