assign("title", "Camping & Campsites - Campsite finder"); $page->assign("meta_description", "Our google maps based campsite finder application, makes it as easy as possible to find your ideal campsite"); $page->sub_template("menu.tpl", "menu"); $page->assign("finder_link", "menu_selected"); $page->assign("rel_path", '/'); $headers = ' '; $page->assign("headers", $headers); $unload = 'GUnload();'; $page->assign("unload", $unload); $onload = 'load(); '; //set a browse to position if($_POST["location"]) { $onload .= "centreMap('".$_POST["location"].", uk'); "; } else if($_GET['location']) { $onload .= "centreMap('".$_GET["location"].", uk'); "; } $content .= '



'; //$postcode_xml = file_get_contents("http://ws.geonames.org/postalCodeSearch?postalcode=co3"); //$codes = get_xmlvalue_multi("code", $postcode_xml); //$lat = get_xmlvalue("lat", $codes[1]); //$lng = get_xmlvalue("lng", $codes[1]); //$content .= 'map.addOverlay(createMarker(new GLatLng('.$lat.', '.$lng.'), 2));
lng = '.$lng.'
lat = '.$lat.'

'; /* function remove_spaces($input) { $input = nl2br($input); $input = addslashes($input); $input = trim($input); $input = str_replace("\r", "", $input); $input = str_replace(" ", "", $input); $input = str_replace(" ", "", $input); return $input; } $query = mysql_query("select *, campsites.postcode from campsites left join postcode_cache on campsites.postcode = postcode_cache.postcode where campsites.enabled = 1 limit 10;"); $onload .= 'var batch = []; '; while($result = mysql_fetch_array($query)) { $info = ''.remove_spaces(stripslashes($result["name"])).'
'; $info .= remove_spaces($result["address"]).'
'.$result["postcode"]; if($result["tel"]) { $info .= '

Tel: '.$result["tel"]; } if($result["tel_alt"]) { $info .= '
Tel: '.$result["tel_alt"]; } if($result["fax"]) { $info .= '
Fax: '.$result["fax"]; } if($result["email"]) { $info .= '
Email: '.$result["email"].''; } if($result["open_times"]) { $info .= '
Open: '.remove_spaces($result["open_times"]); } $info .= '

More info'; if($result["url"]) { $info .= '

Website'; } $info .= '

'; if(!empty($result["lng"]) && !empty($result["lat"])) { $onload .= 'batch.push(drawMarker(new GLatLng('.$result["lat"].', '.$result["lng"].'))); '; } else { //$onload .= 'usePointFromPostcode(\''.$result["postcode"].'\', newMarker, \''.$info.'\'); '; } } $onload .= 'mgr.addMarkers(batch, 9); mgr.refresh(); '; //$onload .= 'usePointFromPostcode(\'IP13 0SJ\', newMarker); '; */ $breadcrumbs = array( array("name" => 'Campsite finder', "link" => '') ); $page->add_breadcrumbs($breadcrumbs); $page->assign("content", $content); $page->assign("onload", $onload); $page->display(); ?>