PHP: Match a specific date to a recurring iCal rule - php

I need to build a simple calendar to embed in my PHP application.
Basically I have a bunch of recurrent events whose iCal recurrent rule (rrule) is known (e.g.: "FREQ=MONTHLY;INTERVAL=2;BYDAY=SU" or "FREQ=WEEKLY;BYDAY=SU").
Basically I need a function that given
_ an event iCal rrule
_ a certain day (e.g. 04/10/2011)
returns a boolean telling me whether the event is on at that date.
Obviously I can build it myself but it would take ages: is there any reliable library already available for that?
Thanks,
Dan

Although I am at the end of my own calendar project and I am not using iCal, perhaps this will help.
My own experience is that I could not find any sort of library and I coded my own backend from scratch.
For the front-end, I would urge you to use FullCalendar, it is an amazing calendar with what you can do with it. All you need to then, is concentrate on the backend.
For the db, I would go the route of having only 1 database row per event and when that event is modified, if it is recurring then you amend the existing event and create a new event with the change.
For the back-end logic, in conjunction with fullcalendar it gives you a window to work with. Within this window, I would then work out when the event occurs and then show, if the event is recurring to then work out when it should be shown on the calendar. It can get a bit complex but you can do it.
I'm attaching pics of what I have done, sadly this project isn't open source.
Add New Recurring Event
Calendar with Recurring Events
Amend Recurring Event
Agenda List View
Cheers

Related

How to create a repeating Events like google gmail in php?

I want to create repeating Events like gmail. IF any idea, Please let me know? Thanks in advance.
You can setup/install the Date module on your site. Then, in the Event content type, configure your event date field with the repeat option enabled (see screenshot in Lullabot's blog post about the date module)
Also, here are a few considerations about dates during your Event content type and views setup process:
Once you configure the date field and add event content with those fields defined, you won't be able to modify the field settings to a more restrictive state. (For example, if you enable repeat and then decide to disable repeat). A work around for this is to create a new date field with desired settings, use views bulk operations to copy the data from obsolete date field to new date field, then delete obsolete date field.)
When working with repeating or ongoing events, you'll need to determine how you want them to appear in chronological event listing views. (For example, ongoing events may wind up showing at top of list if your sort is based only on start date. If your view is limited to very few listings/results, and all your events repeat- make sure there's enough variety of events to avoid showing the same repeating event back to back in the view. You may want to consider showing only distinct results in the view.)
When working with repeating dates, do the times also repeat? If not, you may want to also install the Node Clone module and configure so content managers can copy event nodes and edit/modify times.
If showing times, do you need to show timezones associated with them?

Codeigniter event calendar

I'm building a webapp in Codeigniter version 3. I'd like to add an event calendar. Therefore I used the default Codeigniter calendar library.
I can display the calendar and even show multiple events a day.
But I also need to show events which starts a day and ends some days later. By now, I create a single event for each day, which is in the timespan. But I like to show this multi-day event in the calendar, so that the visitor can see, that this events takes multiple days. I'd like to add a colorful bar over each day, the events takes. So that there is a color bar. How can I do this?

Pulling data from MySQL into an Elgg application

I'm trying to use Elgg as a starting point for a certain type of social media website. One of the main things I'd like to do is allow users to create events and then display all the events in a sortable table (sortable by different attributes given to the event during the creation like date and title). For the event creation aspect, I'm using the plugin Event Manager.
I'm assuming the best way to do this is to pull the event data from where ever it is stored and put it into an HTML table (I'm using the jQuery TableSorter code). Can anyone give me a good idea of where and how to start doing this?
The biggest problem I'm having is finding where the event data is stored in MySQL.
For the database organisation and model, read:
http://docs.elgg.org/wiki/Engine/DataModel
http://docs.elgg.org/wiki/DatabaseSchema
For fetching the data, consider using:
http://reference.elgg.org/1.8/engine_2lib_2metadata_8php.html#aec4b6f0b9565e3554acb9b39ef34a2ac
With options order_by and order_by_metadata for chosen information.

Update MySQL Database with information from drag-and-drop event

I am using this template to build a website for a church.
The church wants a really good calendar entry point to add events.
With the calendar on the current template it's nice and simple and you can drag the events onto the corresponding date. What I need is a way to get the date where the event has been dragged onto so I can update the MySQL database.
Here is the link to the direct calendar http://usman.it/themes/charisma/calendar.html
The code for showing the calendar is just
<div id="calendar"></div>
Basically the calender is loaded through javascript.
If you take a look at the charisma.js inside the themes folder you should be able to see that the calendar will be invoked for example as follows,
$('#calendar').fullCalendar({ << some options here >> });
you can go through the documentation for the full calendar at the following site :
http://arshaw.com/fullcalendar/
I guess you want to use datepicker, see:
http://jqueryui.com/datepicker/#inline
Since you're usig draggables (jquery), you can hook into their events to collect the data: http://jqueryui.com/draggable/#events
check out the api documentation for the possiblities: http://api.jqueryui.com/draggable/

Provide an embed code of a section of a page for users to use

I have a ticketing site ( eventtickx.com...click buy tickets on the event ghana # 55(you will see the layout)). I want to generate embed code for event managers for each event they post. I want an embed code for the tickets available section only which has the information ( ticket assignment, quantity and price). so basically this is what I am trying to do ..generate an embed code for tickets available section of a page for each event to event manager that created the event. how do I go about doing this? Thanks for your help.
I'm not sure if I fully understand you, but I think you would like to provide a snippet like <iframe src="http://eventtickx.com/embed_event.php?eid=123"></iframe> to enable people to embed a little info box for a specific event on their site (like you can do with YouTube videos)?
What you would need is a script (e.g. embed_event.php) that provides the iframe content and takes one GET parameter.
This script would do the necesserary queries (getting event name, description, available tickets etc. from the database) and display them as a complete HTML page (similar to what you are doing in event_details.php).
The GET param would be typically the event ID that you could use to query your database.
The embed code could be generated as soon as you know the event ID (usually after you have inserted the dataset into you database when creating the event).

Categories