From 34f353f0d7e4868171c18a5614d78f6a4b2844f7 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sun, 16 Feb 2003 20:25:21 +0000 Subject: You can now set hard paths for cookies, downloads, and webcals. Also updated footer to 0.9.1. Closed all bugs reguarding cookies, fixed back button on preferences page. --- config.inc.php | 6 +++++- functions/init.inc.php | 12 +++++++++++- includes/calendar_nav.php | 2 +- includes/footer.inc.php | 2 +- includes/sidebar.php | 2 +- preferences.php | 17 +++++++++++------ 6 files changed, 30 insertions(+), 11 deletions(-) diff --git a/config.inc.php b/config.inc.php index d5e93c5..68751cd 100644 --- a/config.inc.php +++ b/config.inc.php @@ -19,10 +19,14 @@ $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.example.com/phpicalendar'; // The HTTP URL to the PHP iCalendar directory +$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 = ''; // Leave this blank on most installs, place your full path to calendars if they are outside the phpicalendar folder. +// Advanced settings for custom installs, cookies, etc. +// In most cases these will not need to be set. +$cookie_uri = ''; // The HTTP URL to the PHP iCalendar directory, ie. http://www.example.com/phpicalendar +$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 = 'no'; // Recommended 'yes'. Saves a copy of the cal in /tmp after it's been parsed. Improves performence. diff --git a/functions/init.inc.php b/functions/init.inc.php index b1e6f65..ae9812c 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -99,7 +99,17 @@ if ($is_webcal) { } } } - $subscribe_path = 'webcal://'.$HTTP_SERVER_VARS['SERVER_NAME'].dirname($HTTP_SERVER_VARS['PHP_SELF']).'/'.$filename; + + // Sets the download and subscribe paths from the config if present. + if ($download_uri == '') { + $subscribe_path = 'webcal://'.$HTTP_SERVER_VARS['SERVER_NAME'].dirname($HTTP_SERVER_VARS['PHP_SELF']).'/'.$filename; + $download_filename = $filename; + } else { + $newurl = eregi_replace("^(http://)", "", $download_uri); + $subscribe_path = 'webcal://'.$newurl.'/'.$cal_filename.'.ics'; + $download_filename = $download_uri.'/'.$cal_filename.'.ics'; + } + } } ?> \ No newline at end of file diff --git a/includes/calendar_nav.php b/includes/calendar_nav.php index 501bae8..7598d98 100644 --- a/includes/calendar_nav.php +++ b/includes/calendar_nav.php @@ -198,7 +198,7 @@ $goyear_lang
\n $goprint_lang
\n $preferences_lang
\n - $subscribe_lang | $download_lang\n + $subscribe_lang | $download_lang\n "; ?> diff --git a/includes/footer.inc.php b/includes/footer.inc.php index c4bedac..5a6eaf4 100644 --- a/includes/footer.inc.php +++ b/includes/footer.inc.php @@ -1,6 +1,6 @@
$powered_by_lang PHP iCalendar 0.9 CVS"; +echo "

$powered_by_lang PHP iCalendar 0.9.1 CVS"; if ($enable_rss == 'yes') { echo "
\n"; if ($current_view == 'rssindex') { diff --git a/includes/sidebar.php b/includes/sidebar.php index 4fa48cc..bf1a7b6 100644 --- a/includes/sidebar.php +++ b/includes/sidebar.php @@ -39,7 +39,7 @@ $goyear_lang
\n $goprint_lang
\n $preferences_lang
\n - $subscribe_lang | $download_lang\n + $subscribe_lang | $download_lang\n "; ?> diff --git a/preferences.php b/preferences.php index ffd1e0b..1584bfc 100644 --- a/preferences.php +++ b/preferences.php @@ -1,5 +1,7 @@ @@ -71,7 +76,7 @@ if ((!isset($HTTP_COOKIE_VARS['phpicalendar'])) || ($cookie_unset)) { - +