* Plugin Name: GLM Members Database Events
* Plugin URI: http://www.gaslightmedia.com/
* Description: Gaslight Media Members Database.
- * Version: 1.4.4
+ * Version: 1.4.5
* Author: Chuck Scott
* Author URI: http://www.gaslightmedia.com/
* License: GPL2
* @package glmMembersDatabaseEventsAddOn
* @author Chuck Scott <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.4.4
+ * @version 1.4.5
*/
/*
* 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.4.4');
+define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.4.5');
define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.0.22');
// This is the minimum version of the GLM Members DB plugin require for this plugin.
* @access public
* @return array events
*/
+
+ /*
+ * leaving sql query in the event it is needed in the future. It selects events
+ * from within a given date range. Left out of the where statement because it is
+ * already performed by $this->dateRange
+ */
+ // AND ET.id IN (
+ // SELECT event
+ // FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times AS DTR
+ // WHERE active
+ // AND " . $this->dateRange . "
+ // )
public function getModelTimesData( )
{
-
$this->postAddTimes = true;
$where = '';
- $where .= "T.active = 1
- AND T.event IN (
- SELECT event
- FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times AS ET
- WHERE active
- AND " . $this->dateRange . "
- )
- ";
+ $where .= "T.active = 1
+ AND T.event IN (
+ SELECT ET.id
+ FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "events AS ET
+ WHERE ET.status = " . $this->config['status_numb']['Active'] . "
+ )
+ ";
+
+ $events = $this->getList( $where );
- $events = $this->getList( $where );
-// echo "<pre>", print_r($events), '</pre>';
$this->postAddTimes = false;
return $events;
}
*/
public function modelAction ($actionData = false)
{
-
+
+
$event_data = [];
$month = filter_var_array(
$_REQUEST['month'],
SELECT id
FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times
WHERE DATE(start_time) BETWEEN '{$from}' AND '{$to}'
+
)";
$times = $this->getModelTimesData();
$return = array(
// 'status' => false, // Assume nothing works
- 'events' => $event_data // Where our events list will go
-// 'message' => '',
+ 'events' => $event_data , // Where our events list will go
+ 'message' => $message,
// 'times' => ''
);