diff options
author | Chad Little <clittle@users.sourceforge.net> | 2002-11-24 22:39:21 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2002-11-24 22:39:21 +0000 |
commit | c2bf86b86fe02d1834bc4d34a2ce297b9268a30b (patch) | |
tree | 24fd174a40d456059277135f057127e6bfc5b4fb /month.php | |
parent | 2f2aa4a790c2827c3e6145cd44020c49ecc6b95a (diff) | |
download | phpicalendar-c2bf86b86fe02d1834bc4d34a2ce297b9268a30b.tar.gz phpicalendar-c2bf86b86fe02d1834bc4d34a2ce297b9268a30b.tar.bz2 phpicalendar-c2bf86b86fe02d1834bc4d34a2ce297b9268a30b.zip |
Cleaned up month_bottom (removed).
Diffstat (limited to 'month.php')
-rw-r--r-- | month.php | 152 |
1 files changed, 115 insertions, 37 deletions
@@ -1,44 +1,45 @@ <?php - $current_view = "month"; - define('BASE', './'); - include(BASE.'functions/ical_parser.php'); - if ($minical_view == 'current') $minical_view = 'month'; - ereg ("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2); - $this_day = $day_array2[3]; - $this_month = $day_array2[2]; - $this_year = $day_array2[1]; - - $unix_time = strtotime($getdate); - $today_today = date ("Ymd"); - $tomorrows_date = date( "Ymd", strtotime("+1 day", $unix_time)); - $yesterdays_date = date( "Ymd", strtotime("-1 day", $unix_time)); - $date = mktime(0,0,0,"$this_month","$this_day","$this_year"); - - // find out next month - $next_month_month = ($this_month+1 == '13') ? '1' : ($this_month+1); - $next_month_day = $this_day; - $next_month_year = ($next_month_month == '1') ? ($this_year+1) : $this_year; - while (!checkdate($next_month_month,$next_month_day,$next_month_year)) $next_month_day--; - $next_month_time = mktime(0,0,0,$next_month_month,$next_month_day,$next_month_year); +$current_view = "month"; +define('BASE', './'); +include(BASE.'functions/ical_parser.php'); +if ($minical_view == 'current') $minical_view = 'month'; - // find out last month - $prev_month_month = ($this_month-1 == '0') ? '12' : ($this_month-1); - $prev_month_day = $this_day; - $prev_month_year = ($prev_month_month == '12') ? ($this_year-1) : $this_year; - while (!checkdate($prev_month_month,$prev_month_day,$prev_month_year)) $prev_month_day--; - $prev_month_time = mktime(0,0,0,$prev_month_month,$prev_month_day,$prev_month_year); +ereg ("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2); +$this_day = $day_array2[3]; +$this_month = $day_array2[2]; +$this_year = $day_array2[1]; +$unix_time = strtotime($getdate); +$today_today = date ("Ymd"); +$tomorrows_date = date( "Ymd", strtotime("+1 day", $unix_time)); +$yesterdays_date = date( "Ymd", strtotime("-1 day", $unix_time)); +$date = mktime(0,0,0,"$this_month","$this_day","$this_year"); - $next_month = date("Ymd", $next_month_time); - $prev_month = date("Ymd", $prev_month_time); - - $display_month = localizeDate ($dateFormat_month, $date); - $parse_month = date ("Ym", $date); - $first_of_month = $this_year.$this_month."01"; - $start_month_day = dateOfWeek($first_of_month, $week_start_day); - $thisday2 = localizeDate($dateFormat_week_list, $unix_time); - $num_of_events = 0; +// find out next month +$next_month_month = ($this_month+1 == '13') ? '1' : ($this_month+1); +$next_month_day = $this_day; +$next_month_year = ($next_month_month == '1') ? ($this_year+1) : $this_year; +while (!checkdate($next_month_month,$next_month_day,$next_month_year)) $next_month_day--; +$next_month_time = mktime(0,0,0,$next_month_month,$next_month_day,$next_month_year); + +// find out last month +$prev_month_month = ($this_month-1 == '0') ? '12' : ($this_month-1); +$prev_month_day = $this_day; +$prev_month_year = ($prev_month_month == '12') ? ($this_year-1) : $this_year; +while (!checkdate($prev_month_month,$prev_month_day,$prev_month_year)) $prev_month_day--; +$prev_month_time = mktime(0,0,0,$prev_month_month,$prev_month_day,$prev_month_year); + + +$next_month = date("Ymd", $next_month_time); +$prev_month = date("Ymd", $prev_month_time); + +$display_month = localizeDate ($dateFormat_month, $date); +$parse_month = date ("Ym", $date); +$first_of_month = $this_year.$this_month."01"; +$start_month_day = dateOfWeek($first_of_month, $week_start_day); +$thisday2 = localizeDate($dateFormat_week_list, $unix_time); +$num_of_events = 0; ?> @@ -211,7 +212,84 @@ </td> </tr> </table> -<?php include (BASE.'month_bottom.php'); ?> +<?php include (BASE.'calendar_nav.php'); ?> +<?php if (($num_of_events != 0) && ($this_months_events == "yes")) { ?> +<br> +<table border="0" cellspacing="0" cellpadding="0" width="737" bgcolor="#FFFFFF" class="calborder"> + <tr> + <td align="center" valign="top"> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td align="left" valign="top" width="160" class="sideback"><?php echo "<img src=\"images/spacer.gif\" alt=\"right\" width=\"16\" height=\"20\" border=\"0\" align=\"left\"></a>"; ?></td> + <td align="center" class="sideback" width="417" nowrap><font class="G10BOLD"><?php echo "$this_months_lang"; ?></font></td> + <td align="right" valign="top" width="160" class="sideback"><?php echo "<img src=\"images/spacer.gif\" alt=\"right\" width=\"16\" height=\"20\" border=\"0\" align=\"right\"></a>"; ?></td> + </tr> + <tr> + <td colspan="3" height="1"></td> + </tr> + <?php + // Iterate the entire master array + foreach($master_array as $key => $val) { + + // Pull out only this months + ereg ("([0-9]{6})([0-9]{2})", $key, $regs); + if ($regs[1] == $parse_month) { + $dayofmonth = strtotime ($key); + $dayofmonth = localizeDate ($dateFormat_week_list, $dayofmonth); + $i = 0; + if ($today_today == $key) { + $fontclass="class=\"G10BOLD\""; + } else { + $fontclass="class=\"G10B\""; + } + + // Pull out each day + foreach ($val as $new_val) { + + // Pull out each time + foreach ($new_val as $new_key2 => $new_val2) { + if ($new_val2["event_text"]) { + $event_text = stripslashes(urldecode($new_val2["event_text"])); + $event_text2 = addslashes($new_val2["event_text"]); + $event_text2 = str_replace("\"", """, $event_text2); + $event_text2 = urlencode($event_text2); + $description = addslashes(urlencode($new_val2["description"])); + $description = str_replace("\"", """, $description); + if (isset($new_val2["event_start"])) { + $event_start = $new_val2["event_start"]; + $event_end = $new_val2["event_end"]; + $event_start = date ($timeFormat, strtotime ("$event_start")); + $event_end = date ($timeFormat, strtotime ("$event_end")); + $event_text = str_replace ("<br>", "", $event_text); + $event_start2 = $event_start; + } else { + $event_start = "$all_day_lang"; + $event_start2 = ''; + $event_end = ''; } + if (strlen($event_text) > 70) { + $event_text = substr("$event_text", 0, 65); + $event_text = $event_text . "..."; + } + + echo "<tr>\n"; + echo "<td align=\"left\" valign=\"top\" width =\"160\" class=\"montheventline\" nowrap><font $fontclass> <a class=\"psf\" href=\"day.php?cal=$cal&getdate=$key\">$dayofmonth</a></font> <font class=\"V9G\">($event_start)</font></td>\n"; + echo "<td align=\"left\" valign=\"top\" colspan=\"2\">\n"; + echo " <a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start2', '$event_end', '$description')\"><font class=\"G10B\">$event_text</font></a>\n"; + echo "</td>\n"; + echo "</tr>\n"; + } + + } + } + } + } + + ?> + </table> + </td> + </tr> +</table> +<?php } ?> <?php include (BASE.'footer.inc.php'); ?> </center> </body> |