diff options
author | Jim Hu <jimhu@users.sourceforge.net> | 2006-11-02 08:06:03 +0000 |
---|---|---|
committer | Jim Hu <jimhu@users.sourceforge.net> | 2006-11-02 08:06:03 +0000 |
commit | 09643a5841c1cec29871e0b4d1eb4d6e10108a4b (patch) | |
tree | 9bc24cf07a31141ef3f172d2b7cf4128e3859b8d | |
parent | 956548beab93780c028f79ce0c75d06093306f19 (diff) | |
download | phpicalendar-09643a5841c1cec29871e0b4d1eb4d6e10108a4b.tar.gz phpicalendar-09643a5841c1cec29871e0b4d1eb4d6e10108a4b.tar.bz2 phpicalendar-09643a5841c1cec29871e0b4d1eb4d6e10108a4b.zip |
bug fix for repeating events where first day of month is same as repeat day
-rw-r--r-- | functions/ical_parser.php | 4 | ||||
-rw-r--r-- | functions/init.inc.php | 1 | ||||
-rw-r--r-- | index.php | 7 | ||||
-rw-r--r-- | month.php | 4 |
4 files changed, 11 insertions, 5 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php index af1da64..b754d75 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -660,7 +660,7 @@ foreach ($cal_filelist as $cal_key=>$filename) { $last_day_tmp = date('t',$next_range_time); $next_range_time = strtotime(date('Y-m-'.$last_day_tmp, $next_range_time)); $last_tmp = (date('w',$next_range_time) == $on_day_num) ? '' : 'last '; - $next_date_time = strtotime($last_tmp.$on_day.' -'.$nth.' week', $next_range_time); + $next_date_time = strtotime($last_tmp.$on_day, $next_range_time) - $nth * 604800; $month = date('m', $next_date_time); if (in_array($month, $bymonth)) { $recur_data[] = $next_date_time; @@ -682,7 +682,7 @@ foreach ($cal_filelist as $cal_key=>$filename) { } } } elseif ((isset($byday_arr[1])) && ($byday_arr[1] != '-')) { - $next_date_time = strtotime($on_day.' +'.$nth.' week', $next_range_time); + $next_date_time = strtotime($on_day, $next_range_time) + $nth * 604800; $month = date('m', $next_date_time); if (in_array($month, $bymonth)) { $recur_data[] = $next_date_time; diff --git a/functions/init.inc.php b/functions/init.inc.php index 83b540e..c554f81 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -13,6 +13,7 @@ $ALL_CALENDARS_COMBINED = 'all_calendars_combined971'; // Pull in the configuration and some functions. if (!defined('BASE')) define('BASE', './'); +include_once(BASE.'default_config.inc.php'); include_once(BASE.'config.inc.php'); $cookie_name = 'phpicalendar_'.basename($default_path); @@ -1,7 +1,12 @@ <?php if (!isset($ALL_CALENDARS_COMBINED)) $ALL_CALENDARS_COMBINED = 'all_calendars_combined971'; -include "./config.inc.php"; +if (is_file("./config.inc.php")){ + include "./config.inc.php"; +}else{ + header ( "Location:./admin/new.php"); + exit; +} if (isset($_COOKIE['phpicalendar'])) { $phpicalendar = unserialize(stripslashes($_COOKIE['phpicalendar'])); $default_view = $phpicalendar['cookie_view']; @@ -56,8 +56,8 @@ $page->replace_files(array( 'header' => BASE.'templates/'.$template.'/header.tpl', 'event_js' => BASE.'functions/event.js', 'footer' => BASE.'templates/'.$template.'/footer.tpl', - 'calendar_nav' => BASE.'templates/'.$template.'/calendar_nav.tpl', - 'search_box' => BASE.'templates/'.$template.'/search_box.tpl' + 'calendar_nav' => BASE.'templates/'.$template.'/calendar_nav.tpl', + 'search_box' => BASE.'templates/'.$template.'/search_box.tpl' )); $page->replace_tags(array( |