note 47551 added to ref.calendar
| From: | jedokahn at yahoo dot com | Date: | Fri, 19 Nov 2004 22:50:52 +0000 |
| Subject: | note 47551 added to ref.calendar | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-80784@lists.php.net to get a copy of this message | ||
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>
----
Manual Page -- http://www.php.net/manual/en/ref.calendar.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47551
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47551&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47551&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47551&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47551&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47551&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47551&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47551&report=yes
Search -- http://master.php.net/manage/user-notes.php