diff options
-rw-r--r-- | config.inc.php | 2 | ||||
-rw-r--r-- | 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 = '<img src="images/'.$event_status.'.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; } @@ -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 = '<img src="images/'.$event_status.'.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; } 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'])) { |