[EventCalendar] Customising ec3_get_events display
rboatright at gmail.com
Mon Dec 22 01:50:16 UTC 2008
it does matters, since 3.2 has all these spiffy neato additional functions
that 3.1.4 didn't have.
Get the current version of the EC3 plug-in.
## Query functions.
These functions all get information about the current query. They all have a
version that operates on the current Wordpress query, and another version
that takes a query parameter.
Returns TRUE if the query is an event category query.
Determines the type of listing for the query -
When $query->ec3_listing the result is A or E, depending upon the query.
## Current post/event functions.
These functions all get information about the current post or current event.
You must be inside a loop in order to use them. They all return their
result, so if you want to echo it to the page, you must call 'echo'
Returns TRUE if the current post is an event. Most of the rest of the
post/event functions are meaningless if this returns FALSE.
Get the sched_id of the current event.
Return TRUE if the current event is in the past.
Get a human-readable 'time since' the current event.
### Start/End time functions.
These all get the start or end time of the current event or current
event-post. If the current post has no events, then they return an empty
string. The end time of an event-post is the end time of the post's last
All of these functions take an optional 'date format' parameter which allows
you to customise the output format. The only difference between most of the
functions is the default date format.
These functions use Wordpress' 'time_format' setting.
These functions use Wordpress' 'date_format' setting.
function ec3_get_start_month($d='F Y')
function ec3_get_end_month($d='F Y')
These functions default to 'month year' format. E.g. 'May 2009'.
These are just shorthand for ec3_get_start_time() etc.
Comparison function for events' start times.
## Event Loop Functions
Initialise an event-loop, just for the events in the current $post.
// First a normal loop over the current query's posts.
// Now a nested loop, over the events in each post.
for($evt=ec3_iter_post_events(); $evt->valid(); $evt->next())
Initialise an event-loop, for ALL events in all posts in the query.
for($evt=ec3_iter_all_events(); $evt->valid(); $evt->next())
Resets the global $post status from $wp_query. Allows us to continue with
the main loop, after a nested loop. */
### Event Iterator class
The ec3_EventIterator class implements loops over events. Generated by
ec3_iter_post_events() or ec3_iter_all_events(). These iterators are not
independent - don't try to get smart with nested loops! This class is ready
to implement PHP5's Iterator interface.
/** Resets this iterator to the beginning. */
/** Move along to the next (possibly empty) event. */
/** Returns TRUE if this iterator points to an event. */
/** Set the current event (global $ec3->event) to match this iterator's
* index. */
/** Returns the current index. */
... Just the Javadoc style comments from here:
/** Formats the schedule for the current post.
* Returns the HTML fragment as a string. */
/** Formats the schedule for the current post as one or more 'iconlets'.
* Returns the HTML fragment as a string. */
/** Template function, for backwards compatibility.
* Call this from your template to insert the Sidebar Event Calendar. */
function ec3_get_calendar($options = false)
On Sun, Dec 21, 2008 at 7:18 PM, James Kirsop <james.kirsop at gmail.com>wrote:
> I've just downloaded the latest version of EC (3.2), not that it matters
> too much on which version I'm using, but I'm just curious to know if there's
> a simple way of customising the output of ec3_get_events() to make it look
> more pretty, with more information.
> Or, is there a way of ordering posts output by the general Wordpress loop
> in an order dictated by their event dates set in ec3?. Running the
> usual/standard wordpress loop doesn't help much, as they just appear in the
> date order that they were posted in -- which is not what I'm looking for.
> Ideally, I'd like to have pagination working, which isn't covered by
> ec3_get_events() but is covered by the WP loop.
> Blog: http://wpcal.firetree.net/
> EventCalendar at firetree.net mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the EventCalendar