From: <cl...@us...> - 2004-08-08 05:55:31
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24648/functions Modified Files: ical_parser.php list_functions.php template.php Log Message: Cleaned up calendar colors and added error message for caching. Index: ical_parser.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ical_parser.php,v retrieving revision 1.175 retrieving revision 1.176 diff -C2 -d -r1.175 -r1.176 *** ical_parser.php 8 Aug 2004 01:47:17 -0000 1.175 --- ical_parser.php 8 Aug 2004 05:55:18 -0000 1.176 *************** *** 1154,1162 **** if (isset($master_array) && is_array($master_array) && $save_parsed_cals == 'yes') { $write_me = serialize($master_array); ! $fd = fopen($parsedcal, 'w'); ! fwrite($fd, $write_me); ! fclose($fd); ! touch($parsedcal, $realcal_mtime); ! //echo 'writing file'; } } --- 1154,1162 ---- if (isset($master_array) && is_array($master_array) && $save_parsed_cals == 'yes') { $write_me = serialize($master_array); ! $fd = @fopen($parsedcal, 'w'); ! if ($fd == FALSE) exit(error($lang['l_error_cache'], $filename)); ! @fwrite($fd, $write_me); ! @fclose($fd); ! @touch($parsedcal, $realcal_mtime); } } Index: list_functions.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/list_functions.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** list_functions.php 28 May 2004 16:33:48 -0000 1.8 --- list_functions.php 8 Aug 2004 05:55:18 -0000 1.9 *************** *** 12,18 **** function list_calcolors() { ! global $template, $master_array; foreach ($master_array['-3'] as $key => $val) { ! $return .= '<img src="templates/'.$template.'/images/monthdot_'.$key.'.gif" alt="" /> '.$val.'<br />'; } return $return; --- 12,21 ---- function list_calcolors() { ! global $template, $master_array, $unique_colors; ! $i = 1; foreach ($master_array['-3'] as $key => $val) { ! if ($i > $unique_colors) $i = 1; ! $return .= '<img src="templates/'.$template.'/images/monthdot_'.$i.'.gif" alt="" /> '.$val.'<br />'; ! $i++; } return $return; Index: template.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/template.php,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** template.php 24 May 2004 01:39:42 -0000 1.49 --- template.php 8 Aug 2004 05:55:18 -0000 1.50 *************** *** 117,121 **** function draw_week($template_p) { ! global $start_week_time, $template, $getdate, $cal, $master_array, $daysofweek_lang, $week_start_day, $dateFormat_week_list, $current_view, $day_array, $timeFormat, $gridLength, $timeFormat_small, $day_start; // Figure out colspans --- 117,121 ---- function draw_week($template_p) { ! global $unique_colors, $start_week_time, $template, $getdate, $cal, $master_array, $daysofweek_lang, $week_start_day, $dateFormat_week_list, $current_view, $day_array, $timeFormat, $gridLength, $timeFormat_small, $day_start; // Figure out colspans *************** *** 160,165 **** $event_calna = $allday['calname']; $event_url = $allday['url']; ! if ($event_calno < 1) $event_calno=1; ! if ($event_calno > 7) $event_calno=7; $event = openevent($event_calna, '', '', $allday, 1, 11, '', '', 'psf', $event_url); $loop_tmp = str_replace('{ALLDAY}', $event, $loop_ad); --- 160,164 ---- $event_calna = $allday['calname']; $event_url = $allday['url']; ! if ($event_calno > $unique_colors) $event_calno = ($event_calno - $unique_colors); $event = openevent($event_calna, '', '', $allday, 1, 11, '', '', 'psf', $event_url); $loop_tmp = str_replace('{ALLDAY}', $event, $loop_ad); *************** *** 318,323 **** $event_url = $this_time_arr[($event_length[$thisday][$i]['key'])]['url']; $event_status = strtolower($this_time_arr[($event_length[$thisday][$i]['key'])]['status']); ! if ($event_calno < 1) $event_calno = 1; ! if ($event_calno > 7) $event_calno = 7; if ($event_status != '') { $confirmed = '<img src="images/'.$event_status.'.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; --- 317,321 ---- $event_url = $this_time_arr[($event_length[$thisday][$i]['key'])]['url']; $event_status = strtolower($this_time_arr[($event_length[$thisday][$i]['key'])]['status']); ! if ($event_calno > $unique_colors) $event_calno = ($event_calno - $unique_colors); if ($event_status != '') { $confirmed = '<img src="images/'.$event_status.'.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; *************** *** 373,377 **** function draw_day($template_p) { ! global $template, $getdate, $cal, $master_array, $daysofweek_lang, $week_start_day, $dateFormat_week_list, $current_view, $day_array, $timeFormat, $gridLength, $day_start; // Replaces the allday events --- 371,375 ---- function draw_day($template_p) { ! global $template, $getdate, $cal, $master_array, $unique_colors, $daysofweek_lang, $week_start_day, $dateFormat_week_list, $current_view, $day_array, $timeFormat, $gridLength, $day_start; // Replaces the allday events *************** *** 384,389 **** $event_calna = $allday['calname']; $event_url = $allday['url']; ! if ($event_calno < 1) $event_calno=1; ! if ($event_calno > 7) $event_calno=7; $event = openevent($event_calna, '', '', $allday, 0, '', '', '', '', $event_url); $loop_tmp = str_replace('{ALLDAY}', $event, $loop_ad); --- 382,386 ---- $event_calna = $allday['calname']; $event_url = $allday['url']; ! if ($event_calno > $unique_colors) $event_calno = ($event_calno - $unique_colors); $event = openevent($event_calna, '', '', $allday, 0, '', '', '', '', $event_url); $loop_tmp = str_replace('{ALLDAY}', $event, $loop_ad); *************** *** 532,537 **** $event_recur = $this_time_arr[($event_length[$i]['key'])]['recur']; $event_status = strtolower($this_time_arr[($event_length[$i]['key'])]['status']); ! if ($event_calno < 1) $event_calno = 1; ! if ($event_calno > 7) $event_calno = 7; if ($event_status != '') { $confirmed = '<img src="images/'.$event_status.'.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; --- 529,533 ---- $event_recur = $this_time_arr[($event_length[$i]['key'])]['recur']; $event_status = strtolower($this_time_arr[($event_length[$i]['key'])]['status']); ! if ($event_calno > $unique_colors) $event_calno = ($event_calno - $unique_colors); if ($event_status != '') { $confirmed = '<img src="images/'.$event_status.'.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; *************** *** 707,711 **** function draw_month($template_p, $offset = '+0', $type) { ! global $template, $getdate, $master_array, $this_year, $this_month, $dateFormat_month, $week_start_day, $cal, $minical_view, $month_event_lines, $daysofweekreallyshort_lang, $daysofweekshort_lang, $daysofweek_lang, $timeFormat_small, $timeFormat; preg_match("!<\!-- loop weekday on -->(.*)<\!-- loop weekday off -->!is", $template_p, $match1); preg_match("!<\!-- loop monthdays on -->(.*)<\!-- loop monthdays off -->!is", $template_p, $match2); --- 703,707 ---- function draw_month($template_p, $offset = '+0', $type) { ! global $template, $getdate, $master_array, $this_year, $this_month, $unique_colors, $dateFormat_month, $week_start_day, $cal, $minical_view, $month_event_lines, $daysofweekreallyshort_lang, $daysofweekshort_lang, $daysofweek_lang, $timeFormat_small, $timeFormat; preg_match("!<\!-- loop weekday on -->(.*)<\!-- loop weekday off -->!is", $template_p, $match1); preg_match("!<\!-- loop monthdays on -->(.*)<\!-- loop monthdays off -->!is", $template_p, $match2); *************** *** 775,784 **** foreach ($master_array[$daylink] as $event_times) { foreach ($event_times as $val) { ! $calno = $val['calnumber']; $event_calna = $val['calname']; $event_url = $val['url']; if (!isset($val['event_start'])) { if ($type == 'large') { ! $switch['ALLDAY'] .= '<div class="V10"><img src="templates/'.$template.'/images/monthdot_'.$calno.'.gif" alt="" width="9" height="9" border="0" />'; $switch['ALLDAY'] .= openevent($event_calna, '', '', $val, $month_event_lines, 15, '', '', 'psf', $event_url); $switch['ALLDAY'] .= '</div>'; --- 771,781 ---- foreach ($master_array[$daylink] as $event_times) { foreach ($event_times as $val) { ! $event_calno = $val['calnumber']; ! if ($event_calno > $unique_colors) $event_calno = ($event_calno - $unique_colors); $event_calna = $val['calname']; $event_url = $val['url']; if (!isset($val['event_start'])) { if ($type == 'large') { ! $switch['ALLDAY'] .= '<div class="V10"><img src="templates/'.$template.'/images/monthdot_'.$event_calno.'.gif" alt="" width="9" height="9" border="0" />'; $switch['ALLDAY'] .= openevent($event_calna, '', '', $val, $month_event_lines, 15, '', '', 'psf', $event_url); $switch['ALLDAY'] .= '</div>'; *************** *** 793,797 **** $event_end = date($timeFormat, @strtotime ($event_end)); if ($type == 'large') { ! $switch['EVENT'] .= '<div class="V9"><img src="templates/'.$template.'/images/monthdot_'.$calno.'.gif" alt="" width="9" height="9" border="0" />'; $switch['EVENT'] .= openevent($event_calna, $event_start, $event_end, $val, $month_event_lines, 10, "$start2 ", '', 'ps3', $event_url).'<br />'; $switch['EVENT'] .= '</div>'; --- 790,794 ---- $event_end = date($timeFormat, @strtotime ($event_end)); if ($type == 'large') { ! $switch['EVENT'] .= '<div class="V9"><img src="templates/'.$template.'/images/monthdot_'.$event_calno.'.gif" alt="" width="9" height="9" border="0" />'; $switch['EVENT'] .= openevent($event_calna, $event_start, $event_end, $val, $month_event_lines, 10, "$start2 ", '', 'ps3', $event_url).'<br />'; $switch['EVENT'] .= '</div>'; |