/** * * @param string $tag Default is NULL * @param int $page Default is NULL * @return void */ public function index($tag = NULL, $page = NULL) { $getData = array('query' => $tag ? $tag : Input::get('query'), 'type' => Input::get('type'), 'country' => Input::get('country'), 'make' => Input::get('make'), 'model' => Input::get('model'), 'year_min' => Input::get('year_min'), 'year_max' => Input::get('year_max'), 'price_min' => Input::get('price_min'), 'price_max' => Input::get('price_max'), 'currency' => Input::get('currency'), 'condition' => Input::get('condition'), 'color' => Input::get('color'), 'mileage_min' => Input::get('mileage_min'), 'mileage_max' => Input::get('mileage_max'), 'vehicle' => Input::get('vehicle'), 'vin' => Input::get('vin'), 'state' => Input::get('state'), 'city' => Input::get('city'), 'location' => Input::get('location'), 'order' => Input::get('order'), 'page' => $page ? $page : Input::get('page')); $getData = $this->mSearch->fixDashes($getData); $getData = $this->mSearch->fixLower($getData); $data = $this->mSearch->apiResults($getData); $data['params'] = $getData; $data['yearMin'] = $getData['year_min'] ? $getData['year_min'] : 1980; $data['yearMax'] = $getData['year_max'] ? $getData['year_max'] : (int) date('Y'); $data['priceMin'] = $getData['price_min'] ? $getData['price_min'] : 0; $data['priceMax'] = $getData['price_max'] ? $getData['price_max'] : 50000; $data['mileageMin'] = $getData['mileage_min'] ? $getData['mileage_min'] : 0; $data['mileageMax'] = $getData['mileage_max'] ? $getData['mileage_max'] : 200000; $this->mSearch->saveTags($getData['query'], $data['total']); $data['latestTags'] = $this->mSearch->getTags('latest'); $data['randomTags'] = $this->mSearch->getTags('random'); if ($tag !== NULL) { Pagination::setQueryString(FALSE); Pagination::setURL(tagLink($getData['query'])); $seoData = $this->mSearch->setSeo('tags', $getData, $data['total']); Layout::title(getSeo($seoData, 'tagsTitle')); Layout::desc(getSeo($seoData, 'tagsDesc')); Layout::heading(getSeo($seoData, 'tagsHeading')); } else { Pagination::setQueryString(TRUE); Pagination::setURL(searchLink($getData, FALSE)); $seoData = $this->mSearch->setSeo('search', $getData, $data['total']); Layout::title(getSeo($seoData, 'searchTitle')); Layout::desc(getSeo($seoData, 'searchDesc')); Layout::heading(getSeo($seoData, 'searchHeading')); } Pagination::setTotal($data['total'], Config::get('searchResultsLimit', 'limit'), Config::get('searchPaginaLimit', 'limit')); Pagination::setCurrent($getData['page']); Pagination::setNumLinks(3); Pagination::run(); $data['pagination'] = Pagination::getPagina(); Layout::view('vSearch', $data); }
"<?php echo selectedVal('5', $params['order']); ?> >Relevance</option> </select> </form> </div> <!-- search order end //--> <!-- social links begin //--> <div class="socialLinks"> <p><a href="http://facebook.com/share.php?u=<?php echo searchLink($params); ?> "><i class="facebookIcon"></i> Share on Facebook</a></p> <p><a href="http://twitter.com/intent/tweet?text=<?php echo searchLink($params); ?> "><i class="twitterIcon"></i> Share on Twitter</a></p> </div> <!-- social links end //--> <!-- other links begin //--> <div class="otherLinks"> <?php echo $ad160x600Layout; ?> </div> <!-- other links end //--> </aside> <!-- search right end //--> </section>
/** * * @param array $data * @param array $getData * @return string */ public function getRSS($data = array(), $getData = array()) { Loader::helper('XML'); $dom = xmlDOM(); $rss = xmlAddChild($dom, 'rss'); xmlSetAttribute($rss, 'version', '2.0'); xmlSetAttribute($rss, 'xmlns:dc', 'http://purl.org/dc/elements/1.1/'); xmlSetAttribute($rss, 'xmlns:sy', 'http://purl.org/rss/1.0/modules/syndication/'); xmlSetAttribute($rss, 'xmlns:admin', 'http://webns.net/mvcb/'); xmlSetAttribute($rss, 'xmlns:rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'); xmlSetAttribute($rss, 'xmlns:content', 'http://purl.org/rss/1.0/modules/content/'); xmlSetAttribute($rss, 'xmlns:media', 'http://search.yahoo.com/mrss/'); $channel = xmlAddChild($rss, 'channel'); xmlAddChild($channel, 'title', Config::get('siteName', 'seo')); xmlAddChild($channel, 'link', baseURL()); xmlAddChild($channel, 'description', Config::get('siteDesc', 'seo')); xmlAddChild($channel, 'dc:language', 'en-en'); $atom = xmlAddChild($channel, 'atom10:link'); xmlSetAttribute($atom, 'xmlns:atom10', 'http://www.w3.org/2005/Atom'); xmlSetAttribute($atom, 'href', searchLink($getData, TRUE, NULL, TRUE)); xmlSetAttribute($atom, 'rel', 'self'); xmlSetAttribute($atom, 'type', 'application/rss+xml'); if (isset($data['items'])) { foreach ($data['items'] as $entry) { $item = xmlAddChild($channel, 'item'); xmlAddChild($item, 'title', xmlConvert(filterText($entry->title)), TRUE); $itemLink = itemLink($entry->hash); xmlAddChild($item, 'link', $itemLink); xmlAddChild($item, 'guid', $itemLink); xmlAddChild($item, 'description', filterText($entry->content, TRUE, TRUE), TRUE); xmlAddChild($item, 'pubDate', date('D, d M Y H:i:s O', $entry->time)); if ($entry->picture) { $media = xmlAddChild($item, 'media:thumbnail'); xmlSetAttribute($media, 'url', $entry->picture); xmlSetAttribute($media, 'width', '120'); xmlSetAttribute($media, 'height', '100'); } } } return xmlPrint($dom, TRUE); }