[EventCalendar] [PATCH 3] Big Calendar & Category Sort

Matthew Middleton mailinglists at zzxc.net
Mon Oct 15 21:10:45 UTC 2007


It looks like my patch was too big to send over this mailing list.  I will post it online:
My third patch: http://np.zzxc.net/patch3.diff (from svn head revision 271)

Differences from second patch, for a better view of what has changed (do not apply this patch): http://np.zzxc.net/do.not.apply.this.patch

Already applied version, as a zip file: http://np.zzxc.net/patch3.applied.zip



Here is my original e-mail:

Version 3 of my Big Calendar patch [was] attached.  This patch contains
 major changes from the prior version; it is more than twice the size of
 the last patch.  The largest change is to add category filtering
 support, so a calendar or event list can be generated from certain categories.
  This will allow you to have different calendars for different
 categories, rather than one unified event list.  It is applied to the head
 revision and includes Chris's style fixes.  This changes the syntax of the
 ec3_get_calendar and ec3_get_events tags, so you will need to change
 references to these if you used a prior version of this patch.  PLEASE
 NOTE THAT THIS IS ALPHA-QUALITY CODE.  UNLIKE MY PRIOR PATCHES, THIS
 PATCH ADDS LESS-THAN-FULLY-TESTED CODE.

*Category filter support for both ec3_get_calendar and ec3_get_events,
 that works with WordPress 2.2 (and below) and 2.3.
***I put the SQL queries for WP2.3's new tables, but I haven't tested
 them yet.  Thus, unless you are not afraid of testing bleeding edge
 code, don't try this patch on 2.3.  I will test this on 2.3 and fix any
 bugs later.
*Month and day support for ec3_get_calendar.
*Option in the XML feed to filter by category
*Javascript changes to support category filtering
*Some html output fixes, new class names, etc
*More comments
*Descriptions of the categories being displayed, if category filtering
 is enabled, are listed at the top of the big calendar.
*Future "front-end" features based on this backend.  (see TODO, below)

The current syntax for the template tags, subject to change, is:
ec3_get_calendar("Element_ID",calendar_type,comma_delimited_list_of_categories_to_include,month,year);
ec3_get_events(limit, comma_delimited_list_of_categories_to_include,
  the,various,template,options);
(calendar_type is 0 for a sidebar calendar, 1 for a big calendar;
comma_delimited_list_of_categories_to_include is in the form "1,2,3,4";
month is a number from 1 to 12;
year is a four digit year,
"Element_ID" is currently unused, but it should be set to a unique
 value for each instance of the function)

Examples:
 ec3_get_calendar("my_calendar",1,"3,4"); - gets the current month's
 calendar in "big calendar" form, displaying categories 3 and 4
 ec3_get_events(limit,"3,4"); - display event list for categories 3 and
 4.

The default (with no categories listed) is, of course, to display all
 categories.


TODO:
*Add interface for selecting a "calendar page" in administration tab to
 be used for links.
*Support urls such as http://blog.url/calendarpage/?m=200710&cat=4 to
 display the month's events/posts in calendar form
*Make link on small calendar link to calendar page to display large
 calendar, using URL above.
*Add category selection to widget options
*Better default CSS
*Support selecting based on tags for WP2.3, rather than just by
 category
*Rework the javascript functions, so that multiple calendars can be
 included on a page.  (See the element_id option)
**The multiple calendars bug needs to be fixed even more now that
 multiple calendars are actually useful - they might contain different
 categories.

For those who don't want to install a patch, here is a zip file:
 http://np.zzxc.net/patch3.applied.zip


Let me know of any problems/bugs/suggestions, and feel free to send
 fixes.  Again, I haven't tested this on WP2.3 yet, so let me know if you
 try it.  More features and bugfixes will be coming in future patches.

By the way, is there any chance of at least part of this patch (the big
 calendar support) getting in the 3.1.1 release?

-Matthew








More information about the EventCalendar mailing list