'; if (SITETITLE) { printf (' %s', SITETITLE); } foreach ($features as $feature) { $id = $feature->id; $title = htmlspecialchars ($feature->title, ENT_QUOTES); $description = htmlspecialchars ($feature->description, ENT_QUOTES); $imgurl = ($feature->imgpath ? image_url_from_imgpath ($feature->imgpath) : ""); $thumburl = ($feature->imgpath ? thumb_url_from_imgpath ($feature->imgpath) : ""); $lon = $feature->lon; $lat = $feature->lat; $alt = (strlen ($title) > 60) ? (substr ($title, 0, 57) . '...') : $title; if ($imgurl) { $imgurlHTML = sprintf ('%s', $imgurl, $alt, $thumburl); } else { $imgurlHTML = ""; } if ($description) { $descriptionHTML = sprintf ('

%s

', $description) ; } else { $descriptionHTML = ""; } printf (' %s %s,%s ', $id, $title, $descriptionHTML, $imgurlHTML, $lon, $lat); } echo'
'; } try { $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX); $features = $connection->listfeatures (); } catch (Exception $e) { exit ("server error"); } header ("Content-type: application/vnd.google-earth.kml+xml"); main ($features); ?>