/** * Add filters to the object based on values found in the $_REQUEST superglobal. * * @access protected */ protected function initFilters() { // Use the default behavior of the parent class, but add support for the // special illustrations filter. parent::initFilters(); if (isset($_REQUEST['illustration'])) { if ($_REQUEST['illustration'] == 1) { $this->addFilter('illustrated:Illustrated'); } else { if ($_REQUEST['illustration'] == 0) { $this->addFilter('illustrated:"Not Illustrated"'); } } } }
/** * Add filters to the object based on values found in the $_REQUEST superglobal. * * @return void * @access protected */ protected function initFilters() { // Use the default behavior of the parent class, but add support for the // special illustrations filter. parent::initFilters(); if (isset($_REQUEST['illustration'])) { if ($_REQUEST['illustration'] == 1) { $this->addFilter('illustrated:Illustrated'); } else { if ($_REQUEST['illustration'] == 0) { $this->addFilter('illustrated:"Not Illustrated"'); } } } // Coordinates if (isset($_REQUEST['coordinates']) && $_REQUEST['coordinates']) { $coordinates = $_REQUEST['coordinates']; // Convert simple coordinates to a polygon if (preg_match('/^([\\d\\.]+)\\s+([\\d\\.]+)\\s+([\\d\\.]+)\\s+([\\d\\.]+)$/', $coordinates, $matches)) { list(, $minX, $minY, $maxX, $maxY) = $matches; $coordinates = "POLYGON(({$minX} {$maxY},{$maxX} {$maxY},{$maxX} {$minY},{$minX} {$minY},{$minX} {$maxY}))"; } $this->addFilter('{!score=none}location_geo:"Intersects(' . str_replace('"', '\\"', $coordinates) . ')"'); } }