Calendar Parser Realm

Log In

Main Page

Code Page

Supybot Plugins

ICal PHP Interface Page

ICal PHP Interface is a parser for ICS format calendar files. I hope to develop a clean and more friendly interface for ICAL that handle the RRULES returning dates for recurring events. I am making this public in hopes of it being useful to others.

Currently, I believe that I have most of the common sense RRULES implemented, though they have not been thouroughly tested. The code is seperated into Parse, File, and Recur files. Please, let me know what does not parse correctly and I will attempt to get that parsing properly.

Files: Get ICal PHP Interface-0.23 | Get ICal PHP Interface-0.24

This page has been viewed 2016 times.

Current Features

Prior Changes


A Sample Frontend

<?php
/** CONFIG SECTION **/
define("ICS_DEBUG",FALSE);
define("ICS_CACHE","./cache");
define("ICS_MAXAGE",3600);
$url = "http://www.google.com/calendar/ical/sb5eieqs8f9hi3rra3147l6tdg@group.calendar.google.com/public/basic.ics";
/** PROGRAM SECTION **/
include ('ICS_Parse.php');
if (!file_exists(ICS_CACHE)) {
    @mkdir(ICS_CACHE,0755) or 
        die ("Cannot write to ".ICS_CACHE.".");
}
$now=mktime(); $then=$now+(3*(86400*31));
$now_arr=getdate($now);
$now=strtotime($now_arr['month']." 1, ".$$now_arr['year']);
$icsobject = new ICS_FiletoArray($url);
ICS_ParseParse($icsobject,$now,$then,$eventlist,$sortlist);
array_multisort($sortlist, SORT_ASC, $eventlist);
foreach ($eventlist as $event){
    if (strtotime($event['DTSTART'])>$now&&
        strtotime($event['DTSTART'])<$then){
        $date = strftime("%a, %b %d, %Y @ %r",
            strtotime($event['DTSTART']));
        echo "<h3>".$date." - ".$event['SUMMARY']."</h3>".
             "<p>".$event['LOCATION']."<br>".
             $event['DESCRIPTION']."</p>";
    }
}
?>

Send your feedback for this project.

This form will publish your feedback for all to view on this feedback page. You may prefer to email tjaustinbardo AT gmail DOT com for more private feedback. Your feedback is imporant to continued development of this project.

Subject:

From:

Feedback:

Enter Code
Creative Commons License

modified: October 16, 2008, at 01:26 PM