From afe581186d6bd59ea42e5dfa3ce47ab6705b9409 Mon Sep 17 00:00:00 2001 From: Wesley Miaw Date: Sat, 20 Sep 2003 00:16:05 +0000 Subject: Set magic string $ALL_CALENDARS_COMBINED = 'all_calendars_combined971'. All previous references to 'all_calendars_combined971' now point at $ALL_CALENDARS_COMBINED. Uncommented closing form tag on sidebar.php, and set correct spacing for the entire sidebar. --- config.inc.php | 8 ++++---- functions/ical_parser.php | 6 +++--- functions/init.inc.php | 7 ++++--- functions/list_icals.php | 6 +++--- includes/calendar_nav.php | 4 ++-- includes/event.php | 4 ++-- includes/sidebar.php | 31 ++++++++++++++++--------------- 7 files changed, 34 insertions(+), 32 deletions(-) diff --git a/config.inc.php b/config.inc.php index d17dc0f..1308acf 100644 --- a/config.inc.php +++ b/config.inc.php @@ -19,9 +19,9 @@ $tomorrows_events_lines = '1'; // Number of lines to wrap each event title in $allday_week_lines = '1'; // Number of lines to wrap each event title in all-day events in week view, 0 means display all lines. $week_events_lines = '1'; // Number of lines to wrap each event title in the 'Tommorrow's events' box, 0 means display all lines. $timezone = ''; // Set timezone. Read TIMEZONES file for more information -$default_path = 'http://www.wesman.net/~wesley/phpicalendar'; // The HTTP URL to the PHP iCalendar directory, ie. http://www.example.com/phpicalendar +$default_path = 'http://www.example.com/phpicalendar'; // The HTTP URL to the PHP iCalendar directory, ie. http://www.example.com/phpicalendar $tmp_dir = '/tmp'; // The temporary directory on your system (/tmp is fine for UNIXes including Mac OS X) -$calendar_path = '/home/wesley/Library/Calendars'; // Leave this blank on most installs, place your full path to calendars if they are outside the phpicalendar folder. +$calendar_path = ''; // Leave this blank on most installs, place your full path to calendars if they are outside the phpicalendar folder. $second_offset = '0'; // The time in seconds between your time and your server's time. // Advanced settings for custom installs, cookies, etc. @@ -30,7 +30,7 @@ $cookie_uri = ''; // The HTTP URL to the PHP iCalendar directory, ie. htt $download_uri = ''; // The HTTP URL to your calendars directory, ie. http://www.example.com/phpicalendar/calendars // Yes/No questions --- 'yes' means Yes, anything else means no. 'yes' must be lowercase. -$save_parsed_cals = 'yes'; // Recommended 'yes'. Saves a copy of the cal in /tmp after it's been parsed. Improves performence. +$save_parsed_cals = 'no'; // Recommended 'yes'. Saves a copy of the cal in /tmp after it's been parsed. Improves performence. $use_sessions = 'no'; // This has not yet been implemented. $display_custom_goto = 'no'; // In the 'Jump To' box, display the custom 'go to day' box. $display_ical_list = 'yes'; // In the 'Jump To' box, display the pop-up menu with the list of all calendars in the $calendar_path directory. @@ -43,7 +43,7 @@ $show_search = 'no'; // Show the search box in the sidebar. $allow_preferences = 'yes'; // Allow visitors to change various preferences via cookies. $printview_default = 'no'; // Set print view as the default view. day, week, and month only supported views for $default_view (listed well above). $show_todos = 'yes'; // Show your todo list on the side of day and week view. -$show_completed = 'no'; // Show completed todos on your todo list. +$show_completed = 'yes'; // Show completed todos on your todo list. // Administration settings $allow_admin = 'no'; // Set to yes to allow the admin page - remember to change the default password if using 'internal' as the $auth_method diff --git a/functions/ical_parser.php b/functions/ical_parser.php index 2a32b94..4798685 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -31,7 +31,7 @@ $this_year = $day_array2[1]; // reading the file if it's allowed $parse_file = true; -if (($is_webcal == false) && ($save_parsed_cals == 'yes') && ($cal != 'all_calenders_combined971')) { +if (($is_webcal == false) && ($save_parsed_cals == 'yes') && ($cal != $ALL_CALENDARS_COMBINED)) { $realcal_mtime = filemtime($filename); $parsedcal = $tmp_dir.'/parsedcal-'.$cal_filename.'-'.$this_year; if (file_exists($parsedcal)) { @@ -967,7 +967,7 @@ if ($parse_file) { } // write the new master array to the file - if (isset($master_array) && is_array($master_array) && $save_parsed_cals == 'yes' && $is_webcal == FALSE && $cal != 'all_calenders_combined971') { + if (isset($master_array) && is_array($master_array) && $save_parsed_cals == 'yes' && $is_webcal == FALSE && $cal != $ALL_CALENDARS_COMBINED) { $write_me = serialize($master_array); $fd = fopen($parsedcal, 'w'); fwrite($fd, $write_me); @@ -989,7 +989,7 @@ if ($parse_file) { //print ''; // Set a calender name for all calenders combined -if ($cal == 'all_calenders_combined971') { +if ($cal == $ALL_CALENDARS_COMBINED) { $calendar_name = $all_cal_comb_lang; } diff --git a/functions/init.inc.php b/functions/init.inc.php index 669b716..2d4517c 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -8,6 +8,7 @@ // uncomment when developing, comment for shipping version //error_reporting (E_ALL); +$ALL_CALENDARS_COMBINED = 'all_calendars_combined971'; if (!defined('BASE')) define('BASE', './'); include(BASE.'config.inc.php'); include(BASE.'functions/error.php'); @@ -54,7 +55,7 @@ if (isset($HTTP_GET_VARS['cal']) && $HTTP_GET_VARS['cal'] != '') { $cal_filename = urldecode($HTTP_GET_VARS['cal']); } else { if (isset($default_cal_check)) { - if ($default_cal_check != 'all_calenders_combined971') { + if ($default_cal_check != $ALL_CALENDARS_COMBINED) { $calcheck = $calendar_path.'/'.$default_cal_check.'.ics'; $calcheckopen = @fopen($calcheck, "r"); if ($calcheckopen == FALSE) { @@ -63,7 +64,7 @@ if (isset($HTTP_GET_VARS['cal']) && $HTTP_GET_VARS['cal'] != '') { $cal_filename = $default_cal_check; } } else { - $cal_filename = 'all_calenders_combined971'; + $cal_filename = $ALL_CALENDARS_COMBINED; } } else { $cal_filename = $default_cal; @@ -98,7 +99,7 @@ if ($is_webcal) { if (!isset($filename)) { // empty the filelist array $cal_filelist = array(); - if ($cal == 'all_calenders_combined971') { // Create an array with the paths to all files to be combined + if ($cal == $ALL_CALENDARS_COMBINED) { // Create an array with the paths to all files to be combined // Note: code here is similar to code in list_icals.php // open directory $dir_handle = @opendir($calendar_path) or die(error(sprintf($error_path_lang, $calendar_path), $cal_filename)); diff --git a/functions/list_icals.php b/functions/list_icals.php index 904b74a..43b476a 100644 --- a/functions/list_icals.php +++ b/functions/list_icals.php @@ -38,10 +38,10 @@ if ($display_ical_list == "yes") { } // option to open all (non-web) calenders together - if ($cal == 'all_calenders_combined971') { - print ""; + if ($cal == $ALL_CALENDARS_COMBINED) { + print ""; } else { - print ""; + print ""; } foreach($list_webcals as $cal_tmp) { diff --git a/includes/calendar_nav.php b/includes/calendar_nav.php index d5fbf56..f51cf2d 100644 --- a/includes/calendar_nav.php +++ b/includes/calendar_nav.php @@ -1,6 +1,6 @@ $goyear_lang
\n"; echo "$goprint_lang
\n"; if ($allow_preferences != 'no') echo "$preferences_lang
\n"; - if ($cal != 'all_calenders_combined971') echo "$subscribe_lang | $download_lang\n"; + if ($cal != $ALL_CALENDARS_COMBINED) echo "$subscribe_lang | $download_lang\n"; ?> diff --git a/includes/event.php b/includes/event.php index 45f262e..14de99b 100644 --- a/includes/event.php +++ b/includes/event.php @@ -79,7 +79,7 @@ $calendar_name2 = str_replace('\\', '', $calendar_name2); <?php - if ($calendar_name == 'all_calenders_combined971') { + if ($calendar_name == $ALL_CALENDARS_COMBINED) { echo "$all_cal_comb_lang"; } else { echo "$calendar_name2"; @@ -92,7 +92,7 @@ $calendar_name2 = str_replace('\\', '', $calendar_name2); <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_calenders_combined971') { + if ($calendar_name == $ALL_CALENDARS_COMBINED) { echo "$all_cal_comb_lang"; } else { echo "$calendar_name2 $calendar_lang"; diff --git a/includes/sidebar.php b/includes/sidebar.php index 871991a..938754e 100644 --- a/includes/sidebar.php +++ b/includes/sidebar.php @@ -3,7 +3,7 @@ $really_unix_time = strtotime(date('Ymd')); $really_today_today = date ('Ymd', $really_unix_time); - if ($cal == 'all_calenders_combined971') { + if ($cal == $ALL_CALENDARS_COMBINED) { $cal_displayname2 = $all_cal_comb_lang; } else { $cal_displayname2 = $calendar_name . " $calendar_lang"; @@ -16,7 +16,7 @@ $search_box = '<form 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>'; ?> - + <form action="" method="GET"> <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> @@ -35,13 +35,14 @@ 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_calenders_combined971') echo "<a class=\"psf\" href=\"$subscribe_path\">$subscribe_lang</a> | <a class=\"psf\" href=\"$download_filename\">$download_lang</a>\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> + </form> + <form action="day.php" method="GET"> <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> @@ -51,12 +52,11 @@ <?php echo '<div style="padding: 5px;">'; - echo "<form action=\"day.php\" method=\"GET\"><select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value+'$query');\">"; + 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; } @@ -72,10 +72,10 @@ </td> </tr> </table> - <img src="images/spacer.gif" width="1" height="10" alt=" "><br> + </form> <?php if (isset($master_array[($tomorrows_date)]) && sizeof($master_array[($tomorrows_date)]) > 0) { ?> - + <form action="" method="GET"> <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> @@ -133,11 +133,11 @@ <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> + </form> <?php } if ((isset($master_array['-2'])) && ($show_todos == 'yes')) { ?> - + <form action="" method="GET"> <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> @@ -210,12 +210,11 @@ <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> + </form> <?php } $fake_getdate_time = strtotime($this_year.'-'.$this_month.'-15'); ?> - + <form action="" method="GET"> <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> @@ -270,7 +269,8 @@ </td> </tr> </table> - <img src="images/spacer.gif" width="1" height="10" alt=" "><br> + </form> + <form action="" method="GET"> <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> @@ -325,7 +325,8 @@ </td> </tr> </table> - <img src="images/spacer.gif" width="1" height="10" alt=" "><br> + </form> + <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> -- cgit v1.2.3