* Plugin URI: http://www.gaslightmedia.com/
* Description: Gaslight Media Members Database.
- * Version: 1.6.85
+ * Version: 1.6.86
* Author: Chuck Scott
* Author URI: http://www.gaslightmedia.com/
* @author Chuck Scott <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.6.85
+ * @version 1.6.86
*/
* 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.85');
+define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.86');
define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.1.5');
// This is the minimum version of the GLM Members DB plugin require for this plugin.
* @access public
* @return array events
*/
- public function getModelEventsData( $categoryId = null, $limit = null, $memberId = null, $amenityId = null, $venueId = null, $cityId = null )
+ public function getModelEventsData( $categoryId = null, $limit = null, $memberId = null, $amenityId = null, $venueId = null, $cityId = null, $isNameSearch = false )
{
$this->postAddTimes = true;
}
// check for city id in event list search
- if ( $cityId = filter_var( $cityId, FILTER_VALIDATE_INT ) ) {
+ if ( $cityId = filter_var( $cityId, FILTER_VALIDATE_INT ) && !$isNameSearch ) {
$whereParts[] = "
T.id IN (
SELECT event
$cats = array_filter( filter_var( $categoryId, FILTER_VALIDATE_INT, array( 'flags' => FILTER_FORCE_ARRAY ) ) );
$catId = filter_var( $categoryId, FILTER_VALIDATE_INT );
// If a category ID is supplied
- if ( $catId ) {
+ if ( $catId && !$isNameSearch ) {
//$events = $this->getEventsByCategory( $catId, $limit );
$whereParts[] = "
T.id IN (
if ( $limit = filter_var( $limit, FILTER_VALIDATE_INT ) ) {
$order .= " LIMIT {$limit} OFFSET 0";
}
- } else if ( $this->notInCat && !empty( $this->notInCat ) ) {
+ } else if ( $this->notInCat && !empty( $this->notInCat ) && !$isNameSearch ) {
$whereParts[] = "
T.id NOT IN (
SELECT event
}
// Else if the $categoryId is an array
- } else if ( $cats && !empty( $cats ) ) {
+ } else if ( $cats && !empty( $cats ) && !$isNameSearch ) {
$whereParts[] = "
T.id IN (
SELECT event
";
}
+ // echo '<pre>$whereParts: ' . print_r( $whereParts, true ) . '</pre>';
if ( isset( $whereParts ) && !empty( $whereParts ) ) {
$where = implode( ' AND ', $whereParts);
}
break;
case 'event-list-name':
$this->postAddRecurrences = true;
- $events = $this->getModelEventsData( $eventNameSearch, null, $memberId, $amenityId, $venueId );
+ $events = $this->getModelEventsData( $eventNameSearch, null, $memberId, $amenityId, $venueId, null, true );
$this->postAddRecurrences = false;
if ( !$view ) {
$view = 'agenda.html';