WordPress.org

Plugin Directory

Changeset 698789


Ignore:
Timestamp:
04/16/13 21:59:23 (12 months ago)
Author:
liedekef
Message:

location_id argument in shortcodes now supports 'none' to indicate no location

Location:
events-made-easy/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • events-made-easy/trunk/eme_events.php

    r697099 r698789  
    15431543      if ($location_id>0) 
    15441544         $conditions[] = " location_id = $location_id"; 
     1545   } elseif ($location_id == "none") { 
     1546      $conditions[] = " location_id = ''"; 
    15451547   } elseif ( preg_match('/,/', $location_id) ) { 
    15461548      $location_ids=explode(',', $location_id); 
    15471549      $location_conditions = array(); 
    15481550      foreach ($location_ids as $loc) { 
     1551         if (is_numeric($loc) && $loc>0) { 
     1552            $location_conditions[] = " location_id = $loc"; 
     1553         } elseif ($loc == "none") { 
     1554            $location_conditions[] = " location_id = ''"; 
     1555         } 
     1556      } 
     1557      $conditions[] = "(".implode(' OR', $location_conditions).")"; 
     1558   } elseif ( preg_match('/\+/', $location_id) ) { 
     1559      $location_ids=explode('+', $location_id); 
     1560      $location_conditions = array(); 
     1561      foreach ($location_ids as $loc) { 
    15491562         if (is_numeric($loc) && $loc>0) 
    15501563               $location_conditions[] = " location_id = $loc"; 
    15511564         } 
    1552          $conditions[] = "(".implode(' OR', $location_conditions).")"; 
     1565         $conditions[] = "(".implode(' AND', $location_conditions).")"; 
    15531566   } elseif ( preg_match('/ /', $location_id) ) { 
     1567      // url decoding of '+' is ' ' 
    15541568      $location_ids=explode(' ', $location_id); 
    15551569      $location_conditions = array(); 
     
    15801594      } elseif ( preg_match('/\+/', $category) ) { 
    15811595         $category = explode('+', $category); 
     1596         $category_conditions = array(); 
     1597         foreach ($category as $cat) { 
     1598            if (is_numeric($cat) && $cat>0) 
     1599               $category_conditions[] = " FIND_IN_SET($cat,event_category_ids)"; 
     1600         } 
     1601         $conditions[] = "(".implode(' AND ', $category_conditions).")"; 
     1602      } elseif ( preg_match('/ /', $category) ) { 
     1603         // url decoding of '+' is ' ' 
     1604         $category = explode(' ', $category); 
    15821605         $category_conditions = array(); 
    15831606         foreach ($category as $cat) { 
  • events-made-easy/trunk/readme.txt

    r698079 r698789  
    118118* Feature: ability to use attributes and conditional tags in registration form added 
    119119* Feature: added conditional tag #_IS_MULTIPRICE 
     120* Feature: location_id argument in shortcodes now supports 'none' to indicate no location 
    120121* Improvement: updated Italian translation, tx to Antonio Venneri 
    121122* Change: placeholders #_RESPSPACES and #_RESPCOMMENT now preferred for bookings 
Note: See TracChangeset for help on using the changeset viewer.