Adding slideshow feature/slideshow
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 3 May 2016 16:08:07 +0000 (12:08 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 3 May 2016 16:08:07 +0000 (12:08 -0400)
getting the events with slideshow flag

models/front/events/baseAction.php
models/front/events/list.php

index 21304c9..1f41948 100644 (file)
@@ -124,6 +124,24 @@ abstract class GlmMembersFront_events_baseAction extends GlmDataEvents
         return $events;
     }
 
+    public function getModelSlideShowEventsData()
+    {
+        $this->postAddTimes = true;
+        $where = "T.slideshow 
+            AND T.image != ''
+            AND T.status = " . $this->config['status_numb']['Active'] . "
+            AND T.id IN (
+                    SELECT event
+                      FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times AS ET
+                     WHERE active
+                       AND " . $this->dateRange . "
+                )
+            ";
+        $order  = "T.id";
+        $events = $this->getList($where, $order);
+        return $events;
+    }
+
     /**
      * getModelEventData
      *
index 3ea7632..bd85d54 100644 (file)
@@ -484,15 +484,19 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction
             $eventsByDate = $mainEvents;
         }
 
+        if ($view == 'agenda.html') {
+            // get the slideshow events
+            $slideShowEvents = $this->getModelSlideShowEventsData($categoryId);
+            //echo '<pre>$slideShowEvents: ' . print_r($slideShowEvents, true) . '</pre>';
+        }
+
         // Compile template data
         $templateData = array(
             'siteBaseUrl'  => GLM_MEMBERS_EVENTS_SITE_BASE_URL,
             'currentUrl'   => GLM_MEMBERS_EVENTS_PLUGIN_CURRENT_URL,
             'categoryId'   => $categoryId,
             'categories'   => $categories,
-            //'events'       => $events,
             'eventsByDate' => $eventsByDate,
-            //'event'       => $event,
             'catEvents'    => $categoryEvents,
             'fromDate'     => $fromDate,
             'toDate'       => $toDate,