load('MISC'); require('./includes/googlemapconfig.php'); require('./includes/googlemapapi.class.php'); $options = ''; //Google Map API-PHP-Class-Settings: $map = new GoogleMapAPI('map'); $map->setAPIKey($owngoogleapi); $map->setWidth($owngooglewidth); $map->setHeight($owngoogleheight); $map->setZoomLevel($owngooglezoom); $map->setControlSize = $owngooglecontrols; $map->setMapType($owngoogletype); $map->disableDirections(); $map->disableZoomEncompass(); /* get own location*/ $locresult = mysql_query("SELECT * FROM bb".$n."_gmap WHERE user_id='".$wbbuserdata['userid']."'"); while($locrow = mysql_fetch_array($locresult)) { $ownlon = $locrow['longitude']; $ownlat = $locrow['latitude']; } $c = 1; /* get user-locations*/ $locresult = mysql_query("SELECT * FROM bb".$n."_gmap, bb".$n."_users WHERE userid = user_id AND user_id != '".$wbbuserdata['userid']."' ORDER BY username"); while($locrow = mysql_fetch_array($locresult)) { if($c == 0){ $tstyle = "a"; $c++; }else{ $tstyle = "b"; $c--; } //Distanz berechnen if(isset($wbbuserdata['userid']) && isset($ownlon)){ $user_dis = round($map->geoGetDistance($ownlat,$ownlon,$locrow['latitude'],$locrow['longitude'],"k"),2); } //User-Infos abrufen $useriresult = mysql_query("SELECT userid,username FROM bb".$n."_users WHERE userid='".addslashes($locrow['user_id'])."'"); while($userirow = mysql_fetch_array($useriresult)) { $username = $userirow['username']; } /* Userfield-Information abrufen*/ if(!empty($owngoogleechofield)) { $userresult = mysql_query("SELECT * FROM bb".$n."_userfields WHERE userid='".addslashes($locrow['user_id'])."'"); while($userrow = mysql_fetch_array($userresult)) { $adress_tpl = $userrow[$owngoogleechofield]; } } else { $adress_tpl = "n/a"; } $user_id = $locrow['user_id']; eval("\$gmap_user_near .= \"".$tpl->get("gmap_user_near")."\";"); } eval("\$tpl->output(\"".$tpl->get("gmap_near")."\");"); } elseif($action == "nearusers" && $wbbuserdata['can_myro_member'] != 1) { access_error(); } /** GMap */ if($action == "map" && $wbbuserdata['can_myro_member']) { $lang->load('MISC'); require('./includes/googlemapconfig.php'); require('./includes/googlemapapi.class.php'); $options = ''; //Google Map API-PHP-Class-Settings: $map = new GoogleMapAPI('map'); $map->setAPIKey($owngoogleapi); $map->setWidth($owngooglewidth); $map->setHeight($owngoogleheight); $map->setZoomLevel($owngooglezoom); $map->setControlSize = $owngooglecontrols; $map->setMapType($owngoogletype); $map->disableDirections(); $map->disableZoomEncompass(); $map->setLookupService('GOOGLE'); /* user-location speichern */ if(isset($_REQUEST['save']) && $_REQUEST['save'] == 1 && !isset($_POST['send2'])) { list($cmenge) = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM bb".$n."_gmap WHERE user_id='".$wbbuserdata['userid']."'")); if($cmenge == 1) { //Update $db->query("UPDATE bb".$n."_gmap SET longitude='".addslashes($_REQUEST['lon'])."', latitude='".addslashes($_REQUEST['lat'])."' WHERE user_id='".$wbbuserdata['userid']."'"); } else { //Insert $db->query("INSERT INTO bb".$n."_gmap (user_id,longitude,latitude) VALUES (".$wbbuserdata['userid'].",".addslashes($_REQUEST['lon']).",".addslashes($_REQUEST['lat']).")"); } } /* get own location*/ $locresult = mysql_query("SELECT * FROM bb".$n."_gmap WHERE user_id='".$wbbuserdata['userid']."'"); while($locrow = mysql_fetch_array($locresult)) { $ownlon = $locrow['longitude']; $ownlat = $locrow['latitude']; } //Variablen & Standardmarker $c = 1; $ac = 0; $map->setMarkerIcon('http://www.google.com/mapfiles/marker.png','',-5,20,10,10); /* get user-locations*/ $locresult = mysql_query("SELECT * FROM bb".$n."_gmap, bb".$n."_users WHERE userid = user_id ORDER BY username"); while($locrow = mysql_fetch_array($locresult)) { //User-Infos abrufen $useriresult = mysql_query("SELECT userid,username FROM bb".$n."_users WHERE userid='".addslashes($locrow['user_id'])."'"); while($userirow = mysql_fetch_array($useriresult)) { $username = $userirow['username']; } /* Userfield-Information abrufen*/ $userresult = mysql_query("SELECT * FROM bb".$n."_userfields WHERE userid='".addslashes($locrow['user_id'])."'"); while($userrow = mysql_fetch_array($userresult)) { if(!empty($userrow[$owngoogleechofield])) $adress = $userrow[$owngoogleechofield]; } if(!isset($adress) OR isset($adress) && empty($adress)) $adress = "n/a"; $marker_text = "'".$username."
"; $marker_text .= "Adresse: ".$adress."
"; //Distanz berechnen if(isset($wbbuserdata['userid']) && isset($ownlon)){ $user_dis = round($map->geoGetDistance($ownlat,$ownlon,$locrow['latitude'],$locrow['longitude'],"k"),2); $marker_text .= "Entfernung: "; $marker_text .= $user_dis; $marker_text .= " km
"; } $marker_text .= "
Zum Profil »
'"; //Marker in Map einfügen $map->addMarkerByCoords(stripslashes($locrow['longitude']),stripslashes($locrow['latitude']),$username,$marker_text); //Tabelle (User near) if($locrow['user_id'] != $wbbuserdata['userid']) { $nearusers[$ac] = $locrow['user_id']."|".$user_dis."|".$username."|".substr($adress,0,100); $ac++; } unset($username); unset($adress); } //Near-User-List ausgeben (10 Einträge) @sort($nearusers); $c = 1; for($x=0;$x<=10;$x++) { if($c == 0){ $tstyle = "a"; $c++; }else{ $tstyle = "b"; $c--; } list($user_id,$user_dis,$username,$adress_tpl) = explode("|",$nearusers[$x]); eval("\$gmap_user_near .= \"".$tpl->get("gmap_user_near")."\";"); } /*get highlight-user-information*/ if(isset($_REQUEST['huid']) && $_REQUEST['huid'] != "") { $huserresult = mysql_query("SELECT * FROM bb".$n."_gmap WHERE user_id='".addslashes($_REQUEST['huid'])."'"); while($huserrow = mysql_fetch_array($huserresult)) { if(isset($wbbuserdata['userid']) && isset($ownlon)){ $map->addPolyLineByCoords($huserrow['longitude'],$huserrow['latitude'],$ownlon,$ownlat,'#ff0000',5,50); } $map->setCenterCoords($huserrow['longitude'],$huserrow['latitude']); $map->setZoomLevel(18); } } elseif(isset($_POST['send2']) && $_POST['send2'] == "Suchen" && isset($_POST['searchfield']) && !empty($_POST['searchfield']) && $_POST['searchfield'] != "Straße.Nr, PLZ Ort, Land") { $geocode = $map->getGeocode($_POST['searchfield']); if(!empty($geocode['lon']) && !empty($geocode['lat'])) { $map->addMarkerByCoords($geocode['lon'],$geocode['lat'],"0_Suchergebnis","Ergebnis für Suche nach ".$_POST['searchfield']."

Als eigene Position speichern
"); $map->setCenterCoords($geocode['lon'],$geocode['lat']); $map->setZoomLevel(18); } else { $map->addMarkerByCoords('9.624023','50.930738',"0_Kein Ergebnis","Zu Ihrer Suche wurde leider kein Ergebnis gefunden."); $map->setCenterCoords('9.624023','50.930738'); $map->setZoomLevel($owngooglezoom); } } else { $map->setCenterCoords('9.624023','50.930738'); $map->setZoomLevel($owngooglezoom); } //PHP-Class-Ausgabe $headerjs = $map->getHeaderJS(); $onload = $map->getOnLoad(); $mapjs = $map->getMapJS(); $sidebar = $map->getSidebar(); $map = $map->getMap(); if(isset($ownlon)) $sendlb = $lang->get("LANG_MISC_OWN_EDIT"); else $sendlb = $lang->get("LANG_MISC_OWN_SAVE"); eval("\$tpl->output(\"".$tpl->get("gmap_php")."\");"); } elseif($action == "map" && $wbbuserdata['can_myro_member'] != 1) { access_error(); } /** ENDE: GOOGLEMAP USER-MAP (01-SCRIPTS.DE) */ ?>