)
)";
}
-
+
// check for city id in event list search
if ( $cityId = filter_var( $cityId, FILTER_VALIDATE_INT ) ) {
$whereParts[] = "
if ( $limit = filter_var( $limit, FILTER_VALIDATE_INT ) ) {
$order .= " LIMIT {$limit} OFFSET 0";
}
+ } else if ( $this->notInCat && !empty( $this->notInCat ) ) {
+ $whereParts[] = "
+ T.id IN (
+ SELECT event
+ FROM " .GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "event_categories
+ WHERE category NOT IN (" . implode( ',', $this->notInCat ) . ")
+ AND event IN (
+ SELECT event
+ FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times AS ET
+ WHERE status = " . $this->config['status_numb']['Active'] . "
+ AND " . $this->dateRange . "
+ )
+ )
+ ";
+ $order = "T.id";
+ if ( $limit = filter_var( $limit, FILTER_VALIDATE_INT ) ) {
+ $order .= " LIMIT {$limit} OFFSET 0";
+ }
+
// Else if the $categoryId is an array
} else if ( $cats && !empty( $cats ) ) {
$whereParts[] = "
*/
public function modelAction( $actionData = false )
{
- $limit = null;
- $status = null;
- $action = '';
- $settings = array();
- $events = array();
- $event = array();
- $calDates = false;
- $view = null;
- $featured = null;
- $current = null;
- $eventsByDate = null;
- $categoryId = null;
- $categories = array();
- $amenityId = null;
- $amenities = array();
- $memberId = null;
- $cityId = null;
- $members = array();
- $venues = array();
- $venueId = null;
- $eventDays = array();
- $eventDay = null;
- $pageSlug = 'event-detail';
- $customPage = false;
- $groupByDay = true;
- $groupMonth = false;
+ $limit = null;
+ $status = null;
+ $action = '';
+ $settings = array();
+ $events = array();
+ $event = array();
+ $calDates = false;
+ $view = null;
+ $featured = null;
+ $current = null;
+ $eventsByDate = null;
+ $categoryId = null;
+ $categories = array();
+ $amenityId = null;
+ $amenities = array();
+ $memberId = null;
+ $cityId = null;
+ $members = array();
+ $venues = array();
+ $venueId = null;
+ $eventDays = array();
+ $eventDay = null;
+ $pageSlug = 'event-detail';
+ $customPage = false;
+ $groupByDay = true;
+ $groupMonth = false;
+ $this->notInCat = array();
// get list cities to search by
}
// Get any numeric categories selected in the submitted shortcode and add to $cats array.
// This sets categories that are available for selection by the user
- if ( !isset( $_REQUEST['category'] ) && isset( $actionData['request']['category'] ) && $categoryId = filter_var( $actionData['request']['category'], FILTER_SANITIZE_STRING ) ) {
+ if ( !( isset( $_REQUEST['category'] ) && $_REQUEST['category'] )
+ && isset( $actionData['request']['category'] )
+ && $categoryId = filter_var( $actionData['request']['category'], FILTER_SANITIZE_STRING )
+ ) {
$categoryId = array();
// Convert comma separated list to an array
// Clean up the category number and add to cats array
$categoryId[] = ($v-0);
+ } else if (preg_match('/^-[0-9]*$/', trim($v))) {
+ $this->notInCat[] = abs($v);
}
}