aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2009-01-04 21:58:18 +0000
committerJim Hu <jimhu@users.sourceforge.net>2009-01-04 21:58:18 +0000
commit2434deaf0d0dc46a0deebd523f5bb2c3204bbc9a (patch)
tree5285bf95ff4f09924561e9a386bcdeba13dc88bb
parentd1ce09300e099269e6c0e784cf42c262a40036b9 (diff)
downloadphpicalendar-2434deaf0d0dc46a0deebd523f5bb2c3204bbc9a.zip
phpicalendar-2434deaf0d0dc46a0deebd523f5bb2c3204bbc9a.tar.gz
phpicalendar-2434deaf0d0dc46a0deebd523f5bb2c3204bbc9a.tar.bz2
working on rss fixes
-rw-r--r--functions/ical_parser.php1
-rw-r--r--functions/init.inc.php20
-rw-r--r--functions/init/configs.php17
-rw-r--r--preferences.php9
-rw-r--r--rss/rss_common.php3
5 files changed, 21 insertions, 29 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index aaaba93..6f48813 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -151,6 +151,7 @@ foreach ($cal_filelist as $cal_key=>$filename) {
$type = '';
$other = '';
$wkst = 'MO';
+ $vtodo_categories = '';
$except_dates = array();
$except_times = array();
diff --git a/functions/init.inc.php b/functions/init.inc.php
index 8ca11f6..f0cc213 100644
--- a/functions/init.inc.php
+++ b/functions/init.inc.php
@@ -34,7 +34,7 @@ if (ini_get('max_execution_time') < 60) {
// Pull the calendars off the GET line if provided. The $cal_filename
// is always an array, because this makes it easier to deal with below.
$cal_filenames = array();
-if (isset($_GET['cal'])) {
+if (isset($_GET['cal']) && $_GET['cal'] !='') {
// If the cal value is not an array, split it into an array on
// commas.
if (!is_array($_GET['cal']))
@@ -42,22 +42,10 @@ if (isset($_GET['cal'])) {
// Grab the calendar filenames off the cal value array.
$cal_filenames = $_GET['cal'];
+} elseif ($phpiCal_config->default_cal != '') {
+ $cal_filenames = explode(',',$phpiCal_config->default_cal);
} else {
- if (isset($default_cal_check)) {
- if ($default_cal_check != $phpiCal_config->ALL_CALENDARS_COMBINED) {
- $calcheck = $phpiCal_config->calendar_path.'/'.$default_cal_check.'.ics';
- $calcheckopen = @fopen($calcheck, "r");
- if ($calcheckopen == FALSE) {
- $cal_filenames = explode(',',$default_cal);
- } else {
- $cal_filenames[0] = $default_cal_check;
- }
- } else {
- $cal_filenames[0] = $phpiCal_config->ALL_CALENDARS_COMBINED;
- }
- } else {
- $cal_filenames = explode(',',$phpiCal_config->default_cal);
- }
+ $cal_filenames[0] = $phpiCal_config->ALL_CALENDARS_COMBINED;
}
//load cal_filenames if $ALL_CALENDARS_COMBINED
diff --git a/functions/init/configs.php b/functions/init/configs.php
index 1a553af..d441168 100644
--- a/functions/init/configs.php
+++ b/functions/init/configs.php
@@ -29,10 +29,10 @@ if ($phpiCal_config->cookie_uri == '') {
if ($phpiCal_config->cookie_uri == 'localhost') $phpiCal_config->setProperty('cookie_uri', '');
}
$cookie_name = 'phpicalendar_'.basename($phpiCal_config->default_path);
-if (isset($_COOKIE[$cookie_name]) && !isset($_POST['unset'])) {
+if (isset($_COOKIE[$cookie_name]) && !isset($_POST['unset']) && $current_view != 'rss') {
$phpicalendar = unserialize(stripslashes($_COOKIE[$cookie_name]));
if (isset($phpicalendar['cookie_language'])) $phpiCal_config->setProperty('language', $phpicalendar['cookie_language']);
- if (isset($phpicalendar['cookie_calendar'])) $phpiCal_config->setProperty('default_cal_check', $phpicalendar['cookie_calendar']);
+ if (isset($phpicalendar['cookie_calendar'])) $phpiCal_config->setProperty('default_cal', $phpicalendar['cookie_calendar']);
if (isset($phpicalendar['cookie_cpath']) && strpos($phpicalendar['cookie_cpath'],'../') === false) $phpiCal_config->setProperty('default_cpath_check', $phpicalendar['cookie_cpath']);
if (isset($phpicalendar['cookie_view'])) $phpiCal_config->setProperty('default_view', $phpicalendar['cookie_view']);
if (isset($phpicalendar['cookie_style']) && is_dir(BASE.'templates/'.$phpicalendar['cookie_style'].'/')){
@@ -40,7 +40,7 @@ if (isset($_COOKIE[$cookie_name]) && !isset($_POST['unset'])) {
}
if (isset($phpicalendar['cookie_startday'])) $phpiCal_config->setProperty('week_start_day', $phpicalendar['cookie_startday']);
if (isset($phpicalendar['cookie_time'])) $phpiCal_config->setProperty('day_start', $phpicalendar['cookie_time']);
- if (isset($phpicalendar['cookie_endtime'])) $phpiCal_config->setProperty('day_end', $phpicalendar['cookie_endtime']);
+ if (isset($phpicalendar['cookie_endtime'])) $phpiCal_config->setProperty('day_end', $phpicalendar['cookie_endtime']);
if (isset($phpicalendar['cookie_timezone'])) $phpiCal_config->setProperty('timezone', $phpicalendar['cookie_timezone']);
}
@@ -74,6 +74,7 @@ $template = $phpiCal_config->template;
$fillTime = $phpiCal_config->day_start;
$day_array = array ();
+
while ($fillTime < $phpiCal_config->day_end) {
array_push ($day_array, $fillTime);
preg_match ('/([0-9]{2})([0-9]{2})/', $fillTime, $dTime);
@@ -90,9 +91,9 @@ while ($fillTime < $phpiCal_config->day_end) {
if (!isset($current_view)) $current_view = $phpiCal_config->default_view;
$tz_array=array();
-/*echo "<pre>xx";
-print_r($configs);
-print_r($phpiCal_config);
-echo "</pre>";
+#echo "<pre>xx";
+#print_r($configs);
+#print_r($phpicalendar);
+#print_r($phpiCal_config);
+#echo "</pre>";
#die;
-*/ \ No newline at end of file
diff --git a/preferences.php b/preferences.php
index 73a9624..ad7e015 100644
--- a/preferences.php
+++ b/preferences.php
@@ -45,8 +45,8 @@ if ($action == 'setcookie') {
"cookie_cpath" => "$cookie_cpath",
"cookie_timezone" => "$cookie_timezone"
);
- $the_cookie = serialize($the_cookie);
- if ($cookie_unset) {
+ $the_cookie = addslashes(serialize($the_cookie));
+ if (isset($cookie_unset)) {
setcookie("$cookie_name","$the_cookie",time()-(60*60*24*7) ,"/","$phpiCal_config->cookie_uri",0);
} else {
setcookie("$cookie_name","$the_cookie",time()+(60*60*24*7*12*10) ,"/","$phpiCal_config->cookie_uri",0);
@@ -78,7 +78,7 @@ if (isset($_COOKIE[$cookie_name])) {
}
}
-if ((!isset($_COOKIE[$cookie_name])) || ($cookie_unset)) {
+if ((!isset($_COOKIE[$cookie_name])) || isset($cookie_unset)) {
# No cookie set -> use defaults from config file.
$cookie_language = ucfirst($language);
$cookie_calendar = $phpiCal_config->default_cal;
@@ -146,6 +146,8 @@ for ($i = 000; $i <= 2400; $i += 100) {
}
$endtime_select .= ">$s</option>\n";
}
+
+$timeformat_select = '';
$timeformat_arr = array(
'g:i',
'h:i',
@@ -155,7 +157,6 @@ $timeformat_arr = array(
'H:i',
);
$example_time = strtotime("19700101 08:00:00");
-$timeformat_select = '';
foreach ($timeformat_arr as $i => $s) {
$s = date($timeformat_arr[$i], $example_time)."/".date($timeformat_arr[$i], ($example_time + 12*60*60));
$timeformat_select .= '<option value="'.$timeformat_arr[$i].'"';
diff --git a/rss/rss_common.php b/rss/rss_common.php
index 0e94b09..71f415e 100644
--- a/rss/rss_common.php
+++ b/rss/rss_common.php
@@ -32,7 +32,8 @@ include_once(BASE.'functions/date_functions.php');
//set the range of days to return based on the view chosen
-$rssview = $_GET['rssview'];
+$rssview = $phpiCal_config->default_view;
+if (isset($_GET['rssview'])) $rssview = $_GET['rssview'];
if (isset($_GET['getdate']) && $_GET['getdate'] !=''){
$getdate = $_GET['getdate'];
}else{

© 2014-2020 Faster IT GmbH | imprint | privacy policy