protected function _get_Captions_with_Counts_Grouped_by_Captions($request_data, array $listingSids = array()) { if (SJB_Settings::getValue('enableBrowseByCounter')) { $res = parent::_get_Captions_with_Counts_Grouped_by_Captions($request_data, $listingSids); } else { $sql = "select `value` as caption from `listing_field_list` where `field_sid`=?n"; $res = SJB_DB::query($sql, $this->field['sid']); } return $res; }
protected function _get_Captions_with_Counts_Grouped_by_Captions($request_data, array $listingSids = array()) { if (SJB_Settings::getValue('enableBrowseByCounter')) { $res = parent::_get_Captions_with_Counts_Grouped_by_Captions($request_data, $listingSids); foreach ($res as $key => $value) { if (strpos($key, ',')) { unset($res[$key]); $newKeys = explode(',', $key); foreach ($newKeys as $newKey) { $res[$newKey] = isset($res[$newKey]) ? $res[$newKey] + $value : $value; } } } } else { $sql = "select `value` as caption from `listing_field_list` where `field_sid`=?n"; $res = SJB_DB::query($sql, $this->field['sid']); } return $res; }