aboutsummaryrefslogtreecommitdiffstats
path: root/library/ical.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-12-22 16:32:11 -0800
committerfriendica <info@friendica.com>2014-12-22 16:32:11 -0800
commit9544dffaf3ec7418a345a0ad81b8d493e609bcde (patch)
tree964ccc19f5210653d07c06a47cb1cbd27f7ac8e8 /library/ical.php
parentc85702aeb61a0d496d123c63b322b728b78ff0f7 (diff)
downloadvolse-hubzilla-9544dffaf3ec7418a345a0ad81b8d493e609bcde.tar.gz
volse-hubzilla-9544dffaf3ec7418a345a0ad81b8d493e609bcde.tar.bz2
volse-hubzilla-9544dffaf3ec7418a345a0ad81b8d493e609bcde.zip
add example to script
Diffstat (limited to 'library/ical.php')
-rw-r--r--library/ical.php60
1 files changed, 59 insertions, 1 deletions
diff --git a/library/ical.php b/library/ical.php
index d49c71460..6bb26bad8 100644
--- a/library/ical.php
+++ b/library/ical.php
@@ -15,7 +15,65 @@
* print_r( $ical->events() );
*/
-error_reporting(E_ALL);
+/**
+ * This example demonstrates how the Ics-Parser should be used.
+ *
+ * PHP Version 5
+ *
+ * @category Example
+ * @package Ics-parser
+ * @author Martin Thoma <info@martin-thoma.de>
+ * @license http://www.opensource.org/licenses/mit-license.php MIT License
+ * @version SVN: <svn_id>
+ * @link http://code.google.com/p/ics-parser/
+ * @example $ical = new ical('MyCal.ics');
+ * print_r( $ical->get_event_array() );
+
+require 'class.iCalReader.php';
+
+$ical = new ICal('MyCal.ics');
+$events = $ical->events();
+
+$date = $events[0]['DTSTART'];
+echo "The ical date: ";
+echo $date;
+echo "<br/>";
+
+echo "The Unix timestamp: ";
+echo $ical->iCalDateToUnixTimestamp($date);
+echo "<br/>";
+
+echo "The number of events: ";
+echo $ical->event_count;
+echo "<br/>";
+
+echo "The number of todos: ";
+echo $ical->todo_count;
+echo "<br/>";
+echo "<hr/><hr/>";
+
+foreach ($events as $event) {
+ echo "SUMMARY: ".$event['SUMMARY']."<br/>";
+ echo "DTSTART: ".$event['DTSTART']." - UNIX-Time: ".$ical->iCalDateToUnixTimestamp($event['DTSTART'])."<br/>";
+ echo "DTEND: ".$event['DTEND']."<br/>";
+ echo "DTSTAMP: ".$event['DTSTAMP']."<br/>";
+ echo "UID: ".$event['UID']."<br/>";
+ echo "CREATED: ".$event['CREATED']."<br/>";
+ echo "DESCRIPTION: ".$event['DESCRIPTION']."<br/>";
+ echo "LAST-MODIFIED: ".$event['LAST-MODIFIED']."<br/>";
+ echo "LOCATION: ".$event['LOCATION']."<br/>";
+ echo "SEQUENCE: ".$event['SEQUENCE']."<br/>";
+ echo "STATUS: ".$event['STATUS']."<br/>";
+ echo "TRANSP: ".$event['TRANSP']."<br/>";
+ echo "<hr/>";
+}
+
+ (end example)
+ *
+ *
+ */
+
+// error_reporting(E_ALL);
/**
* This is the iCal-class