note 47551 deleted from ref.calendar by tularis
| From: | tularis@php.net | Date: | Fri, 19 Nov 2004 22:53:42 +0000 |
| Subject: | note 47551 deleted from ref.calendar by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-80785@lists.php.net to get a copy of this message | ||
Note Submitter: jedokahn at yahoo dot com
----
I used someones code below, but couldn't figure out how to incorporate a history type counter.
Basically I wanted to count ten days prior to today and have those items bolded out as well. I have
not problem getting the calendar to work but can only specify one day in bold not 10. (Ideally bold
is the starting point, I actually want to replace the <b> statement with a <a href
tag>). Has anyone done this before?
<html>
<body>
<?php
// Get the calender info
$t_days = cal_days_in_month(CAL_GREGORIAN, date("m"), date("Y"));
$day = date("w", mktime(0, 0, 0, date("m"), 1, date("Y")));
?>
<table border = "1">
<tr><th bgcolor = "yellow" colspan = "7"><?php echo
date("F Y"); ?></th></tr>
<tr><th>Sun</th><th>Mon</th><th>Tue</th>
<th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th></tr>
<?php
for ($i = 0; $i <= $t_days; $i++)
{
if ($day > 6) {
echo "</tr>\n<tr>\n";
$day = 0; }
//------------------------------------------------//
if ($i == date("j")) {?>
<td align = "center"><b><?php echo $i; $day++; echo
"</b></td>\n"; }
else if ($i > 0) {?>
<td align = "center"><?php echo $i; $day++; echo
"</td>\n"; }
else if ($day > 0) {?>
<tr><td colspan = "<?php echo $day; ?>"><?php echo
"</td>\n"; }
//-----------------------------------------------//
if ($i == $t_days && $day < 6) {?>
<td colspan = "<?php echo 7 - $day; ?>"><?php echo
"</td>\n</tr>\n"; }
}?>
</table>
</body>
</html>
----
Reason: spam