= 1) { while(list($cityid, $provinceid, $provincename, $cityname) = mysql_fetch_row($result)) { $city_id = $cityid; $province_id = $provinceid; $city_name = $cityname; $province_name = $provincename; //echo "$city_id,$province_id,$province_name,$city_name $city_id_list[] = $cityid; } } else { $result = mysql_query("SELECT city_id, province_id, city_name FROM city WHERE country_id = '".dbescape($country_id)."' AND city_name = '".dbstr(str_replace('_', ' ', $city))."'"); if (mysql_num_rows($result) >= 1) { list($city_id, $province_id, $city_name) = mysql_fetch_row($result); $result = mysql_query("SELECT province_name FROM province WHERE country_id = '".dbescape($country_id)."' AND province_id = '".dbescape($province_id)."'"); if (mysql_num_rows($result) >= 1) { list($province_name) = mysql_fetch_row($result); } } } } elseif ($province != '') { $result = mysql_query("SELECT province_id, province_name FROM province WHERE country_id = '".dbescape($country_id)."' AND province_name = '".dbstr(str_replace('_', ' ', $province))."'"); if (mysql_num_rows($result) == 1) { list($province_id, $province_name) = mysql_fetch_row($result); } elseif (mysql_num_rows($result) > 1) { while(list($provid, $provname) = mysql_fetch_row($result)) { $province_id_list[] = $provid; $province_id = $provid; $province_name = $provname; } } } } } elseif ($_REQUEST['country_id'] != '') { $result = mysql_query("SELECT country_name FROM country WHERE country_id = '".dbescape($_REQUEST['country_id'])."'"); if (mysql_num_rows($result) == 1) { list($country_name) = mysql_fetch_row($result); } $url = '/memberlocations.php?country='.cleanurl($country_name).'&code='.$_REQUEST['country_id']; //$url = "/memberlocations.php/".strtolower(str_replace(" ", "_", $country_name)).".htm".rsid(); header("Location: $url"); exit(); } $headerdata = array(); if ($city_name != '') { $headerdata[] = ucwords(strtolower($city_name)); } if ($province_name != '' && ($use_province || $city_name == "")) { $headerdata[] = ucwords(strtolower($province_name)); } if ($country_name != '') { //$pageheader .= ' / '.ucwords(strtolower($country_name)); $headerdata[] = ucwords(strtolower($country_name)); } if (count($headerdata) > 0) { $pageheader = join(' / ', $headerdata); $pagehtmlheader = $pageheader . " / Stay for Free"; $pageheader = "Members in $pageheader"; } if ($province_id != '') { $provsql = " AND province.province_id = '".dbescape($province_id)."'"; } if ($city_name != '') { $signuptext = ucwords(strtolower($city_name)); } elseif ($province_name != '') { $signuptext = ucwords(strtolower($province_name)); } elseif ($country_name != '') { $signuptext = ucwords(strtolower($country_name)); } else { $signuptext = "there"; } if ($city_name != "") { $pagesubheader = "Accommodation information in and around $city_name."; $inprefix = "in"; } else { if ($signuptext != "there") { $pagesubheader = "Looking for free accommodation in {$signuptext}?"; $inprefix = "in"; } } include($includedir.'top.inc'); ?>
Want to stay for free?

SIGN UP NOW!
  90 and length(details) < 350 order by rand() limit 1"); while(list($refuser, $refdetails) = mysql_fetch_row($result)) { echo '
'; $result2 = mysql_query("SELECT city_name, country_name, firstname FROM city, country, users WHERE city.city_id = users.city_id AND username = '".addslashes($refuser)."' AND city.country_id = country.country_id"); list($city_name, $country_name, $first_name) = mysql_fetch_row($result2); echo "\"$refdetails\"
$first_name, $country_name
"; echo "
"; } ?>
Want to stay for free?

SIGN UP NOW!


Rather than spend money on hotels, hostels or backpacker accommodation, take advantage of GlobalFreeloaders hospitality by staying with a fellow member for free! Not only do you get to save money - you also get to see from a local's perspective!

0) { $city_id = intval($city_id); $result = mysql_query("SELECT COUNT(*) FROM users WHERE city_id = $city_id"); list($numrows) = mysql_fetch_row($result); if ($numrows > 0) { echo "
All these GlobalFreeloaders members are in $city_name and may be available to host you while you're in the area. All you need to do is sign up to GlobalFreeloaders.com, and you could be arranging your stay in $city_name with them in minutes!
"; } query_table("SELECT description AS \"Meet people prepared to show you the best of $city_name!\" FROM users WHERE city_id = $city_id ORDER BY disabled, expired, LENGTH(description) DESC LIMIT 10"); } elseif ($province_id != '') { $result = mysql_query("SELECT city.city_id, province.province_id, province.province_name, city_name, COUNT(*) FROM users, city, province WHERE users.city_id = city.city_id AND city.province_id = province.province_id AND city.country_id = province.country_id AND city.country_id = '".dbescape($country_id)."' AND city.province_id = '".dbescape($province_id)."' GROUP BY 1,2,3,4 ORDER BY 4"); while(list($cid, $pid, $pname, $cname, $count) = mysql_fetch_row($result)) { $rows[] = array("city" => ''.$cname.'', "members" => $count); } $keys = array("city" => "City", "members" => "Members"); array_table($keys, $rows); } elseif ($country != '') { $result = mysql_query("SELECT users.city_id, city_name, province_id, COUNT(*) FROM users, city WHERE users.city_id = city.city_id AND country_id = '".dbescape($country_id)."' GROUP BY 1, 2, 3 ORDER BY 2"); while(list($cid, $cname, $pid, $count) = mysql_fetch_row($result)) { $provres = mysql_query("SELECT province_name FROM province WHERE province_id = '".dbescape($province_id)."' AND country_id = '".dbescape($country_id)."'"); if (mysql_num_rows($provres) == 1) { list($pname) = mysql_fetch_row($provres); } else { $pname = ''; } $rows[] = array("city" => ''.$cname.'', "members" => $count); } /* $result = mysql_query("SELECT city.city_id, province.province_id, province.province_name, city_name, COUNT(*) FROM users, city, province WHERE users.city_id = city.city_id AND city.province_id = province.province_id AND city.country_id = province.country_id AND city.country_id = '$country_id' GROUP BY 1,2,3,4 ORDER BY 4"); while(list($cid, $pid, $pname, $cname, $count) = mysql_fetch_row($result)) { $rows[] = array("city" => ''.$cname.'', "members" => $count); } */ $keys = array("city" => "City", "members" => "Members"); array_table($keys, $rows); } elseif (strlen($country_id) == 0) { if ($session != '') { $sessioncode = '&session='.$session; } $result = mysql_query("SELECT country.country_id, country_name, COUNT(*) FROM users, city, country WHERE users.city_id = city.city_id AND city.country_id = country.country_id GROUP BY 1,2 ORDER BY 2"); while(list($cid, $cname, $count) = mysql_fetch_row($result)) { $rows[] = array("country" => ''.$cname.'', "members" => $count); } $keys = array("country" => "Country", "members" => "Members"); array_table($keys, $rows); //$sqlqry = "SELECT CONCAT(\"\", country_name, \"\") AS \"Country\", COUNT(*) AS \"Members\" FROM users,city,country WHERE users.city_id=city.city_id AND city.country_id=country.country_id GROUP BY 1"; //query_table($sqlqry." ORDER BY country_name"); } /* elseif (count($city_id_list) > 0) { query_table("SELECT description AS \"Accommodation Information in $city_name\" FROM users WHERE city_id IN ( ".join(',', $city_id_list).") ORDER BY disabled, expired, RAND() LIMIT 10"); } elseif ($city_id > 0) { // do nothing query_table("SELECT description AS \"Accommodation Information in $city_name\" FROM users WHERE city_id = $city_id ORDER BY disabled, expired, RAND() LIMIT 10"); } else { // "SELECT CONCAT(\"\", city_name, \"\") AS \"City\" $sqlqry = "SELECT CONCAT(\"\", city_name, \"\") AS \"City\", COUNT(*) AS \"Members\" FROM users,city,province,country WHERE city.province_id = province.province_id AND province.country_id = country.country_id AND users.city_id=city.city_id AND city.country_id = province.country_id AND country.country_id='$country_id' $provsql GROUP BY 1"; //$sqlqry = "SELECT CONCAT(LOWER(REPLACE(country_name, \" \", \"_\")), \"/\", LOWER(REPLACE(province_name, \" \", \"_\")), \"/\", LOWER(REPLACE(city_name, \" \", \"_\"))) AS \"City\", COUNT(*) AS \"Members\" FROM users,city,province,country WHERE city.province_id = province.province_id AND province.country_id = country.country_id AND users.city_id=city.city_id AND city.country_id = province.country_id AND country.country_id='$country_id' $provsql GROUP BY 1"; //echo "$sqlqry
"; query_table($sqlqry." ORDER BY city_name"); } */ ?>




'; echo 'View all countries
'; if ($province_id != '') { echo 'All cities in '.ucwords(strtolower($country_name)).'
'; } if ($city_id != '' && $province_name != '') { echo 'All cities in '.ucwords(strtolower($province_name)).'
'; } echo '
'; $result = mysql_query($qry = "SELECT province.province_id, province_name, COUNT(*) FROM users, city, province WHERE users.city_id = city.city_id AND city.province_id = province.province_id AND city.country_id = province.country_id AND province.country_id = '$country_id' GROUP BY 1, 2 ORDER BY 2"); while(list($provid, $provname, $count) = mysql_fetch_row($result)) { if ($provid == $province_id) { echo ucwords(strtolower($provname))."
"; } else { echo ''.ucwords(strtolower($provname)).'
'; } } /* if ($city_id == 0) { echo "

The Top Five
"; query_table($sqlqry." ORDER BY 2 DESC LIMIT 5", 1, 0, "left"); echo "
"; } */ $rows = array(); $result = mysql_query("SELECT users.city_id, city_name, province_id, COUNT(*) FROM users, city WHERE users.city_id = city.city_id AND country_id = '$country_id' GROUP BY 1, 2, 3 ORDER BY 4 DESC LIMIT 5"); while(list($cid, $cname, $pid, $count) = mysql_fetch_row($result)) { $rows[] = array("city" => ''.$cname.'', "members" => $count); } $keys = array("city" => "City", "members" => "Members"); echo "

Top Five in ".$country_name."
"; array_table($keys, $rows, 1, 0, "left"); ?>
*/