remove check for ref_dest is not null
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 7 Jun 2017 12:58:46 +0000 (08:58 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 7 Jun 2017 12:58:46 +0000 (08:58 -0400)
ref_dest may be 0

index.php
models/admin/ajax/eventsCalMonthAJAX.php

index 8cb60b9..76e87bf 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.42
+ * Version: 1.6.43
  * 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.42
+ * @version 1.6.43
  */
 
 /*
@@ -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.42');
+define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.43');
 define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.1.2');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
index c36ead5..d9359b7 100644 (file)
@@ -85,19 +85,19 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEventsTimes
     {
         $this->postAddTimes = true;
         $where = '';
-       
+
         if($member_id !== false && $member_id !== ''){
-            $ref_dest = "= $member_id";
+            $ref_dest = "AND ref_dest = $member_id";
         } else {
-            $ref_dest = 'IS NOT NULL';
+            $ref_dest = '';
         }
-        
+
         $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'] . "
-                AND ref_dest $ref_dest
+                $ref_dest
             )
             AND $this->dateRangeTimes
         ";
@@ -228,7 +228,7 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEventsTimes
                 $custom_page = $_REQUEST['custom_page'];
             }
             $page_slug = (isset($_REQUEST['page_slug']) ? filter_var( $_REQUEST['page_slug'], FILTER_SANITIZE_STRING ) : '');
-            
+
             $month = filter_var_array(
                 $_REQUEST['month'],
                 array(
@@ -268,14 +268,14 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEventsTimes
                     $event_data[$e]['last'] = ($last);
                     $event_data[$e]['slug'] = $event_slugs[$e];
                     $slug = $event_slugs[$e];
-                    
+
                     if($custom_page !== ''){
                         $event_data[$e]['url'] = GLM_MEMBERS_EVENTS_SITE_BASE_URL . "$page_slug/?eventId=" . $val['event'];
-                        
+
                     } else {
                         $event_data[$e]['url'] = GLM_MEMBERS_EVENTS_SITE_BASE_URL . "$page_slug/" . $slug . "/";
                     }
-                    
+
                 }
             }
         }