• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need some help converting this class to CI's Calendar class :( willing to pay.

#1
[eluser]Kinsbane[/eluser]
So I have a class that was built for our events - to display them a certain way in a table-based calendar.

Example (with outlines for table cells):
Events Calendar

Now, the major major problem we have using this sytem is that it isn't based on a unique ID - we constantly have issues where ID's and names of Events overlap, causing data issues like disappearing events, or events that happen to reference an older event with the same name's data, and things like that. It's a horrible way of going about things, and we need it fixed. I know CI has the Calendaring class, but it seems limited out-of-the-box for what I need, so I'm hoping we can hack together something as a plugin or a lib and let anyone be able to use it.

If you look at the link above, you'll notice that a bunch of events span multiple days - some even go across weekends (Sat and Sun). You'll also see that the class I'm having trouble with somehow manages to know how to add blank spaces within a day to make room for other events - something I haven't been able to find. Also, the colored boxes are all clickable links which take the user to the event in question.

I would like very much to keep this same functionality and system, as people here have gotten very used to being able to see a specific color span a certain number of days in the month, and then find those days in the color key below the calendar.

The way the system works is this:
We run a mySQL query for all events (even though we should only be getting events for the current month). Looping through each event, the add_event() function is called and those events are assigned to an array in the class, like so:
Code:
if($data['event_date'] > $month_start and $data['event_date'] < $month_end) {
            $cal->add_event($data['event_title'], $data['event_date'], $data['event_length'], "$my_page_url?op=view&id;={$data['event_id']}");
        }

Next, we call the display() function and give it the current month and year and the starting day of the month (in this case, 1) - like so:
Code:
$cal->display(mktime(0,0,0,$month,1,$year));

The data flow from here is easy to follow:
1. Display is called, and the outlying table is setup, which includes the topline containing the month name and prev/next links
2. Header line is setup, which contains the names of the weekdays
3. We while () loop from beginning of month's date to end of month's date, and then call the display_week() function
4. Inside the display_week() function, the get_events_in_week() function is called which brings up those events whose starting dates fall after the beginning of the week's date but before the end of the week's date
5. Once those are brought up, the display_day() function is called
6. display_day() function is called, and this is where I get lost as I can't quite determine how the system makes allowances for the other events around those in a particular day that it needs to add whitespace for

I know a good complement to the Calendaring class would be a sort of events deal, but I don't need this to be an all-out program - I only need this display events for whatever month the user picks, and that's that. All of the event data input and management will be held elsewhere in its own controller.

I am willing to pay a fair, low price for help with this - even though I have to pay for my own wedding. It's just I have been struggling with this for a while and have nothing to show for it. I'd like to be able to get something useable out to the CI community from this if possible.

Is anyone willing to help? Sad


Messages In This Thread
I need some help converting this class to CI's Calendar class :( willing to pay. - by El Forum - 04-03-2008, 05:57 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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