diff --git a/third_party/freebie/ext.freebie.php b/third_party/freebie/ext.freebie.php index e584b3c..645f8d6 100755 --- a/third_party/freebie/ext.freebie.php +++ b/third_party/freebie/ext.freebie.php @@ -330,7 +330,12 @@ function clean_uri(){ // Store 'cleaned' uri_string for debugging $this->EE->config->_global_vars['freebie_debug_uri_cleaned'] = $this->EE->uri->uri_string; - + // return empty value if there is no breaking segment. + if(!isset($this->EE->config->_global_vars['freebie_break_1'])){ + for ($i = 1; $i <= 11; $i++){ + $this->EE->config->_global_vars['freebie_break_'.$i] = ''; + } + } } /** diff --git a/third_party/freebie/pi.freebie.php b/third_party/freebie/pi.freebie.php index 8101a3a..bd53e74 100755 --- a/third_party/freebie/pi.freebie.php +++ b/third_party/freebie/pi.freebie.php @@ -63,13 +63,21 @@ function category_match($cat_key) $this->EE =& get_instance(); $match = ''; $segment = $this->EE->TMPL->fetch_param('segment'); - $group_id = $this->EE->TMPL->fetch_param('group_id'); $site_id = $this->EE->TMPL->fetch_param('site_id'); $category_url = $this->EE->config->_global_vars['freebie_'.$segment]; $query_string = "SELECT cat_id, cat_name, cat_description, cat_image FROM exp_categories WHERE cat_url_title = '$category_url'"; - if($group_id != ''){ - $query_string .= "AND group_id = '$group_id'"; + if ($this->EE->TMPL->fetch_param('group_id')) + { + if (substr($this->EE->TMPL->fetch_param('group_id'), 0, 3) == 'not') + { + $query_string .= $this->EE->functions->sql_andor_string($this->EE->TMPL->fetch_param('group_id'), 'exp_categories.group_id', '', TRUE)." "; + } + else + { + $query_string .= $this->EE->functions->sql_andor_string($this->EE->TMPL->fetch_param('group_id'), 'exp_categories.group_id')." "; + } } + if($site_id != ''){ $query_string .= "AND site_id = '$site_id'"; }