/** * Builds the SELECT query * * @param boolean $overrideLimits Are we requested to override the set limits? * * @return JDatabaseQuery * * @since 3.2 */ public function buildQuery($overrideLimits = false) { $query = parent::buildQuery($overrideLimits); $db = $this->getDbo(); // Add a forced extension filtering to the list $eid = $this->getState('eid', 700); $query->where($db->qn('extension_id') . ' = ' . $db->q($eid)); // Force filter only enabled messages $published = $this->getState('published', 1, 'int'); $query->where($db->qn('enabled') . ' = ' . $db->q($published)); return $query; }
/** * ajust the query * * @param boolean $overrideLimits Are we requested to override the set limits? * * @return JDatabaseQuery */ public function buildQuery($overrideLimits = false) { // If SEF is enabled then start is a state var and will be used as filter from FOF $this->blacklistFilters('start'); $query = parent::buildQuery($overrideLimits); $db = $this->getDbo(); $task = $this->getState('task'); $formName = $this->getState('form_name'); if (FOFPlatform::getInstance()->isBackend()) { // Filter on catid $catid = (int) $this->input->get('category'); if ($catid != 0) { $query->where($db->qn('catid') . ' = ' . $catid); } return $query; } if (FOFPlatform::getInstance()->isFrontend()) { $query->where($db->qn('enabled') . ' = 1'); if (!in_array($formName, array('form.search', 'form.export'))) { $now = JFactory::getDate()->format("Y-m-d"); $query->where('(' . $db->qn('sdate') . ' >= ' . "'{$now}'" . ' OR ' . $db->qn('edate') . ' >= ' . "'{$now}'" . ')'); return $query; } // Search or export form $isfreeofcharge = $this->input->get('s_isfreeofcharge', 0); if ($isfreeofcharge == 1) { $query->where($db->qn('isfreeofcharge') . ' = 1'); } $sdate = $this->input->get('s_sdate'); if ($sdate == '') { $sdate = JFactory::getDate()->format("Y-m-d"); } else { $sdate = $this->formatDate($sdate); } $query->where($db->qn('sdate') . ' >= ' . $db->q($sdate)); $edate = $this->input->get('s_edate'); if ($edate != '') { $query->where($db->qn('edate') . ' <= ' . $db->q($edate)); } else { $edate = $this->formatDate($edate); } $pcodefrom = $this->input->get('pcodefrom'); if ($pcodefrom != '') { $query->where($db->qn('pcode') . ' >= ' . $db->q($pcodefrom)); } $pcodeupto = $this->input->get('pcodeupto'); if ($pcodeupto != '') { $query->where($db->qn('pcode') . ' <= ' . $db->q($pcodeupto)); } $fulltext = $this->input->get('fulltext', '', 'string'); if ($fulltext != '') { $fulltext = '%' . $fulltext . '%'; $query->where('(' . $db->qn('name') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('organiser') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('contact') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('ainfo') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('street') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('pcode') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('city') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('state') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('country') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('teaser') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('text') . ' like ' . $db->q($fulltext) . ')'); } $excatid = (array) $this->input->get('excatid'); if (!empty($excatid)) { $excatid = array_map('intval', $excatid); $excatid = implode(',', $excatid); $query->where($db->qn('catid') . ' IN ' . '(' . $excatid . ')'); } } return $query; }
public function buildQuery($overrideLimits = false) { return parent::buildQuery(); }