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 /functions/template.php | |
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.
Diffstat (limited to 'functions/template.php')
-rw-r--r-- | functions/template.php | 10 |
1 files changed, 5 insertions, 5 deletions
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'])) { |