From 82e495a8c7086b1190fac1a09d39b34c369d8275 Mon Sep 17 00:00:00 2001 From: davef Date: Sat, 7 May 2005 00:22:15 +0000 Subject: SF Patch #1043823 - a modified version of the patch was applied so there wasn't a need for a new function, and it also simplified the code. Update the config text to make more sense, but we should note things in the README when we release 2.0. --- config.inc.php | 2 +- functions/template.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config.inc.php b/config.inc.php index 14f01b7..3efa9d1 100644 --- a/config.inc.php +++ b/config.inc.php @@ -61,7 +61,7 @@ $ftp_calendar_path = ''; // Only used if $auth_method='ftp'. The full path t // // You can increase the number of unique colors by adding additional images (monthdot_n.gif) // and in the css file (default.css) classes .alldaybg_n, .eventbg_n and .eventbg2_n -// Colors will rotate to double the number listed below. (That's 14 colors, 2 calendars per color). +// Colors will repeat from the beginning for calendars past $unique_colors (7 by default), with no limit. $unique_colors = '7'; $blacklisted_cals[] = ''; // Fill in between the quotes the name of the calendars diff --git a/functions/template.php b/functions/template.php index f3d3074..24b151b 100644 --- a/functions/template.php +++ b/functions/template.php @@ -273,7 +273,7 @@ class Page { $event_calno = $allday['calnumber']; $event_calna = $allday['calname']; $event_url = $allday['url']; - if ($event_calno > $unique_colors) $event_calno = ($event_calno - $unique_colors); + $event_calno = (($event_calno - 1) % $unique_colors) + 1; $event = openevent($event_calna, '', '', $allday, 1, 11, '', '', 'psf', $event_url); $loop_tmp = str_replace('{ALLDAY}', $event, $loop_ad); $loop_tmp = str_replace('{CALNO}', $event_calno, $loop_tmp); @@ -436,7 +436,7 @@ class Page { $event_calna = $this_time_arr[($event_length[$thisday][$i]['key'])]['calname']; $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); + $event_calno = (($event_calno - 1) % $unique_colors) + 1; if ($event_status != '') { $confirmed = ' '; } @@ -501,7 +501,7 @@ class Page { $event_calno = $allday['calnumber']; $event_calna = $allday['calname']; $event_url = $allday['url']; - if ($event_calno > $unique_colors) $event_calno = ($event_calno - $unique_colors); + $event_calno = (($event_calno - 1) % $unique_colors) + 1; $event = openevent($event_calna, '', '', $allday, 0, '', '', '', '', $event_url); $loop_tmp = str_replace('{ALLDAY}', $event, $loop_ad); $loop_tmp = str_replace('{CALNO}', $event_calno, $loop_tmp); @@ -650,7 +650,7 @@ class Page { $event_calno = $this_time_arr[($event_length[$i]['key'])]['calnumber']; $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); + $event_calno = (($event_calno - 1) % $unique_colors) + 1; if ($event_status != '') { $confirmed = ' '; } elseif (is_array($event_recur)) { @@ -899,7 +899,7 @@ class Page { 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_calno = (($event_calno - 1) % $unique_colors) + 1; $event_calna = $val['calname']; $event_url = $val['url']; if (!isset($val['event_start'])) { -- cgit v1.2.3