Welcome Guest, Not a member yet? Register   Sign In
Need help with finishing touches for multi-day and multi-same-day events in Calendar please :)
#6

[eluser]bcorcoran[/eluser]
Hi,

I realize this is an old thread, but I was having the same issues myself (the fact the calendar only allows one entry per day is ridiculously short-sighted).

I managed to come up with a way to add multiple events to each day. Each event's name is displayed and is a link to whatever link is in your data array.

Copy /libraries/Calendar.php to /application/libraries/ and modify starting at line 219.

Replace
Code:
if (isset($data[$day]))
                    {    
                        // Cells with content
                        $temp = ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_content_today'] : $this->temp['cal_cell_content'];
                        $out .= str_replace('{day}', $day, str_replace('{content}', $data[$day], $temp));
                    }

With
Code:
if (isset($data[$day]))
                    {    
                        // Cells with content
                        $temp = ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_content_today'] : $this->temp['cal_cell_content'];                        
                        $out .= str_replace('{day}', $day, str_replace('{content}', '#', $temp));
                        
                        if(!empty($data[$day])) {
                            $out .= "<ul>";
                            foreach($data[$day] as $k => $v) {
                                $out .= "<li>";
                                
                                $find = array('{content}', '{day}');
                                $replace = array($v, $k);
                                
                                $out .= str_replace($find, $replace, $temp);
                                
                                $out .= "</li>";
                            }
                            $out .= "</ul>";
                        }    
                                        
                    }


Messages In This Thread
Need help with finishing touches for multi-day and multi-same-day events in Calendar please :) - by El Forum - 09-08-2010, 01:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB