Adding Categories to customRssFeed
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 18 Jul 2019 17:44:22 +0000 (13:44 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 18 Jul 2019 17:44:22 +0000 (13:44 -0400)
Requested by VisitWidget

index.php
models/front/events/customRssFeed.php
readme.txt
views/front/events/customRssFeed.xml

index ebcc223..606ff03 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -3,7 +3,7 @@
  * Plugin Name: GLM Associate - Events Add-On
  * Plugin URI: http://www.gaslightmedia.com/
  * Description: Gaslight Media Members Database.
- * Version: 1.7.29
+ * Version: 1.7.30
  * Author: Chuck Scott
  * Author URI: http://www.gaslightmedia.com/
  * License: GPL2
@@ -19,7 +19,7 @@
  * @package glmMembersDatabaseEventsAddOn
  * @author Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.7.29
+ * @version 1.7.30
  */
 
 // Check that we're being called by WordPress.
@@ -43,7 +43,7 @@ if (!defined('ABSPATH')) {
  *  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.7.29');
+define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.7.30');
 /**
  * Plugin DB Version
  */
index cf17fde..954903e 100644 (file)
@@ -36,7 +36,6 @@ class GlmMembersFront_events_customRssFeed extends GlmMembersFront_events_baseAc
         $this->dateRange = "start_time >= '{$fromDate}'";
 
         $output = '';
-        header("Content-Type: application/xml\n");
 
         $this->postAddLocations = true;
         $events = $this->getModelEventsData();
@@ -63,6 +62,7 @@ class GlmMembersFront_events_customRssFeed extends GlmMembersFront_events_baseAc
 
         // Generate output from model data and view
         $output = $smarty->template->fetch($viewFile);
+        header("Content-Type: application/xml\n");
         echo $output;
         exit;
     }
index 5588af8..f8e1e63 100755 (executable)
@@ -25,6 +25,9 @@ e.g.
 1. Activate the plugin through the 'Plugins' menu in WordPress
 
 == Changelog ==
+= 1.7.30 =
+* Adding Categories for each event into the customRssFeed
+
 = 1.7.29 =
 New options
 * Read more button options
index 1c0203b..4426c89 100644 (file)
         {/if}
         <description><![CDATA[{$item.intro|strip_tags}]]></description>
         <fulltext><![CDATA[{$item.descr|strip_tags}]]></fulltext>
-        {if $item.hide_address.name == 'No'}
-            {if $item.locations}
-                <location>
-                    {if $item.locations.name}{$item.locations.name}{/if}
-                    {if $item.locations.address} {$item.locations.address} {/if}
-                    {if $item.locations.city.name}{$item.locations.city.name}{/if}{if $item.locations.state.value}, {$item.locations.state.value} {/if}
-                    {if $item.locations.zip} {$item.locations.zip} {/if}
-                </location>
-            {/if}
-            {if $item.member && $item.use_member_location}
-                <location>
-                    {if $item.member.member} {$item.member.member} {/if}
-                    {if $item.member.addr1} {$item.member.addr1} {/if}
-                    {if $item.member.city}{$item.member.city}{/if}{if $item.member.state.value}, {$item.member.state.value}{/if}
-                    {if $item.member.zip} {$item.member.zip} {/if}
-                </location>
-            {/if}
-        {/if}
+{if $item.hide_address.name == 'No'}
+    {if $item.locations}
+        <location>
+            {if $item.locations.name}{$item.locations.name}{/if}
+            {if $item.locations.address} {$item.locations.address} {/if}
+            {if $item.locations.city.name}{$item.locations.city.name}{/if}{if $item.locations.state.value}, {$item.locations.state.value} {/if}
+            {if $item.locations.zip} {$item.locations.zip} {/if}
+        </location>
+    {/if}
+    {if $item.member && $item.use_member_location}
+        <location>
+            {if $item.member.member} {$item.member.member} {/if}
+            {if $item.member.addr1} {$item.member.addr1} {/if}
+            {if $item.member.city}{$item.member.city}{/if}{if $item.member.state.value}, {$item.member.state.value}{/if}
+            {if $item.member.zip} {$item.member.zip} {/if}
+        </location>
+    {/if}
+{/if}
         <startdatetime>{$item.starting_timestamp|date_format:"%Y-%m-%dT%T"}</startdatetime>
         <enddatetime>{$item.ending_timestamp|date_format:"%Y-%m-%dT%T"}</enddatetime>
+{if $item.categories}
+    {foreach $item.categories as $cat}
+        <category><![CDATA[{$cat.name}]]></category>
+    {/foreach}
+{/if}
         <guid>{$item.id}</guid>
     </item>
     {/foreach}