Update for single event ical to be valid
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 2 Mar 2017 19:14:24 +0000 (14:14 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 2 Mar 2017 19:14:24 +0000 (14:14 -0500)
Needed the VCALENDAR part of the ical format.

index.php
models/front/events/icalFeed.php

index b922db5..22f479f 100644 (file)
--- a/index.php
+++ b/index.php
@@ -3,7 +3,7 @@
  * Plugin Name: GLM Members Database Events
  * Plugin URI: http://www.gaslightmedia.com/
  * Description: Gaslight Media Members Database.
- * Version: 1.6.12
+ * Version: 1.6.13
  * Author: Chuck Scott
  * Author URI: http://www.gaslightmedia.com/
  * License: GPL2
@@ -20,7 +20,7 @@
  * @package glmMembersDatabaseEventsAddOn
  * @author Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.6.12
+ * @version 1.6.13
  */
 
 /*
@@ -38,7 +38,7 @@
  *  so that we're sure the other add-ons see an up to date
  *  version from this plugin.
  */
-define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.12');
+define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.13');
 define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.1.1');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
index fe3b7e6..fb13ba0 100644 (file)
@@ -44,6 +44,17 @@ class GlmMembersFront_events_icalFeed extends GlmMembersFront_events_baseAction
             $action = 'event-list-ical';
         }
 
+        $icalHeader = <<<EOD
+\r\nBEGIN:VCALENDAR
+PRODID:-//Gaslight Media Inc//Gaslight Events Calendar v2.0//EN
+VERSION:2.0
+CALSCALE:GREGORIAN
+METHOD:PUBLISH
+EOD;
+        $icalFooter = <<<EOD
+\nEND:VCALENDAR
+EOD;
+
         $output = '';
 
         switch ($action) {
@@ -51,21 +62,12 @@ class GlmMembersFront_events_icalFeed extends GlmMembersFront_events_baseAction
             $output = $this->getEventOutput( $eventId );
             header('Content-type: text/calendar; charset=utf-8');
             header('Content-Disposition: inline; filename=event-' . $eventId . '.ics');
+            echo $icalHeader;
             echo $output;
+            echo $icalFooter;
             exit;
             break;
         case 'event-list-ical':
-        $icalHeader = <<<EOD
-\r\nBEGIN:VCALENDAR
-PRODID:-//Gaslight Media Inc//Gaslight Events Calendar v2.0//EN
-VERSION:2.0
-CALSCALE:GREGORIAN
-METHOD:PUBLISH
-EOD;
-
-        $icalFooter = <<<EOD
-\nEND:VCALENDAR
-EOD;
 
             $eventSql = "
               SELECT id