function autoSearchLink($linkText, $location, $type, $searchType = '/ForSale/', $area = '', $subType = '', $min = '', $max = '') { validateAuthorisationKeys(); global $resultsPage; global $autoRewritePattern; global $defaultArea; if ($area == '') { $area = $defaultArea; } $arrayTmp = array('location' => $location, 'area' => $area, 'type' => $type, 'subtype' => $subType, 'priceMin' => $min, 'priceMax' => $min); $data = array(); $patterns = explode("-", $autoRewritePattern); foreach ($patterns as $item) { if ($item == 'type') { if ($arrayTmp[$item] != '') { $data[] = str_replace('-', ' ', $arrayTmp[$item]); } } else { if ($arrayTmp[$item] != '') { $data[] = $arrayTmp[$item]; } } } $urlRewrite = implode('-', $data); if ($searchType != '') { $tmpArr = array('/ForSale/' => 'Resale', '/LongTerm/' => 'RentalLT', '/ShortTerm/' => 'RentalST'); $_SESSION["SearchType"] = $tmpArr[$searchType]; } else { $_SESSION["SearchType"] = 'Resale'; } return '<a href="' . $_SERVER['REQUEST_URI'] . $resultsPage . $searchType . $urlRewrite . '.htm?auto=true">' . $linkText . '</a>'; }
function displayFeatureResults() { validateAuthorisationKeys(); global $featureUrl; return outputFeatureResults(getFeatureResults(getFeatureUrl())); }