query($sql),0,1); // Check if mysql can perform full text search or not. if(is_numeric($ft_min_word_len)) { $words_arr = explode(" ",$keyword); if(count($words_arr) >= 2){ foreach($words_arr as $each_word) { if(strlen($each_word) <= $ft_min_word_len-1) { $force_text_search = true; break; } } } } /* if keyword has 3 letters or less than it */ if (strlen($keyword) <= 3) { $skeyword = Inflector::singularize($keyword); $pkeyword = Inflector::pluralize($keyword); $formated_keyword = substr(db_formatString($keyword), 1, strlen(db_formatString($keyword))-2); $formated_skeyword = substr(db_formatString($skeyword), 1, strlen(db_formatString($skeyword))-2); $formated_pkeyword = substr(db_formatString($pkeyword), 1, strlen(db_formatString($pkeyword))-2); unset($sql_aux); if($formated_keyword) { $sql_aux[] = "Listing.title = '$formated_keyword'"; $sql_aux[] = "Listing.title LIKE '$formated_keyword %'"; $sql_aux[] = "Listing.title LIKE '% $formated_keyword'"; $sql_aux[] = "Listing.title LIKE '% $formated_keyword %'"; $sql_aux[] = "Listing.keywords = '$formated_keyword'"; $sql_aux[] = "Listing.keywords LIKE '$formated_keyword %'"; $sql_aux[] = "Listing.keywords LIKE '% $formated_keyword'"; $sql_aux[] = "Listing.keywords LIKE '% $formated_keyword %'"; } if($formated_skeyword) { $sql_aux[] = "Listing.title = '$formated_skeyword'"; $sql_aux[] = "Listing.title LIKE '$formated_skeyword %'"; $sql_aux[] = "Listing.title LIKE '% $formated_skeyword'"; $sql_aux[] = "Listing.title LIKE '% $formated_skeyword %'"; $sql_aux[] = "Listing.keywords = '$formated_skeyword'"; $sql_aux[] = "Listing.keywords LIKE '$formated_skeyword %'"; $sql_aux[] = "Listing.keywords LIKE '% $formated_skeyword'"; $sql_aux[] = "Listing.keywords LIKE '% $formated_skeyword %'"; } if($formated_pkeyword) { $sql_aux[] = "Listing.title = '$formated_pkeyword'"; $sql_aux[] = "Listing.title LIKE '$formated_pkeyword %'"; $sql_aux[] = "Listing.title LIKE '% $formated_pkeyword'"; $sql_aux[] = "Listing.title LIKE '% $formated_pkeyword %'"; $sql_aux[] = "Listing.keywords = '$formated_pkeyword'"; $sql_aux[] = "Listing.keywords LIKE '$formated_pkeyword %'"; $sql_aux[] = "Listing.keywords LIKE '% $formated_pkeyword'"; $sql_aux[] = "Listing.keywords LIKE '% $formated_pkeyword %'"; } $sql_aux[] = "Listing.category_search LIKE '% $formated_keyword %'"; $sql_where[] = "(".(implode(" OR ", $sql_aux)).")"; /* if mysql can't perform full text search with current keyword. */ } elseif($force_text_search) { $pkeyword = Inflector::pluralize($keyword); $skeyword = Inflector::singularize($keyword); $thesaurus = ($word_amount = count(explode(" ",$keyword)) == 2) ? str_replace(" ", "", $keyword) : false; $formated_keyword = substr(db_formatString($keyword), 1, strlen(db_formatString($keyword))-2); $formated_pkeyword = substr(db_formatString($pkeyword), 1, strlen(db_formatString($pkeyword))-2); $formated_skeyword = substr(db_formatString($skeyword), 1, strlen(db_formatString($skeyword))-2); $formated_thesaurus = substr(db_formatString($thesaurus), 1, strlen(db_formatString($thesaurus))-2); unset($sql_aux); if($formated_keyword) { $sql_aux[] = "Listing.title LIKE '$formated_keyword%'"; $sql_aux[] = "Listing.title LIKE '%$formated_keyword'"; $sql_aux[] = "Listing.title LIKE '%$formated_keyword%'"; $sql_aux[] = "Listing.keywords LIKE '$formated_keyword%'"; $sql_aux[] = "Listing.keywords LIKE '%$formated_keyword'"; $sql_aux[] = "Listing.keywords LIKE '%$formated_keyword%'"; } if($formated_pkeyword) { $sql_aux[] = "Listing.title LIKE '$formated_pkeyword%'"; $sql_aux[] = "Listing.title LIKE '%$formated_pkeyword'"; $sql_aux[] = "Listing.title LIKE '%$formated_pkeyword%'"; $sql_aux[] = "Listing.keywords LIKE '$formated_pkeyword%'"; $sql_aux[] = "Listing.keywords LIKE '%$formated_pkeyword'"; $sql_aux[] = "Listing.keywords LIKE '%$formated_pkeyword%'"; } if($formated_skeyword) { $sql_aux[] = "Listing.title LIKE '$formated_skeyword%'"; $sql_aux[] = "Listing.title LIKE '%$formated_skeyword'"; $sql_aux[] = "Listing.title LIKE '%$formated_skeyword%'"; $sql_aux[] = "Listing.keywords LIKE '$formated_skeyword%'"; $sql_aux[] = "Listing.keywords LIKE '%$formated_skeyword'"; $sql_aux[] = "Listing.keywords LIKE '%$formated_skeyword%'"; } if($formated_thesaurus) { $sql_aux[] = "Listing.title LIKE '$formated_thesaurus%'"; $sql_aux[] = "Listing.title LIKE '%$formated_thesaurus'"; $sql_aux[] = "Listing.title LIKE '%$formated_thesaurus%'"; $sql_aux[] = "Listing.keywords LIKE '$formated_thesaurus%'"; $sql_aux[] = "Listing.keywords LIKE '%$formated_thesaurus'"; $sql_aux[] = "Listing.keywords LIKE '%$formated_thesaurus%'"; } $sql_aux[] = "Listing.category_search LIKE '% $formated_keyword %'"; $sql_where[] = "(".(implode(" OR ", $sql_aux)).")"; /* If mysql can perform full text search with current keyword */ } else { $thesaurus = ($word_amount = count(explode(" ",$keyword)) == 2) ? str_replace(" ", "", $keyword) : false; unset($keyword_arr); foreach(explode(" ", $keyword) as $each_keyword) { $keyword_arr[] = $each_keyword."*"; $keyword_arr[] = Inflector::singularize($each_keyword); $keyword_arr[] = Inflector::pluralize($each_keyword); } $keyword_arr[] = $thesaurus; $formated_keywords = db_formatString(implode(" ",$keyword_arr)); $priority_sql = " MATCH (Listing.title, Listing.keywords) AGAINST (".$formated_keywords." IN BOOLEAN MODE) as search_priority1"; $sql_where[] = " MATCH (Listing.title, Listing.keywords, Listing.category_search, Listing.description) AGAINST (".$formated_keywords." IN BOOLEAN MODE)"; } } // ------------------------------------------- // Zip --------------------------------------- if ($zip) { $zip = str_replace("\\", "", $zip); $_GET["zip"] = $zip; $miles = str_replace("\\", "", $miles); $_GET["miles"] = $miles; if (ZIPCODE_PROXIMITY == "on") { if (zipproximity_getWhereZipCodeProximity($zip, $miles, $whereZipCodeProximity)) $sql_where[] = $whereZipCodeProximity; else $sql_where[] = "Listing.zip_code = '".$zip."'"; } else { $sql_where[] = "Listing.zip_code = '".$zip."'"; } } // ------------------------------------------- // ID ------------------------------------ if ($id) $sql_where[] = "Listing.id = $id"; // ------------------------------------------- // Status ------------------------------------ $sql_where[] = "Listing.status = 'A'"; // ------------------------------------------- if ($sql_where) $where .= " ".implode(" AND ", $sql_where)." "; $order = ($formated_keywords) ? "Listing.level DESC, search_priority1 DESC" : "Listing.level DESC, Listing.random_number, Listing.title"; $return_columns = ($priority_sql) ? "Listing.*, $priority_sql" : "Listing.*"; if ($category_id) { $pageObj = new pageBrowsing($table, $screen, 50, $order, "Listing.title", $letter, $where, $return_columns, "Listing", "Listing.id"); } else { $pageObj = new pageBrowsing($table, $screen, 10, $order, "Listing.title", $letter, $where, $return_columns, "Listing"); } $listings = $pageObj->retrievePage(); //var_dump($listings); $paging_url = DEFAULT_URL."/listingresults.php"; // get URL - $_GET not sent in constructor because system structure exclude vars named screen and letter $urlQuery = new UrlQueryGenerator(); foreach ($_GET as $name => $value){ if ($name != "screen" && $name != "letter"){ $urlQuery->setParameter($name, $value); } } $url_search_params = $urlQuery->buildUrlQuery(false); // Letters Menu $letters = $pageObj->getString("letters"); foreach($letters as $each_letter) { if ($each_letter == "#") { $letters_menu .= "".strtoupper($each_letter).""; } else { $letters_menu .= "".strtoupper($each_letter).""; } } # PAGES DROP DOWN ---------------------------------------------------------------------------------------------- $pagesDropDown = $pageObj->getPagesDropDown($_GET, $paging_url, $screen, "Go to page: ", "this.form.submit();"); # -------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------- # FORMS DEFINES # ---------------------------------------------------------------------------------------------------- $categoryDropDown = html_objectArraySelectBox("category_id", $categories, $category_id, "", "class='input-dd-form-searchlisting'", "All Categories"); $array = Array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); $letterDropDown = html_selectBox("letter", $array, $array, $letter, "", "class='input-dd-simplesearch'", "All Letters"); # ---------------------------------------------------------------------------------------------------- # HEADER # ---------------------------------------------------------------------------------------------------- $extrastyle = array(DEFAULT_URL."/layout/listing_result.css", DEFAULT_URL."/layout/listing_color.css"); $banner_section = "listing"; include(EDIRECTORY_ROOT."/layout/header.php"); $user = true; include(INCLUDES_DIR."/code/apfm.inc"); ?>

"; include(INCLUDES_DIR."/code/google_ads.php"); echo ""; }*/ ?> AD
retrieveContentByType("Listing Results"); if ($content) { echo "
".$content."
"; } ?> getString("content", false)); //include(INCLUDES_DIR."/views/view_subcategories.php"); } else { // related categories //if (!$_GET["category_id"] && $keyword) { include(INCLUDES_DIR."/views/view_related_categories.inc"); } } } ?>
".htmlspecialchars($keyword).""; if ($category_id) { $search_category = new Category($category_id); $str_search.= " in category ".$search_category->getString("title").""; } if ($state_id || $region_id) $str_search.= " in "; if ($region_id) { $search_city = new LocationRegion($region_id); $str_search.= "".$search_city->getString("name").""; } if ($state_id && $region_id) $str_search.= ", "; if ($state_id) { $search_state = new LocationState($state_id); $str_search.= "".$search_state->getString("name").""; } if (!$search_menu){ include(INCLUDES_DIR."/views/view_categories_results.php"); } else { if ($str_search){ ?>
Search results
getRowCount("Listing") > 0) { ?>

No results were found for the search criteria you requested.
Please try your search again.

No listings registered yet.

setLocationManager($locationManager); $objReports = new Reports(); $objReports->setString("listing_id", $listing->getString("id")); $objReports->setString("report_type", LISTING_REPORT_SUMMARY_VIEW); $objReports->setString("ip", $_SERVER["REMOTE_ADDR"]); $objReports->Save(); unset($objReports); if ($listing->getNumber("level") != $control_level) { $control_level = $listing->getNumber("level"); } if ($contListings == 2 && (count($listings)>2)) { ?> getNumber("level") . ".inc"); } // now show the dropdown for pages $topdropdown = 0; include(INCLUDES_DIR."/tables/table_paging.inc"); } ?>
Advertisers