$residential = "http://www.thumbprintcms.com/idx/listings-residential.txt"; $condo_townhomes = "http://www.thumbprintcms.com/idx/listings-condo_townhouse.txt"; $multifamily = "http://www.thumbprintcms.com/idx/listings-multi-family.txt"; $commercial = "http://www.thumbprintcms.com/idx/listings-commercial.txt"; $land = "http://www.thumbprintcms.com/idx/listings-land.txt"; $count = 0; $handle = @fopen($residential, "r"); // Open file form read. if ($handle) { while (!feof($handle)) // Loop til end of file. { $buffer = fgets($handle, 4096); // Read a line. $delimiter = "\t"; $splitcontents = explode($delimiter, $buffer); if (strtoupper($splitcontents[100]) == "BIRD, PAIGE") { $mlsid[$count] = $splitcontents[0]; $type[$count] = "residential"; $price[$count] = $splitcontents[4]; $listprice[$count] = $splitcontents[4]; $pricelength = strlen($listprice[$count]); if($pricelength <= 6) $listprice[$count] = substr($listprice[$count], 0, $pricelength - 3) . "," . substr($listprice[$count], $pricelength - 3, 3); else $listprice[$count] = substr($listprice[$count], 0, $pricelength - 6) . "," . substr($listprice[$count], $pricelength - 6, 3) . "," . substr($listprice[$count], $pricelength - 3,3); $city[$count] = $splitcontents[9]; $state[$count] = $splitcontents[10]; $construction[$count] = $splitcontents[2]; $bedrooms[$count] = $splitcontents[14]; $baths[$count] = $splitcontents[15]; $halfbaths[$count] = $splitcontents[16]; $units[$count] = $splitcontents[14]; $lotsize[$count] = $splitcontents[38]; $space[$count] = substr($splitcontents[53],8) ."00"; $agent[$count] = $splitcontents[100]; $agency[$count] = $splitcontents[102]; $subdivision[$count] = $splitcontents[37]; $description[$count] = $splitcontents[63]; $livingroom[$count] = $splitcontents[46]; $diningroom[$count] = $splitcontents[47]; $kitchen[$count] = $splitcontents[48]; $master[$count] = $splitcontents[49]; $bedroom1[$count] = $splitcontents[50]; $bedroom2[$count] = $splitcontents[51]; $count++; } } fclose($handle); // Close the file. } $handle = @fopen($condo_townhomes, "r"); // Open file form read. if ($handle) { while (!feof($handle)) // Loop til end of file. { $buffer = fgets($handle, 4096); // Read a line. $delimiter = "\t"; $splitcontents = explode($delimiter, $buffer); if (strtoupper($splitcontents[23]) == "BIRD, PAIGE") { $mlsid[$count] = $splitcontents[0]; $type[$count] = "condo_townhome"; $price[$count] = $splitcontents[4]; $listprice[$count] = $splitcontents[4]; $pricelength = strlen($listprice[$count]); if($pricelength <= 6) $listprice[$count] = substr($listprice[$count], 0, $pricelength - 3) . "," . substr($listprice[$count], $pricelength - 3, 3); else $listprice[$count] = substr($listprice[$count], 0, $pricelength - 6) . "," . substr($listprice[$count], $pricelength - 6, 3) . "," . substr($listprice[$count], $pricelength - 3,3); $city[$count] = $splitcontents[9]; $state[$count] = $splitcontents[10]; $construction[$count] = $splitcontents[2]; $bedrooms[$count] = $splitcontents[14]; $baths[$count] = $splitcontents[15]; $halfbaths[$count] = $splitcontents[16]; $units[$count] = $splitcontents[14]; $lotsize[$count] = $splitcontents[38]; $space[$count] = substr($splitcontents[55],8) ."00"; $agent[$count] = $splitcontents[23]; $agency[$count] = $splitcontents[26]; $description[$count] = $splitcontents[66]; $livingroom[$count] = $splitcontents[48]; $diningroom[$count] = $splitcontents[49]; $kitchen[$count] = $splitcontents[50]; $master[$count] = $splitcontents[51]; $bedroom1[$count] = $splitcontents[52]; $bedroom2[$count] = $splitcontents[53]; $building[$count] = $splitcontents[53]; $subdivision[$count] = $splitcontents[37]; $count++; } } fclose($handle); // Close the file. } $handle = @fopen($multifamily, "r"); // Open file form read. if ($handle) { while (!feof($handle)) // Loop til end of file. { $buffer = fgets($handle, 4096); // Read a line. $delimiter = "\t"; $splitcontents = explode($delimiter, $buffer); if (strtoupper($splitcontents[16]) == "BIRD, PAIGE") { $mlsid[$count] = $splitcontents[0]; $type[$count] = "multifamily"; $price[$count] = $splitcontents[4]; $listprice[$count] = $splitcontents[4]; $pricelength = strlen($listprice[$count]); if($pricelength <= 6) $listprice[$count] = substr($listprice[$count], 0, $pricelength - 3) . "," . substr($listprice[$count], $pricelength - 3, 3); else $listprice[$count] = substr($listprice[$count], 0, $pricelength - 6) . "," . substr($listprice[$count], $pricelength - 6, 3) . "," . substr($listprice[$count], $pricelength - 3,3); $city[$count] = $splitcontents[9]; $state[$count] = $splitcontents[10]; $construction[$count] = $splitcontents[2]; $bedrooms[$count] = $splitcontents[14]; $baths[$count] = $splitcontents[15]; $halfbaths[$count] = $splitcontents[16]; $units[$count] = $splitcontents[14]; $lotsize[$count] = $splitcontents[30]; $space[$count] = substr($splitcontents[51],8) ."00"; $agent[$count] = $splitcontents[16]; $agency[$count] = $splitcontents[19]; $subdivison[$count] = $splitcontents[31]; $description[$count] = $splitcontents[84]; $count++; } } fclose($handle); // Close the file. } $handle = @fopen($commercial, "r"); // Open file form read. if ($handle) { while (!feof($handle)) // Loop til end of file. { $buffer = fgets($handle, 4096); // Read a line. $delimiter = "\t"; $splitcontents = explode($delimiter, $buffer); if (strtoupper($splitcontents[24]) == "BIRD, PAIGE") { $mlsid[$count] = $splitcontents[0]; $type[$count] = "commercial"; $price[$count] = $splitcontents[4]; $listprice[$count] = $splitcontents[4]; $pricelength = strlen($listprice[$count]); if($pricelength <= 6) $listprice[$count] = substr($listprice[$count], 0, $pricelength - 3) . "," . substr($listprice[$count], $pricelength - 3, 3); else $listprice[$count] = substr($listprice[$count], 0, $pricelength - 6) . "," . substr($listprice[$count], $pricelength - 6, 3) . "," . substr($listprice[$count], $pricelength - 3,3); $city[$count] = $splitcontents[9]; $state[$count] = $splitcontents[10]; $construction[$count] = $splitcontents[2]; $salelease[$count] = $splitcontents[14]; $presentuse[$count] = $splitcontents[15]; $businessoffered[$count] = $splitcontents[16]; $units[$count] = $splitcontents[60]; $lotsize[$count] = $splitcontents[38]; $space[$count] = substr($splitcontents[52],8) ."00"; $agent[$count] = $splitcontents[24]; $agency[$count] = $splitcontents[27]; $description[$count] = $splitcontents[67]; $buildings[$count] = $splitcontents[58]; $count++; } } fclose($handle); // Close the file. } $handle = @fopen($land, "r"); // Open file form read. if ($handle) { while (!feof($handle)) // Loop til end of file. { $buffer = fgets($handle, 4096); // Read a line. $delimiter = "\t"; $splitcontents = explode($delimiter, $buffer); if (strtoupper($splitcontents[18]) == "BIRD, PAIGE") { $mlsid[$count] = $splitcontents[0]; $type[$count] = "land"; $price[$count] = $splitcontents[4]; $listprice[$count] = $splitcontents[4]; $pricelength = strlen($listprice[$count]); if($pricelength <= 6) $listprice[$count] = substr($listprice[$count], 0, $pricelength - 3) . "," . substr($listprice[$count], $pricelength - 3, 3); else $listprice[$count] = substr($listprice[$count], 0, $pricelength - 6) . "," . substr($listprice[$count], $pricelength - 6, 3) . "," . substr($listprice[$count], $pricelength - 3,3); $city[$count] = $splitcontents[9]; $state[$count] = $splitcontents[10]; $construction[$count] = $splitcontents[2]; $bedrooms[$count] = $splitcontents[14]; $baths[$count] = $splitcontents[15]; $halfbaths[$count] = $splitcontents[16]; $units[$count] = $splitcontents[14]; $lotsize[$count] = $splitcontents[14]; $space[$count] = substr($splitcontents[52],8) . "00"; $agent[$count] = $splitcontents[18]; $agency[$count] = $splitcontents[21]; $lots[$count] = $splitcontents[16]; $subdivision[$count] = $splitcontents[32]; $description[$count] = $splitcontents[48]; $zoned[$count] = $splitcontents[33]; $count++; break; } } fclose($handle); // Close the file. } array_multisort($mlsid, SORT_ASC, $price, $city, $state, $construction, $bedrooms, $baths, $halfbaths, $agency, $type, $units, $lotsize, $space, $listprice); ?>
| MLS #
=$mlsid[$counter]?> List Price: $=$listprice[$counter]?> =$city[$counter] . ", " . $state[$counter]?> |
Type:
=$construction[$counter]?> Bedrooms: =$bedrooms[$counter]?> Baths: =$baths[$counter]?> Half Baths: =$halfbaths[$counter]?> |
Listing courtesy of: =$agency[$counter]?> Listing Agent: =$agent[$counter]?> |
break; case "multifamily": ?>
| MLS #
=$mlsid[$counter]?> List Price: $=$listprice[$counter]?> =$city[$counter] . ", " . $state[$counter]?> |
Type:
=$construction[$counter]?> Units: =$units[$counter]?> |
Listing courtesy of: =$agency[$counter]?> Listing Agent: =$agent[$counter]?> |
break; case "land": ?>
| MLS #
=$mlsid[$counter]?> List Price: $=$listprice[$counter]?> =$city[$counter] . ", " . $state[$counter]?> |
Type:
=$construction[$counter]?> Lot Size (acres): =$lotsize[$counter]?> |
Listing courtesy of: =$agency[$counter]?> Listing Agent: =$agent[$counter]?> |
break; case "commercial": ?>
| MLS #
=$mlsid[$counter]?> List Price: $=$listprice[$counter]?> =$city[$counter] . ", " . $state[$counter]?> |
Type:
=$construction[$counter]?> Lot Size: =$lotsize[$counter]?> Area (sqft): =$space[$counter]?> |
Listing courtesy of: =$agency[$counter]?> Listing Agent: =$agent[$counter]?> |
break;
}
} ?>