Calendar - multiple articles on the same date?

#11
[eluser]Jagar[/eluser]
I got it! and it's pretty simple ... I think

How I have it now, you can do the following
Code:
$data[$year][$month][$day][$value['event_title']] = site_url('event_detail/'.$value['event_id']);

and it will display the event in the appropriate month and year.

Just in case somebody else wants to use it:

#12
[eluser]Jagar[/eluser]
To keep everything clean, create a new php file in application/libraries and call it MY_Calendar.php and put the following the stuff in the attachment in there

#13
[eluser]Jagar[/eluser]
Sorry about multiple posts

#14
[eluser]musonic[/eluser]
Thanks Jagar for the tips. I wonder if you could help a bit further. I'm trying to populate the calendar from a database. I've got the code to retrieve the events etc. and I can loop through them to populate the arrays. However, then I get stuck. Because I've been building an array within the loop like this:

Code:
$toSend[] = array($year => array($month => array($day => array($data['start'].' - '.$data['event_title'] => site_url($data['event_id']) ))));

and then sending it to the calendar simply by assigning
Code:
$data = $toSend
outside of the loop, I end up with an autoincrementing array wrapping everything up ie
Code:
$data[$number][$year][$month][$day][$value]

Does that make sense? I need to know how to either populate the $data array so as not to get this extra layer or how to remove it before I send the data to the calendar.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.