query($sql); $aux = mysql_fetch_assoc($result); if ($aux["category_id"] == "0"){ $sql_where_homes_rent[] = "( ClassifiedListing.category_id = '".$category_id."' OR ClassifiedListing.parent_category_id = '".$category_id."' OR ClassifiedListing.category_id2 = '".$category_id."' OR ClassifiedListing.parent_category_id2 = '".$category_id."' OR ClassifiedListing.category_id3 = '".$category_id."' OR ClassifiedListing.parent_category_id3 = '".$category_id."' )"; }else $sql_where_homes_rent[] = "ClassifiedListing.category_id = '".$category_id."' OR ClassifiedListing.category_id2 = '".$category_id."' OR ClassifiedListing.category_id3 = '".$category_id."'"; } if ($category_id2) { $db = db_getDBObject(); $sql = "SELECT category_id FROM ClassifiedCategory WHERE id = '$category_id'"; $result = $db->query($sql); $aux = mysql_fetch_assoc($result); if ($aux["category_id"] == "0"){ $sql_where_homes_rent[] = "( ClassifiedListing.category_id2 = '".$category_id2."' )"; }else $sql_where_homes_rent[] = "ClassifiedListing.category_id2 = '".$category_id2."'"; } if ($category_id3) { $db = db_getDBObject(); $sql = "SELECT category_id FROM ClassifiedCategory WHERE id = '$category_id'"; $result = $db->query($sql); $aux = mysql_fetch_assoc($result); if ($aux["category_id"] == "0"){ $sql_where_homes_rent[] = "( ClassifiedListing.category_id2 = '".$category_id2."' )"; }else $sql_where_homes_rent[] = "ClassifiedListing.category_id2 = '".$category_id2."'"; } if ($category_id2 && $category_id3) { $db = db_getDBObject(); $sql = "SELECT category_id FROM ClassifiedCategory WHERE id = '$category_id'"; $result = $db->query($sql); $aux = mysql_fetch_assoc($result); if ($aux["category_id"] == "0"){ $sql_where_homes_rent[] = "( ClassifiedListing.category_id2 = '".$category_id2."' AND ClassifiedListing.category_id3 = '".$category_id3."' )"; }else $sql_where_homes_rent[] = "ClassifiedListing.category_id2 = '".$category_id2."' AND ClassifiedListing.category_id3 = '".$category_id3."'"; } // ------------------------------------------- // ID ------------------------------------ if ($id) $sql_where_homes_rent[] = "ClassifiedListing.id = $id"; // ------------------------------------------- // Status ------------------------------------ $sql_where_homes_rent[] = "ClassifiedListing.status = 'A'"; // ------------------------------------------- // Keyword ----------------------------------- if ($keyword) { $keyword = str_replace("\\", "", $keyword); $_GET["keyword"] = $keyword; // Retrieve full text minimum word length $dbObj = db_getDBObject(); $sql= "SHOW VARIABLES LIKE 'ft_min_word_len'"; $ft_min_word_len = mysql_result($dbObj->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[] = "ClassifiedListing.title = '$formated_keyword'"; $sql_aux[] = "ClassifiedListing.title LIKE '$formated_keyword %'"; $sql_aux[] = "ClassifiedListing.title LIKE '% $formated_keyword'"; $sql_aux[] = "ClassifiedListing.title LIKE '% $formated_keyword %'"; } if($formated_skeyword) { $sql_aux[] = "ClassifiedListing.title = '$formated_skeyword'"; $sql_aux[] = "ClassifiedListing.title LIKE '$formated_skeyword %'"; $sql_aux[] = "ClassifiedListing.title LIKE '% $formated_skeyword'"; $sql_aux[] = "ClassifiedListing.title LIKE '% $formated_skeyword %'"; } if($formated_pkeyword) { $sql_aux[] = "ClassifiedListing.title = '$formated_pkeyword'"; $sql_aux[] = "ClassifiedListing.title LIKE '$formated_pkeyword %'"; $sql_aux[] = "ClassifiedListing.title LIKE '% $formated_pkeyword'"; $sql_aux[] = "ClassifiedListing.title LIKE '% $formated_pkeyword %'"; } $sql_where_homes_rent[] = "(".(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[] = "ClassifiedListing.title LIKE '$formated_keyword%'"; $sql_aux[] = "ClassifiedListing.title LIKE '%$formated_keyword'"; $sql_aux[] = "ClassifiedListing.title LIKE '%$formated_keyword%'"; } if($formated_pkeyword) { $sql_aux[] = "ClassifiedListing.title LIKE '$formated_pkeyword%'"; $sql_aux[] = "ClassifiedListing.title LIKE '%$formated_pkeyword'"; $sql_aux[] = "ClassifiedListing.title LIKE '%$formated_pkeyword%'"; } if($formated_skeyword) { $sql_aux[] = "ClassifiedListing.title LIKE '$formated_skeyword%'"; $sql_aux[] = "ClassifiedListing.title LIKE '%$formated_skeyword'"; $sql_aux[] = "ClassifiedListing.title LIKE '%$formated_skeyword%'"; } if($formated_thesaurus) { $sql_aux[] = "ClassifiedListing.title LIKE '$formated_thesaurus%'"; $sql_aux[] = "ClassifiedListing.title LIKE '%$formated_thesaurus'"; $sql_aux[] = "ClassifiedListing.title LIKE '%$formated_thesaurus%'"; } $sql_where_homes_rent[] = "(".(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 (ClassifiedListing.title) AGAINST (".$formated_keywords." IN BOOLEAN MODE) as search_priority1"; $sql_where_homes_rent[] = " MATCH (ClassifiedListing.title, ClassifiedListing.summarydesc, ClassifiedListing.detaildesc) 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_homes_rent[] = $whereZipCodeProximity; else $sql_where_homes_rent[] = "ClassifiedListing.zip_code = '".$zip."'"; } else { $sql_where_homes_rent[] = "ClassifiedListing.zip_code = '".$zip."'"; } } // ------------------------------------------- if ($sql_where_homes_rent) $where .= " ".implode(" AND ", $sql_where_homes_rent)." "; $order = ($formated_keywords) ? "ClassifiedListing.level DESC, search_priority1 DESC" : "ClassifiedListing.level DESC, ClassifiedListing.title, ClassifiedListing.id"; $return_columns = ($priority_sql) ? "ClassifiedListing.*, $priority_sql" : "ClassifiedListing.*"; $pageObj = new pageBrowsing("ClassifiedListing", $screen, 10, $order, "ClassifiedListing.title", $letter, $where, $return_columns, "ClassifiedListing"); $classifieds = $pageObj->retrievePage(); $paging_url = DEFAULT_URL."/homesforrentresults.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();"); # -------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------- # HEADER # ---------------------------------------------------------------------------------------------------- $extrastyle = array(DEFAULT_URL."/layout/classified_result.css", DEFAULT_URL."/layout/classified_color.css", DEFAULT_URL."/layout/classified_front.css"); $banner_section = "classified"; include(EDIRECTORY_ROOT."/layout/header.php"); ?>
Place your Free Homes for Rent Ads on this page


55 + Retirement Communities

Homes for Rent
getString("name"); } ?>