diff options
author | davef <davefd2@users.sourceforge.net> | 2005-05-07 00:22:15 +0000 |
---|---|---|
committer | davef <davefd2@users.sourceforge.net> | 2005-05-07 00:22:15 +0000 |
commit | 82e495a8c7086b1190fac1a09d39b34c369d8275 (patch) | |
tree | 668a1ad037648ad7db5b3cc119c165f9ad368628 | |
parent | d13cd59f474c4167d618b498560204d6a39b4d68 (diff) | |
download | phpicalendar-82e495a8c7086b1190fac1a09d39b34c369d8275.tar.gz phpicalendar-82e495a8c7086b1190fac1a09d39b34c369d8275.tar.bz2 phpicalendar-82e495a8c7086b1190fac1a09d39b34c369d8275.zip |
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.
-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'])) { |