Thread: [Openfirst-cvscommit] members/phpicalendar/includes calendar_nav.php,NONE,1.1 event.php,NONE,1.1 foo
Brought to you by:
xtimg
Update of /cvsroot/openfirst/members/phpicalendar/includes In directory sc8-pr-cvs1:/tmp/cvs-serv25041 Added Files: calendar_nav.php event.php footer.inc.php header.inc.php sidebar.php todo.php Log Message: Add PHP iCalendar includes to the repository --- NEW FILE: calendar_nav.php --- <?php if ($cal == $ALL_CALENDARS_COMBINED) { $cal_displayname2 = $all_cal_comb_lang; } else { $cal_displayname2 = $calendar_name . " $calendar_lang"; } if (strlen($cal_displayname2) > 24) { $cal_displayname2 = substr("$cal_displayname2", 0, 21); $cal_displayname2 = $cal_displayname2 . "..."; } $next_day = date("Ymd", strtotime("+1 day", $unix_time)); $prev_day = date("Ymd", strtotime("-1 day", $unix_time)); // Get the real date to display as "go to today", not the date displayed in the calendar $really_unix_time = strtotime(date('Ymd')); $really_today_today = date ('Ymd', $really_unix_time); $fake_getdate_time = strtotime($this_year.'-'.$this_month.'-15'); ?> <br> <table border="0" width="737" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" class="calborder"> <tr> <td align="left" valign="top" width="1%" class="sideback"><?php echo "<a class=\"psf\" href=\"month.php?cal=$cal&getdate=$prev_day\"><img src=\"styles/$style_sheet/left_arrows.gif\" alt=\"[$last_day_lang]\" border=\"0\" align=\"left\"></a>"; ?></td> <td align="center" class="sideback"><font class="G10B"><b><?php print (localizeDate ($dateFormat_day, strtotime($getdate))); ?></b></font></td> <td align="right" valign="top" width="1%" class="sideback"><?php echo "<a class=\"psf\" href=\"month.php?cal=$cal&getdate=$next_day\"><img src=\"styles/$style_sheet/right_arrows.gif\" alt=\"[$next_day_lang]\" border=\"0\" align=\"right\"></a>"; ?></td> </tr> <tr> <td colspan="3"><img src="images/spacer.gif" width="1" height="5" alt=" "></td> </tr> <tr> <td width="1%" valign="top" align="right"> <table cellpadding="0" cellspacing="0" border="0" width="160"> <tr> <td valign="middle" align="center"> <table width="160" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center"><font class="G10BOLD"><?php print (localizeDate ($dateFormat_month, strtotime("-1 month", $fake_getdate_time))); ?></font></td> </tr> <tr> <td bgcolor="#FFFFFF" align="center"> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"> <?php $start_day = strtotime($week_start_day); echo '<tr>'; for ($i=0; $i<7; $i++) { $day_num = date("w", $start_day); $day = $daysofweekreallyshort_lang[$day_num]; echo '<td align="center" class="G10BOLD">'.$day.'</td>'; $start_day = strtotime("+1 day", $start_day); } echo '</tr>'; $minical_time = strtotime("-1 month", $fake_getdate_time); $minical_month = date("m", $minical_time); $minical_year = date("Y", $minical_time); $first_of_month = $minical_year.$minical_month."01"; $start_day = strtotime(dateOfWeek($first_of_month, $week_start_day)); $i = 0; $whole_month = TRUE; $num_of_events = 0; do { $day = date ("j", $start_day); $daylink = date ("Ymd", $start_day); $check_month = date ("m", $start_day); if ($check_month != $minical_month) $day = '<font class="G10G">'.$day.'</font>'; if ($i == 0) echo "<tr>\n"; if (isset($master_array[("$daylink")]) && ($check_month == $minical_month)) { echo '<td width="22" align="center" class="G10B">'; echo '<a class="ps2" href="'.$minical_view.'.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>'; echo '</td>'; } else { echo '<td width="22" align="center" class="G10B">'; echo '<a class="psf" href="'.$minical_view.'.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>'; echo '</td>'; } $start_day = strtotime("+1 day", $start_day); $i++; if ($i == 7) { echo '</tr>'; $i = 0; $checkagain = date ("m", $start_day); if ($checkagain != $minical_month) $whole_month = FALSE; } } while ($whole_month == TRUE); ?> </table> <img src="images/spacer.gif" width="1" height="3" alt=" "><br> </td> </tr> </table> </td> </tr> </table> </td> <td width="98%" valign="top" align="center"> <table border="0" width="330" cellspacing="0" cellpadding="0"> <tr> <td width="160" valign="top"> <table cellpadding="0" cellspacing="0" border="0" width="160"> <tr> <td bgcolor="#FFFFFF" align="left" class="G10BOLD"> <?php echo '<b>'.$jump_lang.'</b><br>'; echo '<img src="images/spacer.gif" width="1" height="6" alt=" "><br>'; echo "<form style=\"margin-bottom:0;\" action=\"month.php\" method=\"GET\"><select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value+'$query');\">"; include('./functions/list_icals.php'); include('./functions/list_years.php'); include('./functions/list_months.php'); include('./functions/list_weeks.php'); echo "</form>"; echo '<img src="images/spacer.gif" width="1" height="6" alt=" "><br>'; ?> </td> </tr> </table> </td> <td><img src="images/spacer.gif" width="20" height="1" alt=" "></td> <td width="160" valign="top"> <table cellpadding="0" cellspacing="0" border="0" width="160"> <tr> <td valign="middle" align="left" valign="top"> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" width="100%"> <tr> <td colspan="7"><img src="images/spacer.gif" width="21" height="2" alt=" "></td> </tr> <tr> <td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=" "></td> <td colspan="6"><font class="G10BOLD"><?php echo "$cal_displayname2"; ?></font></td> </tr> <tr> <td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=" "></td> <td colspan="6" class="G10B"> <?php echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$really_today_today\">$goday_lang</a><br>\n"; echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$really_today_today\">$goweek_lang</a><br>\n"; echo "<a class=\"psf\" href=\"month.php?cal=$cal&getdate=$really_today_today\">$gomonth_lang</a><br>\n"; echo "<a class=\"psf\" href=\"year.php?cal=$cal&getdate=$really_today_today\">$goyear_lang</a><br>\n"; echo "<a class=\"psf\" href=\"print.php?cal=$cal&getdate=$getdate&printview=$current_view\">$goprint_lang</a><br>\n"; if ($allow_preferences != 'no') echo "<a class=\"psf\" href=\"preferences.php?cal=$cal&getdate=$getdate\">$preferences_lang</a><br>\n"; if ($cal != $ALL_CALENDARS_COMBINED) echo "<a class=\"psf\" href=\"$subscribe_path\">$subscribe_lang</a> | <a class=\"psf\" href=\"$download_filename\">$download_lang</a>\n"; ?> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> <td width="1%" valign="top" align="left"> <table cellpadding="0" cellspacing="0" border="0" width="160"> <tr> <td valign="middle" align="center"> <table width="160" border="0" cellpadding="3" cellspacing="0"> <tr> <td align="center"><font class="G10BOLD"><?php print (localizeDate ($dateFormat_month, strtotime("+1 month", $fake_getdate_time))); ?></font></td> </tr> <tr> <td bgcolor="#FFFFFF" align="center"> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"> <?php $start_day = strtotime($week_start_day); echo '<tr>'; for ($i=0; $i<7; $i++) { $day_num = date("w", $start_day); $day = $daysofweekreallyshort_lang[$day_num]; echo '<td align="center" class="G10BOLD">'.$day.'</td>'; $start_day = strtotime("+1 day", $start_day); } echo '</tr>'; $minical_time = strtotime("+1 month", $fake_getdate_time); $minical_month = date("m", $minical_time); $minical_year = date("Y", $minical_time); $first_of_month = $minical_year.$minical_month."01"; $start_day = strtotime(dateOfWeek($first_of_month, $week_start_day)); $i = 0; $whole_month = TRUE; $num_of_events = 0; do { $day = date ("j", $start_day); $daylink = date ("Ymd", $start_day); $check_month = date ("m", $start_day); if ($check_month != $minical_month) $day = '<font class="G10G">'.$day.'</font>'; if ($i == 0) echo "<tr>\n"; if (isset($master_array[("$daylink")]) && ($check_month == $minical_month)) { echo '<td width="22" align="center" class="G10B">'; echo '<a class="ps2" href="'.$minical_view.'.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>'; echo '</td>'; } else { echo '<td width="22" align="center" class="G10B">'; echo '<a class="psf" href="'.$minical_view.'.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>'; echo '</td>'; } $start_day = strtotime("+1 day", $start_day); $i++; if ($i == 7) { echo '</tr>'; $i = 0; $checkagain = date ("m", $start_day); if ($checkagain != $minical_month) $whole_month = FALSE; } } while ($whole_month == TRUE); ?> </table> <img src="images/spacer.gif" width="1" height="3" alt=" "><br> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> --- NEW FILE: event.php --- <?php define('BASE', '../'); include (BASE.'functions/init.inc.php'); if (isset($HTTP_GET_VARS['event']) && ($HTTP_GET_VARS['event'] !== '') ) { $event = $HTTP_GET_VARS['event']; } else { $event = ''; } if (isset($HTTP_GET_VARS['description']) && ($HTTP_GET_VARS['description'] !== '') ) { $description = $HTTP_GET_VARS['description']; } else { $description = ''; } if (isset($HTTP_GET_VARS['cal']) && ($HTTP_GET_VARS['cal'] !== '') ) { $calendar_name = $HTTP_GET_VARS['cal']; } else { $calendar_name = ''; } if (isset($HTTP_GET_VARS['start']) && ($HTTP_GET_VARS['start'] !== '') ) { $start = $HTTP_GET_VARS['start']; } else { $start = ''; } if (isset($HTTP_GET_VARS['end']) && ($HTTP_GET_VARS['end'] !== '') ) { $end = $HTTP_GET_VARS['end']; } else { $end = ''; } if (isset($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] !== '') ) { $status = $HTTP_GET_VARS['status']; } else { $status = ''; } if (isset($HTTP_GET_VARS['location']) && ($HTTP_GET_VARS['location'] !== '') ) { $location = $HTTP_GET_VARS['location']; } else { $location = ''; } if (isset($HTTP_GET_VARS['organizer']) && ($HTTP_GET_VARS['organizer'] !== '') ) { $organizer = $HTTP_GET_VARS['organizer']; } else { $organizer = ''; } if (isset($HTTP_GET_VARS['attendee']) && ($HTTP_GET_VARS['attendee'] !== '') ) { $attendee = $HTTP_GET_VARS['attendee']; } else { $attendee = ''; } $event = rawurldecode($event); $event = stripslashes($event); $event = str_replace('\\', '', $event); $description = rawurldecode($description); $description = stripslashes($description); $description = str_replace('\\', '', $description); $organizer = rawurldecode($organizer); $organizer = stripslashes($organizer); $organizer = str_replace('\\', '', $organizer); $organizer = unserialize ($organizer); $attendee = rawurldecode($attendee); $attendee = stripslashes($attendee); $attendee = str_replace('\\', '', $attendee); $attendee = unserialize ($attendee); $location = rawurldecode($location); $location = stripslashes($location); $location = str_replace('\\', '', $location); $calendar_name2 = rawurldecode($calendar_name); $calendar_name2 = stripslashes($calendar_name2); $calendar_name2 = str_replace('\\', '', $calendar_name2); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8"> <title><?php if ($calendar_name == $ALL_CALENDARS_COMBINED) { echo "$all_cal_comb_lang"; } else { echo "$calendar_name2"; }?></title> <link rel="stylesheet" type="text/css" href="<?php echo BASE."styles/$style_sheet/default.css"; ?>"> </head> <body bgcolor="#eeeeee"><center> <table border="0" width="430" cellspacing="0" cellpadding="0" class="calborder"> <tr> <td align="left" valign="top" width="1%" class="sideback"><img src="../images/spacer.gif" width="1" height="20" alt=" "></td> <td align="center" width="98%" class="sideback"><font class="G10BOLD"> <?php if ($calendar_name == $ALL_CALENDARS_COMBINED) { echo "$all_cal_comb_lang"; } else { echo "$calendar_name2 $calendar_lang"; } ?> </font></td> <td align="right" valign="top" width="1%" class="sideback"></td> </tr> <tr> <td colspan="3"><img src="../images/spacer.gif" width="1" height="6" alt=" "></td> </tr> <tr> <td colspan="3"> <table width="430" border="0" cellspacing="0" cellpadding="0"> <?php if (($start) && ($end)) $event_times = ' - <font class="V9">(<i>'.$start.' - '.$end.'</i>)</font>'; if ($start == '' && $end == '' && (isset($start) && isset($end))) $event_times = ' - <font class="V9">(<i>'.$all_day_lang.'</i>)</font>'; ?> <tr> <td width="1%"><img src="../images/spacer.gif" width="6" height="1" alt=" "></td> <td align="left" colspan="2" class="V12"><?php echo $event.' '.$event_times.'<br><br>'; ?></td> </tr> <?php if ($description) { ?> <tr> <td width="1%"><img src="../images/spacer.gif" width="6" height="1" alt=" "></td> <td align="left" colspan="2" class="V12"> <?php echo ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", '<a target="_new" href="\0">\0</a>', $description); ?></td> </tr> <?php } ?> <?php if ($organizer) { $i = 0; echo '<tr>'; echo '<td width="1%"><img src="images/spacer.gif" width="6" height="1" alt=" "></td>'; echo '<td align="left" colspan="2" class="V12">'; echo $organizer_lang.' - '; foreach ($organizer as $val) { $organizers .= $organizer[$i]["name"].', '; $i++; } $organizers = substr ($organizers, 0, -2); echo $organizers.'</td></tr>'; } if ($attendee) { $i = 0; echo '<tr>'; echo '<td width="1%"><img src="images/spacer.gif" width="6" height="1" alt=" "></td>'; echo '<td align="left" colspan="2" class="V12">'; echo $attendee_lang.' - '; foreach ($attendee as $val) { $attendees .= $attendee[$i]["name"].', '; $i++; } $attendees = substr ($attendees, 0, -2); echo $attendees.'</td></tr>'; } if ($status) { echo '<tr>'; echo '<td width="1%"><img src="images/spacer.gif" width="6" height="1" alt=" "></td>'; echo '<td align="left" colspan="2" class="V12">'; echo $status_lang.' - '.$status.'</td>'; echo '</tr>'; } if ($location) { echo '<tr>'; echo '<td width="1%"><img src="images/spacer.gif" width="6" height="1" alt=" "></td>'; echo '<td align="left" colspan="2" class="V12">'; echo $location_lang.' - '.$location.'</td>'; echo '</tr>'; } ?> </table> </td> </tr> </table> </center> </body> </html> --- NEW FILE: footer.inc.php --- <?php echo "<br>$powered_by_lang <a class=\"psf\" href=\"http://phpicalendar.sourceforge.net/nuke/\">PHP iCalendar 0.9.4</a>"; if ($enable_rss == 'yes') { echo "<br>\n"; if ((isset($current_view)) && ($current_view == 'rssindex')) { echo '<a style="color:gray" href="http://feeds.archive.org/validator/check?url='.$footer_check.'"><img src="'.BASE.'images/valid-rss.png" alt="[Valid RSS]" title="Validate my RSS feed" width="88" height="31" border="1" vspace="3" />'; } else { echo $this_site_is_lang.' <a class="psf" href="'.BASE.'rss/index.php?cal='.$cal.'&getdate='.$getdate.'">RSS-Enabled</a>'; } } echo '</center>'; include($footer); ?> --- NEW FILE: header.inc.php --- <?php include($header); if(! isset($user->user) || $user->user == "") { die(show_login() . include($footer)); } ?> --- NEW FILE: sidebar.php --- <?php // Get the real date to display in the sidebar, not the date displayed in the calendar $really_unix_time = strtotime(date('Ymd')); $really_today_today = date ('Ymd', $really_unix_time); if ($cal == $ALL_CALENDARS_COMBINED) { $cal_displayname2 = $all_cal_comb_lang; } else { $cal_displayname2 = $calendar_name . " $calendar_lang"; } if (strlen($cal_displayname2) > 24) { $cal_displayname2 = substr("$cal_displayname2", 0, 21); $cal_displayname2 = $cal_displayname2 . "..."; } $search_box = '<form style="margin-bottom:0;" action="search.php" method="GET"><input type="hidden" name="cal" value="'.$cal.'"><input type="hidden" name="getdate" value="'.$getdate.'"><input type="text" style="font-size:10px" size="15" class="search_style" name="query" value="'.$search_lang.'" onfocus="javascript:if(this.value==\''.$search_lang.'\') {this.value=\'\';}" onblur="javascript:if(this.value==\'\') {this.value=\''.$search_lang.'\'}"><INPUT type="image" src="styles/'.$style_sheet.'/search.gif" name="submit" value="Search"></form>'; ?> <table width="170" border="0" cellpadding="0" cellspacing="0" class="calborder"> <tr> <td align="left" valign="top" width="24" class="sideback"><?php echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$yesterdays_date\"><img src=\"styles/$style_sheet/left_arrows.gif\" alt=\"[$prev_lang]\" width=\"16\" height=\"20\" border=\"0\" align=\"left\"></a>"; ?></td> <td align="center" width="112" class="sideback"><font class="G10BOLD"><?php echo "$thisday2"; ?></font></td> <td align="right" valign="top" width="24" class="sideback"><?php echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$tomorrows_date\"><img src=\"styles/$style_sheet/right_arrows.gif\" alt=\"[$next_lang]\" width=\"16\" height=\"20\" border=\"0\" align=\"right\"></a>"; ?></td> </tr> <tr> <td colspan="3" bgcolor="#FFFFFF" align="left"> <?php echo '<div style="padding: 5px;">'; echo '<font class="G10BOLD">'.$cal_displayname2.'</font><br>'; echo '<span class="G10">'; echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$really_today_today\">$goday_lang</a><br>\n"; echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$really_today_today\">$goweek_lang</a><br>\n"; echo "<a class=\"psf\" href=\"month.php?cal=$cal&getdate=$really_today_today\">$gomonth_lang</a><br>\n"; echo "<a class=\"psf\" href=\"year.php?cal=$cal&getdate=$really_today_today\">$goyear_lang</a><br>\n"; echo "<a class=\"psf\" href=\"print.php?cal=$cal&getdate=$getdate&printview=$current_view\">$goprint_lang</a><br>\n"; if ($allow_preferences != 'no') echo "<a class=\"psf\" href=\"preferences.php?cal=$cal&getdate=$getdate\">$preferences_lang</a><br>\n"; if ($cal != $ALL_CALENDARS_COMBINED) echo "<a class=\"psf\" href=\"$subscribe_path\">$subscribe_lang</a> | <a class=\"psf\" href=\"$download_filename\">$download_lang</a>\n"; echo '</span></div>'; ?> </td> </tr> </table> <img src="images/spacer.gif" width="1" height="10" alt=" "><br> <table width="170" border="0" cellpadding="0" cellspacing="0" class="calborder"> <tr height="20"> <td align="center" class="sideback"><div style="height: 20px; margin-top: 3px;" class="G10BOLD"><?php echo "$jump_lang"; ?></div></td> </tr> <tr> <td bgcolor="#FFFFFF" align="left"> <?php echo '<div style="padding: 5px;">'; echo '<form style="margin-bottom:0;" action="day.php" method="GET">'; echo "<select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value+'$query');\">"; include('./functions/list_icals.php'); include('./functions/list_years.php'); include('./functions/list_months.php'); include('./functions/list_weeks.php'); echo '</form>'; if ($show_search == 'yes') { echo $search_box; } if ($display_custom_goto == "yes") { echo '<form style="margin-bottom:0;" action="day.php" method="GET">'; echo '<input type="hidden" name="cal" value="'.urlencode($cal).'">'; echo '<input type="text" style="width:160px; font-size:10px" name="jumpto_day">'; echo '<input type="submit" value="Go">'; echo '</form>'; } echo '</div>'; ?> </td> </tr> </table> <img src="images/spacer.gif" width="1" height="10" alt=" "><br> <?php if (isset($master_array[($tomorrows_date)]) && sizeof($master_array[($tomorrows_date)]) > 0) { ?> <table width="170" border="0" cellpadding="0" cellspacing="0" class="calborder"> <tr height="20"> <td align="center" class="sideback"><div style="height: 20px; margin-top: 3px;" class="G10BOLD"><?php echo "$tomorrows_lang"; ?></div></td> </tr> <tr> <td bgcolor="#FFFFFF" align="center"> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" width="100%"> <tr> <td colspan="7"><img src="images/spacer.gif" width="21" height="6" alt=" "></td> </tr> <?php echo "<tr>\n"; echo "<td width=\"1%\"><img src=\"images/spacer.gif\" width=\"4\" height=\"1\" alt=\" \"></td>"; echo "<td colspan=\"6\" class=\"G10B\" align=\"left\">\n"; foreach ($master_array[("$tomorrows_date")] as $event_times) { foreach ($event_times as $val) { $event_text = stripslashes(urldecode($val["event_text"])); $event_text = strip_tags($event_text, '<b><i><u>'); if ($event_text != "") { $event_text2 = rawurlencode(addslashes($val["event_text"])); $description = addslashes(urlencode($val["description"])); $event_start = @$val["event_start"]; $event_end = @$val["event_end"]; $event_start = date ($timeFormat, @strtotime ("$event_start")); $event_end = date ($timeFormat, @strtotime ("$event_end")); $calendar_name2 = addslashes($calendar_name); $calendar_name2 = urlencode($calendar_name2); $event_text = word_wrap($event_text, 21, $tomorrows_events_lines); if (!isset($val["event_start"])) { $event_start = $all_day_lang; $event_end = ''; openevent($calendar_name2, $event_start, $event_end, $val, $tomorrows_events_lines, 21, '<i>', '</i>', 'psf'); echo "<br>\n"; } else { openevent($calendar_name2, $event_start, $event_end, $val, $tomorrows_events_lines, 21, '<font class="G10B">• ', '</font>', 'psf'); echo "<br>\n"; } } } } echo "</td>\n"; echo "</tr>\n"; ?> </table> </td> </tr> <tr> <td colspan="3" bgcolor="#FFFFFF"><img src="images/spacer.gif" width="148" height="6" alt=" "></td> </tr> </table> <img src="images/spacer.gif" width="1" height="10" alt=" "><br> <?php } if ((isset($master_array['-2'])) && ($show_todos == 'yes')) { ?> <table width="170" border="0" cellpadding="0" cellspacing="0" class="calborder"> <tr height="20"> <td align="center" width="98%" class="sideback"><div style="height: 20px; margin-top: 3px;" class="G10BOLD"><?php echo "$todo_lang"; ?></div></td> </tr> <tr> <td bgcolor="#FFFFFF" align="center"> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" width="100%"> <tr> <td colspan="7"><img src="images/spacer.gif" width="21" height="6" alt=" "></td> </tr> <?php echo "<tr>\n"; echo "<td width=\"1%\"><img src=\"images/spacer.gif\" width=\"4\" height=\"1\" alt=\" \"></td>"; echo "<td colspan=\"6\" class=\"G10B\" align=\"left\">\n"; echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n"; foreach ($master_array['-2'] as $vtodo_times) { foreach ($vtodo_times as $val) { $vtodo_text = stripslashes(urldecode($val["vtodo_text"])); if ($vtodo_text != "") { if (isset($val["description"])) { $description = urldecode($val["description"]); } else { $description = ""; } $completed_date = $val['completed_date']; $status = $val["status"]; $priority = $val['priority']; $start_date = $val["start_date"]; $due_date = $val['due_date']; $vtodo_array = array( 'cal' => $calendar_name, 'completed_date'=> $completed_date, 'description' => $description, 'due_date' => $due_date, 'priority' => $priority, 'start_date' => $start_date, 'status' => $status, 'vtodo_text' => $vtodo_text); $vtodo_array = base64_encode(serialize($vtodo_array)); $vtodo_text = word_wrap(strip_tags(str_replace('<br>',' ',$vtodo_text), '<b><i><u>'), 21, $tomorrows_events_lines); $vtodo_link = "<a class=\"psf\" href=\"javascript:openTodoInfo('$vtodo_array')\">"; if ($status == 'COMPLETED' || (isset($val['completed_date']) && isset($val['completed_time']))) { if ($show_completed == 'yes') { $vtodo_text = "<S>$vtodo_text</S>"; echo "<tr><td>$vtodo_link<img src=\"images/completed.gif\" alt=\" \" width=\"13\" height=\"11\" border=\"0\" align=\"middle\"></a></td>\n"; echo "<td><img src=\"images/spacer.gif\" width=\"2\" height=\"1\" border\"0\" /></td><td>$vtodo_link<font class=\"G10B\"> $vtodo_text</font></a></td></tr>\n"; } } elseif (isset($val['priority']) && ($val['priority'] != 0) && ($val['priority'] <= 5)) { echo "<tr><td>$vtodo_link<img src=\"images/important.gif\" alt=\" \" width=\"13\" height=\"11\" border=\"0\" align=\"middle\"></a></td>\n"; echo "<td><img src=\"images/spacer.gif\" width=\"2\" height=\"1\" border\"0\" /></td><td>$vtodo_link<font class=\"G10B\"> $vtodo_text</font></a></td></tr>\n"; } else { echo "<tr><td>$vtodo_link<img src=\"images/not_completed.gif\" alt=\" \" width=\"13\" height=\"11\" border=\"0\" align=\"middle\"></a></td>\n"; echo "<td><img src=\"images/spacer.gif\" width=\"2\" height=\"1\" border\"0\" /></td><td>$vtodo_link<font class=\"G10B\"> $vtodo_text</font></a></td></tr>\n"; } } } } echo "</table>\n"; echo "</td>\n"; echo "</tr>\n"; ?> </table> </td> </tr> <tr> <td colspan="3" bgcolor="#FFFFFF"><img src="images/spacer.gif" width="148" height="6" alt=" "></td> </tr> </table> <img src="images/spacer.gif" width="1" height="10" alt=" "><br> <?php } $fake_getdate_time = strtotime($this_year.'-'.$this_month.'-15'); ?> <table width="170" border="0" cellpadding="3" cellspacing="0" class="calborder"> <tr height="20"> <td align="center" class="sideback"><font class="G10BOLD"><?php print (localizeDate ($dateFormat_month, strtotime("-1 month", $fake_getdate_time))); ?></font></td> </tr> <tr> <td bgcolor="#FFFFFF" align="center"> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"> <?php $start_day = strtotime($week_start_day); echo '<tr>'; for ($i=0; $i<7; $i++) { $day_num = date("w", $start_day); $day = $daysofweekreallyshort_lang[$day_num]; echo '<td align="center" class="G10BOLD">'.$day.'</td>'; $start_day = strtotime("+1 day", $start_day); } echo '</tr>'; $minical_time = strtotime("-1 month", $fake_getdate_time); $minical_month = date("m", $minical_time); $minical_year = date("Y", $minical_time); $first_of_month = $minical_year.$minical_month."01"; $start_day = strtotime(dateOfWeek($first_of_month, $week_start_day)); $i = 0; $whole_month = TRUE; $num_of_events = 0; do { $day = date ("j", $start_day); $daylink = date ("Ymd", $start_day); $check_month = date ("m", $start_day); if ($check_month != $minical_month) $day = '<font class="G10G">'.$day.'</font>'; if ($i == 0) echo "<tr>\n"; if (isset($master_array[("$daylink")]) && ($check_month == $minical_month)) { echo '<td width="22" align="center" class="G10B">'; echo '<a class="ps2" href="'.$minical_view.'.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>'; echo '</td>'; } else { echo '<td width="22" align="center" class="G10B">'; echo '<a class="psf" href="'.$minical_view.'.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>'; echo '</td>'; } $start_day = strtotime("+1 day", $start_day); $i++; if ($i == 7) { echo '</tr>'; $i = 0; $checkagain = date ("m", $start_day); if ($checkagain != $minical_month) $whole_month = FALSE; } } while ($whole_month == TRUE); ?> </table> <img src="images/spacer.gif" width="1" height="3" alt=" "><br> </td> </tr> </table> <img src="images/spacer.gif" width="1" height="10" alt=" "><br> <table width="170" border="0" cellpadding="3" cellspacing="0" class="calborder"> <tr height="20"> <td align="center" class="sideback"><font class="G10BOLD"><?php print (localizeDate ($dateFormat_month, strtotime($getdate))); ?></font></td> </tr> <tr> <td bgcolor="#FFFFFF" align="center"> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"> <?php $start_day = strtotime($week_start_day); echo '<tr>'; for ($i=0; $i<7; $i++) { $day_num = date("w", $start_day); $day = $daysofweekreallyshort_lang[$day_num]; echo '<td align="center" class="G10BOLD">'.$day.'</td>'; $start_day = strtotime("+1 day", $start_day); } echo '</tr>'; $minical_time = $fake_getdate_time; $minical_month = date("m", $minical_time); $minical_year = date("Y", $minical_time); $first_of_month = $minical_year.$minical_month."01"; $start_day = strtotime(dateOfWeek($first_of_month, $week_start_day)); $i = 0; $whole_month = TRUE; $num_of_events = 0; do { $day = date ("j", $start_day); $daylink = date ("Ymd", $start_day); $check_month = date ("m", $start_day); if ($check_month != $minical_month) $day = '<font class="G10G">'.$day.'</font>'; if ($i == 0) echo "<tr>\n"; if (isset($master_array[("$daylink")]) && ($check_month == $minical_month)) { echo '<td width="22" align="center" class="G10B">'; echo '<a class="ps2" href="'.$minical_view.'.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>'; echo '</td>'; } else { echo '<td width="22" align="center" class="G10B">'; echo '<a class="psf" href="'.$minical_view.'.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>'; echo '</td>'; } $start_day = strtotime("+1 day", $start_day); $i++; if ($i == 7) { echo '</tr>'; $i = 0; $checkagain = date ("m", $start_day); if ($checkagain != $minical_month) $whole_month = FALSE; } } while ($whole_month == TRUE); ?> </table> <img src="images/spacer.gif" width="1" height="3" alt=" "><br> </td> </tr> </table> <img src="images/spacer.gif" width="1" height="10" alt=" "><br> <table width="170" border="0" cellpadding="3" cellspacing="0" class="calborder"> <tr height="20"> <td align="center" class="sideback"><font class="G10BOLD"><?php print (localizeDate ($dateFormat_month, strtotime("+1 month", strtotime($getdate)))); ?></font></td> </tr> <tr> <td bgcolor="#FFFFFF" align="center"> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"> <?php $start_day = strtotime($week_start_day); echo '<tr>'; for ($i=0; $i<7; $i++) { $day_num = date("w", $start_day); $day = $daysofweekreallyshort_lang[$day_num]; echo '<td align="center" class="G10BOLD">'.$day.'</td>'; $start_day = strtotime("+1 day", $start_day); } echo '</tr>'; $minical_time = strtotime("+1 month", $fake_getdate_time); $minical_month = date("m", $minical_time); $minical_year = date("Y", $minical_time); $first_of_month = $minical_year.$minical_month."01"; $start_day = strtotime(dateOfWeek($first_of_month, $week_start_day)); $i = 0; $whole_month = TRUE; $num_of_events = 0; do { $day = date ("j", $start_day); $daylink = date ("Ymd", $start_day); $check_month = date ("m", $start_day); if ($check_month != $minical_month) $day = '<font class="G10G">'.$day.'</font>'; if ($i == 0) echo "<tr>\n"; if (isset($master_array[("$daylink")]) && ($check_month == $minical_month)) { echo '<td width="22" align="center" class="G10B">'; echo '<a class="ps2" href="'.$minical_view.'.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>'; echo '</td>'; } else { echo '<td width="22" align="center" class="G10B">'; echo '<a class="psf" href="'.$minical_view.'.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>'; echo '</td>'; } $start_day = strtotime("+1 day", $start_day); $i++; if ($i == 7) { echo '</tr>'; $i = 0; $checkagain = date ("m", $start_day); if ($checkagain != $minical_month) $whole_month = FALSE; } } while ($whole_month == TRUE); ?> </table> <img src="images/spacer.gif" width="1" height="3" alt=" "><br> </td> </tr> </table> --- NEW FILE: todo.php --- <?php define('BASE', '../'); include (BASE.'functions/init.inc.php'); include (BASE.'functions/date_functions.php'); // Unserialize the array so that we can use it. $vtodo_array = unserialize(base64_decode($HTTP_GET_VARS['vtodo_array'])); // Set the variables from the array if (isset($vtodo_array['vtodo_text']) && ($vtodo_array['vtodo_text'] !== '') ) { $vtodo_text = $vtodo_array['vtodo_text']; } else { $vtodo_text = ''; } if (isset($vtodo_array['description']) && ($vtodo_array['description'] !== '') ) { $description = $vtodo_array['description']; } else { $description = ''; } if (isset($vtodo_array['completed_date']) && ($vtodo_array['completed_date'] !== '') ) { $completed_date = localizeDate ($dateFormat_day, strtotime($vtodo_array['completed_date'])); } if (isset($vtodo_array['status']) && ($vtodo_array['status'] !== '') ) { $status = $vtodo_array['status']; } if ((!isset($status) || $status == "COMPLETED") && isset($completed_date)) { $status = "$completed_date_lang $completed_date"; } else if ($status == "COMPLETED") { $status = $completed_lang; } else { $status = $unfinished_lang; } if (isset($vtodo_array['cal']) && ($vtodo_array['cal'] !== '') ) { $calendar_name = $vtodo_array['cal']; } else { $calendar_name = ''; } if (isset($vtodo_array['start_date']) && ($vtodo_array['start_date'] !== '') ) { $start_date = localizeDate ($dateFormat_day, strtotime($vtodo_array['start_date'])); } if (isset($vtodo_array['due_date']) && ($vtodo_array['due_date'] !== '') && strtotime($vtodo_array['due_date']) != strtotime("+1 year", strtotime($start_date))) { $due_date = localizeDate ($dateFormat_day, strtotime($vtodo_array['due_date'])); } else { $due_date = ''; } if (isset($vtodo_array['priority']) && ($vtodo_array['priority'] !== '')) { $priority = $vtodo_array['priority']; if ($priority >= 1 && $priority <= 4) { $priority = $priority_high_lang; } else if ($priority == 5) { $priority = $priority_medium_lang; } else if ($priority >= 6 && $priority <= 9) { $priority = $priority_low_lang; } else { $priority = $priority_none_lang; } } else { $priority = $priority_none_lang; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8"> <title><?php echo $calendar_name; ?></title> <link rel="stylesheet" type="text/css" href="<?php echo BASE."styles/$style_sheet/default.css"; ?>"> </head> <body bgcolor="#eeeeee"><center> <table border="0" width="430" cellspacing="0" cellpadding="0" class="calborder"> <tr> <td align="left" valign="top" width="1%" class="sideback"><img src="../images/spacer.gif" width="1" height="20" alt=" "></td> <td align="center" width="98%" class="sideback"><font class="G10BOLD"><?php echo "$calendar_name $calendar_lang"; ?></font></td> <td align="right" valign="top" width="1%" class="sideback"></td> </tr> <tr> <td colspan="3"><img src="../images/spacer.gif" width="1" height="6" alt=" "></td> </tr> <tr> <td colspan="3"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="1%"><img src="../images/spacer.gif" width="6" height="1" alt=" "></td> <td align="left" colspan="2" class="V12"><?php echo ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'<a target="_new" href="\0">\0</a>',$vtodo_text).'<br /><br />'; ?></td> </tr> <?php if ($description) { ?> <tr> <td width="1%"><img src="../images/spacer.gif" width="6" height="1" alt=" "></td> <td align="left" colspan="2" class="V12"> <?php echo ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", '<a target="_new" href="\0">\0</a>', $description); ?></td> </tr> <?php } ?> <?php if ($status) { ?> <tr> <td></td> <td align="left" colspan="2" class="V12"><?php echo "$status_lang $status"; ?></td> </tr> <?php } ?> <tr> <td></td> <td align="left" colspan="2" class="V12"><?php echo "$priority_lang $priority"; ?></td> </tr> <tr> <td></td> <td align="left" colspan="2" class="V12"><?php echo "$created_lang $start_date"; ?></td> </tr> <?php if ($due_date) { ?> <tr> <td></td> <td align="left" colspan="2" class="V12"><?php echo "$due_lang $due_date"; ?></td> </tr> <?php } ?> </table> </td> </tr> </table> </center> </body> </html> |