LAST UPDATE: April 7, 2007 RSS CALENDAR 2 TEMPLATE FOR CALENDARSCRIPT DOWNLOAD SITE: http://littletonmusic.org/RssCalendar2.zip CHANGELIST: 04-06-2007 RELEASE VERSION 2.02 * Added subs to strip html from titles and description fields * Cosmetic changes to Event template * Changed Event template name to 'rssevent2.html' 03-01-2007 RELEASE CANDIDATE Ver. 2.01 * Fixed undeclared curly quotes in output (windows-1252) * Tidied up code (removed redundant asp-tags) 01-27-2007: * Improved language and 24/12 support in date/time functions. * Made $BASE_DIR change per suggestion by DanO. * Refined a few link structures. * is now a link to originating calendar, default view. 12-23-2006: * First release of RssCalendar 2 INTRO: This template (rsscalendar2.xml) will output valid RSS 2.0 feeds when called by calendar.pl It creates custom XML "on the fly," which means that multiple custom feeds can be generated from a single template. It works in two modes, Basic and Advanced Search mode. Thanks to Matt Kruse, DanO, Tuba Dave, and many others for snippets of code used throughout, and Walter for the RSS template concept. TO USE: 1) Near the top of rsscalendar2.xml find the text 'CHANGE TO MATCH YOUR INFORMATION' 2) Using a text editor, fill in all of the required information, and optional information if desired. If you don't want contact information to show in your Event display, just delete the dummy data. 3) Upload both 'rsscalendar2.xml' and 'rssevent2.html' to your default template directory. BASIC Mode works from a URL configured as such: http://yoursite.com/cgi-bin/calendar/calendar.pl?calendar=default&template=rsscalendar2.xml (example) Creates a feed with all events from the default calendar for 90 days (default duration). (Basic mode also supports the &getEvents parameters 'duration' 'range' 'startdate' 'enddate' See the Calendarscript documentation) ADVANCED Mode works from a search query such as: http://yoursite.com/cgi-bin/calendar/calendar.pl?calendar=default&template=rsscalendar2.xml&command=search&FIELD_title=Public+Event&duration=60 (example) * Note that the 'search' command must be all lower case Creates a filtered feed with only those items containing 'Public Event' in their title for the next 60 days. Advanced mode works in conjunction with DanO's SearchLink plugin from http://www.much2.com/calendarscript/index.html You should have this plugin installed, enabled, and be familiar with its search function before using Advanced mode. If using Searchlink with MetaCalendar use the patched 'display_before_search.pl' It is also highly recommended that you have the "Split Recurring Events" plugin installed so as to display all recurring events for the search duration. (Currently there is a $10 donation to download the "Split Recurring Events" plugin. I have no connection with it other than as a paying user, and I receive no benefit from its sales) FEATURES (Both Modes): MetaCalendar friendly Works with multiple calendars using a single .xml template Event view automatically sports your calendar's colors and name Completely redesigned date/time scheme is very fast and fully RFC822 compliant Passes day names (or abbreviations) to Event view Passes your contact information and time of last update One Event view template (rssevent.html) works with multiple .xml templates (just rename them) Best of all, it's free WORKING EXAMPLES: Basic Mode: http://littletonmusic.org/cgi-bin/calendar/calendar.pl?calendar=default&template=rsscalendar2.xml Advanced Search Mode: http://littletonmusic.org/cgi-bin/calendar/calendar.pl?calendar=default&template=rsscalendar2.xml&command=search&FIELD_event_type=Ballroom+Dancing&duration=185 (Displays only 'Ballroom Dancing' events for the next 185 days). *Try replacing calendar=default with calendar=meta in one of the above examples to test functionality. The Event display should be the same because it calls the event from the originating calendar. KNOWN ISSUES: 1) Currently the output is encoded text/html which may not work in a few readers. To fix this, open calendar.pl in a text editor: FIND: unless ($no_header) { print "Content-type: text/html\n\n"; } REPLACE WITH: unless ($no_header) { if ($in{'template'} =~ m/.xml$/) { print "Content-type: application/xml\n\n"; } else { print "Content-type: text/html\n\n"; }} Usually not necessary, but there if you need it or if you like squeaky-clean output like I do. RSS NOTES: 1) Keep any data fields containing ' " & < > \ between [CDATA[]] tags. 2) Your channel image must be no more than 144 pixels in width. 3) No HTML allowed in XML fields. 4) Avoid using html entities such as '•' or '·' They won't parse correctly in all readers. 5) Don't paste email content directly into calendar input fields. You may get weird characters in the output. 6) Some personal pages (My Yahoo!) limit outbound item links to 256 characters. Keep this in mind if you are customizing $qstring 7) Be sure to test your feed at www.feedvalidator.org DISCLAIMER: The author assumes no risk or liability whatsoever from the use of this software by others. It is provided freely and without any support. I will check the Calendarscript forums from time to time to see how it's going.