event object get_event ( int event id )
This method returns an event object and takes an
event id as it's argument. E.g.
<?php
$e = $cal->get_event(32, "2007-1-23");
echo($e->title);
?>
The id of the event is the internal identifier and the instance is used to calculdate timezone
and DST information. Both of these would be obtained from get_event_list().
Event Class
An event object is returned by get_event. See the
method documentation for more information.
Event Variables
Event objects variables can be accessed directly. E.g.
<?php
$e = $cal->get_event(1, "2004-5-6"); echo($e->title); $e->location = "My House";
?>
string title
The title of the event.
string cal_title
The title of the calendar that this event belongs to. E.g. "Default Calendar"
string category
The event's category.
int start
The timestamp of when this event will start. E.g.
<?php
$e = $cal->get_event(18, "2008-2-4"); echo($cal->format_date("l", $e->start)); echo(" at "); echo($cal->format_date("H:i", $e->start));
?>
May print Sunday at 9:30.
See also format_date()
int end
The timestamp of when this event will end. Also see start.
int allday
1 if the event lasts all day, 2 if it is set to "Contact us for times", 0 or NULL if not. When used this may look like:
<?php
if($e->allday == 2) {
echo("Time: Contact us for times");
} else if($e->allday == 0) {
echo("Time: ". $cal->format_date("g:i a", $e->start));
}
?>
string duration
The duration of the event in the format hh:mm:ss.
Note, ignored if allday == 0. E.g.
<?php
$e = $cal->get_event(14, "2009-2-4");
if($e->allday == 0) { list($hr,$mn,$sc) = explode(":", $e->duration); echo("event will last for ". $hr ." hours and "); echo($mn ." minutes<br>\n");
}
?>
boolean repeats
True if the event repeats, false if not.
timestamp ends_at
The time that this event ends. Basically, start + duration.
string org_name
The organizer's name.
string org_email
The organizer's email address.
string url
The URL of this event.
string location
The location of the event.
string notes
The event notes.
int flag
1 if the event is flagged, 0 if it is not.
string addr_st
The street address of the event (the first line of the address).
string addr_ci
The City State, Zip of the event (the second line of the address).
string phone
The phone number of the event.
string icon
The relative URL to the icon for this event. E.g.
icons/org/flag.gif
|