so ich hab das ganze noch mal umgeändert da ich es an meine profil_edit.php und profil_edit.ht, anpassen musste nun hab ich aber folgendes Problem:
Er erkennt die Wohnorte nicht, also er sagt nichts dazu weder hat erkannt oder nicht erkannt.
hier die originalen dateien:
include/contents/user/profil_edit.php
<?php
defined ('main') or die ('no direct access');
require_once("googlemap/config.php");
$title = $allgAr['title'] . ' :: Googlemap';
$hmenu = 'Googlemap';
$design = new design ($title , $hmenu);
$design->header();
$tpl = new tpl ('googlemap.htm');
$tpl->out(0);
ob_start();
?>
<script src="http://maps.google.com/maps?hl=de&file=api&v=2&key=<?php echo GOOGLE_MAP_KEY; ?>" type="text/javascript"></script>
<script type="text/javascript">
var iconmember = new GIcon();
iconmember.shadow = "include/contents/googlemap/images/mm_20_shadow.png";
iconmember.iconSize = new GSize(12, 20);
iconmember.shadowSize = new GSize(22, 20);
iconmember.iconAnchor = new GPoint(6, 20);
iconmember.infoWindowAnchor = new GPoint(5, 1);
<?php
switch (strtoupper(GOOGLE_MAP_MEMBERPIN_COLOR)) {
case "BLUE" : echo 'iconmember.image = "include/contents/googlemap/images/mm_20_blue.png";';
break;
case "GREEN" : echo 'iconmember.image = "include/contents/googlemap/images/mm_20_green.png";';
break;
case "YELLOW" : echo 'iconmember.image = "include/contents/googlemap/images/mm_20_yellow.png";';
break;
default : echo 'iconmember.image = "include/contents/googlemap/images/mm_20_blue.png";';
break;
}
?>
var iconuser = new GIcon();
iconuser.shadow = "include/contents/googlemap/images/mm_20_shadow.png";
iconuser.iconSize = new GSize(12, 20);
iconuser.shadowSize = new GSize(22, 20);
iconuser.iconAnchor = new GPoint(6, 20);
iconuser.infoWindowAnchor = new GPoint(5, 1);
<?php
switch (strtoupper(GOOGLE_MAP_USERPIN_COLOR)) {
case "BLUE" : echo 'iconuser.image = "include/contents/googlemap/images/mm_20_blue.png";';
break;
case "GREEN" : echo 'iconuser.image = "include/contents/googlemap/images/mm_20_green.png";';
break;
case "YELLOW" : echo 'iconuser.image = "include/contents/googlemap/images/mm_20_yellow.png";';
break;
default : echo 'iconuser.image = "include/contents/googlemap/images/mm_20_green.png";';
break;
}
switch (strtoupper(GOOGLE_MAP_LEADERPIN_COLOR)) {
case "TRUE" : echo 'var iconleader = new GIcon();';
echo 'iconleader.image = "include/contents/googlemap/images/mm_20_red.png";';
echo 'iconleader.shadow = "include/contents/googlemap/images/mm_20_shadow.png";';
echo 'iconleader.iconSize = new GSize(12, 20);';
echo 'iconleader.shadowSize = new GSize(22, 20);';
echo 'iconleader.iconAnchor = new GPoint(6, 20);';
echo 'iconleader.infoWindowAnchor = new GPoint(5, 1);';
break;
default : echo 'var iconleader = iconuser;';
break;
}
?>
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.enableDoubleClickZoom();
<?php
switch (strtoupper(GOOGLE_MAP_REGION)) {
case "EUROPE" : echo 'map.setCenter(new GLatLng(48.8, 8.5), 4);';
break;
case "NORTH AMERICA" : echo 'map.setCenter(new GLatLng(45.0, -97.0), 3);';
break;
case "SOUTH AMERICA" : echo 'map.setCenter(new GLatLng(-14.8, -61.2), 3);';
break;
case "NORTH AFRICA" : echo 'map.setCenter(new GLatLng(25.4, 8.4), 4);';
break;
case "SOUTH AFRICA" : echo 'map.setCenter(new GLatLng(-29.0, 23.7), 5);';
break;
case "NORTH EUROPE" : echo 'map.setCenter(new GLatLng(62.6, 15.4), 4);';
break;
case "EAST EUROPE" : echo 'map.setCenter(new GLatLng(51.9, 31.8), 4);';
break;
case "GERMANY" : echo 'map.setCenter(new GLatLng(51.1, 10.1), 5);';
break;
case "FRANCE" : echo 'map.setCenter(new GLatLng(47.2, 2.4), 5);';
break;
case "SPAIN" : echo 'map.setCenter(new GLatLng(40.3, -4.0), 5);';
break;
case "UNITED KINGDOM" : echo 'map.setCenter(new GLatLng(54.0, -4.3), 5);';
break;
case "DENMARK" : echo 'map.setCenter(new GLatLng(56.1, 9.2), 6);';
break;
case "SWEDEN" : echo 'map.setCenter(new GLatLng(63.2, 16.3), 4);';
break;
case "NORWAY" : echo 'map.setCenter(new GLatLng(65.6, 13.1), 4);';
break;
case "FINLAND" : echo 'map.setCenter(new GLatLng(65.1, 26.6), 4);';
break;
case "NETHERLANDS" : echo 'map.setCenter(new GLatLng(52.3, 5.4), 7);';
break;
case "BELGIUM" : echo 'map.setCenter(new GLatLng(50.7, 4.5), 7);';
break;
case "SUISSE" : echo 'map.setCenter(new GLatLng(46.8, 8.2), 7);';
break;
case "AUSTRIA" : echo 'map.setCenter(new GLatLng(47.7, 14.1), 7);';
break;
case "POLAND" : echo 'map.setCenter(new GLatLng(52.1, 19.3), 6);';
break;
case "ITALY" : echo 'map.setCenter(new GLatLng(42.6, 12.7), 5);';
break;
case "TURKEY" : echo 'map.setCenter(new GLatLng(39.0, 34.9), 6);';
break;
case "BRAZIL" : echo 'map.setCenter(new GLatLng(-12.0, -53.1), 4);';
break;
case "ARGENTINA" : echo 'map.setCenter(new GLatLng(-34.3, -65.7), 3);';
break;
case "RUSSIA" : echo 'map.setCenter(new GLatLng(65.7, 98.8), 3);';
break;
case "ASIA" : echo 'map.setCenter(new GLatLng(20.4, 95.6), 3);';
break;
case "CHINA" : echo 'map.setCenter(new GLatLng(36.2, 104.0), 4);';
break;
case "JAPAN" : echo 'map.setCenter(new GLatLng(36.2, 136.8), 5);';
break;
case "SOUTH KOREA" : echo 'map.setCenter(new GLatLng(36.6, 127.8), 6);';
break;
case "AUSTRALIA" : echo 'map.setCenter(new GLatLng(-26.1, 134.8), 4);';
break;
case "CANADA" : echo 'map.setCenter(new GLatLng(60.0, -97.0), 3);';
break;
case "WORLD" : echo 'map.setCenter(new GLatLng(25.0, 8.5), 2);';
break;
default : echo 'map.setCenter(new GLatLng(47.7, 14.1), 7);';
break;
}
switch (strtoupper(GOOGLE_MAP_TYPE)) {
case "SATELLITE" : echo 'map.setMapType(G_SATELLITE_MAP);';
break;
case "MAP" : echo 'map.setMapType(G_NORMAL_MAP);';
break;
default: case "HYBRID": echo 'map.setMapType(G_HYBRID_MAP);';
break;
}
?>
var user = new Array();
var bounds = new GLatLngBounds();
var marker = new Array();
var html_text = new Array();
<?php
$where = '';
if ($menu->getA(1) == 'u') {
$where .= ' AND a.id = ' . $menu->getE(1) . ' ';
} elseif ($menu->getA(1) == 'g') {
$where .= ' AND b.gid = ' . $menu->getE(1) . ' ';
}
$db = db_query("SELECT a.id, a.name, a.staat, a.gmapkoords, a.wohnort, MIN(b.fid) AS fid
FROM prefix_user a
LEFT JOIN prefix_groupusers b ON a.id = b.uid
WHERE a.name <> '' AND a.wohnort <> '' AND a.gmapkoords <> '' $where
GROUP BY a.id, a.name, a.staat, a.gmapkoords, a.wohnort");
$i = 0;
while ($rowdata = db_fetch_assoc($db)) {
$search_pattern = array("/[^A-Za-z0-9\[\]*.,=()!\"$%&^`´':;ß²³#+~_\-|<>\/@{}äöüÄÖÜ ]/");
$replace_pattern = array("");
$rowdata['name'] = preg_replace($search_pattern, $replace_pattern, $rowdata['name']);
$search_pattern = "/.gif/";
$replace_pattern = "";
$rowdata['staat'] = preg_replace($search_pattern, $replace_pattern, $rowdata['staat']);
$pinicon = 1;
if ($rowdata['fid'] >= 1 AND $rowdata['fid'] <= 2) {
$pinicon = 3;
} elseif ($rowdata['fid'] > 2) {
$pinicon = 2;
}
echo "\nuser[" . $i . "] = new Object();\n";
echo "user[" . $i . "]['id'] = " . $rowdata['id'] . ";\n";
echo "user[" . $i . "]['pinicon'] = " . $pinicon . ";\n";
echo "user[" . $i . "]['name'] = '" . $rowdata['name'] . "';\n";
echo "user[" . $i . "]['city'] = '" . $rowdata['wohnort'] . "';\n";
echo "user[" . $i . "]['country'] = '" . $rowdata['staat'] . "';\n";
echo "user[" . $i . "]['latlng'] = new GLatLng" . $rowdata['gmapkoords'] . ";\n";
$i++;
}
if ($i == 0) {
echo 'map.openInfoWindow(map.getCenter(), document.createTextNode("Keine Einträge für Karte gefunden."));';
}
?>
function createMarker(userindex, maxindex) {
var addmarker = 0;
var act_latlng = ""+user[userindex]['latlng'];
html_text[userindex] = '<table border=0 style="text-align:left;"><tr><td colspan="2" align="left" style="border-bottom:1px solid black;"><a href="index.php?user-details-'+user[userindex]['id']+'" style="color:blue;font-weight:bold;text-decoration:none;"><small>'+user[userindex]['name']+'</small></a></td></tr>'+
'<tr><td><small><span style="color: black;">Location</span></small></td><td><small><span style="color: black;">'+user[userindex]['city']+', '+user[userindex]['country']+'</span><small></td></tr>'+
'</table>';
if (user[userindex]['pinicon'] == 2) {
marker[userindex] = new GMarker(user[userindex]['latlng'], iconmember);
} else if (user[userindex]['pinicon'] == 3) {
marker[userindex] = new GMarker(user[userindex]['latlng'], iconleader);
} else {
marker[userindex] = new GMarker(user[userindex]['latlng'], iconuser);
}
for (var i = 0; i < marker.length; i++) {
if (marker[i] == undefined) continue;
var check_latlng = ""+marker[i].getLatLng();
if ((act_latlng == check_latlng) && (i != userindex)) {
html_text[i] = html_text[i] + html_text[userindex];
marker[i].bindInfoWindowHtml(html_text[i]);
marker.pop();
addmarker = 0;
break;
} else {
addmarker = 1;
}
}
if (addmarker == 1) {
map.addOverlay(marker[userindex]);
bounds.extend(marker[userindex].getLatLng());
marker[userindex].bindInfoWindowHtml(html_text[userindex]);
}
if (userindex < maxindex) {
createMarker(userindex+1, maxindex);
} else {
<?php if (GOOGLE_MAP_AUTOZOOM == 'TRUE') { ?>
var newzoom = map.getBoundsZoomLevel(bounds);
if (newzoom > <?php echo GOOGLE_MAP_MAXZOOM; ?>) {
newzoom = <?php echo GOOGLE_MAP_MAXZOOM; ?>;
}
map.setZoom(newzoom);
map.setCenter(bounds.getCenter());
<?php } ?>
map.getInfoWindow().hide();
document.getElementById('gmUsersLoading').style.display = 'none';
}
}
createMarker(0, user.length-1);
</script>
<?php
$addtobodyend = ob_get_contents();
ob_end_clean();
$design->addtobodyend($addtobodyend);
$design->footer();
?>
include/contents/templates/user/profil_edit.htm
<script src="http://maps.google.com/maps?file=api&v=2&key={GOOGLE_MAP_KEY}" type="text/javascript"></script>
<script type="text/javascript"><!--
function myLatLng() {
var city = document.form.wohnort.value;
var state = document.form.staat.value.replace(/.gif/,'');
var adress = state+" "+city;
var geocoder = new GClientGeocoder();
geocoder.getLatLng(adress,
function(latlng){
if (!latlng) {
} else {
document.form.gmapkoords.value = latlng;
}
}
);
isKnown();
}
function isKnown() {
if (document.getElementById('gmapkoords').value != '') {
document.getElementById('google_erkannt').value = 'von GoogleMap erkannt';
document.getElementById('google_erkannt').style.backgroundColor = '#33FF66';
} else {
document.getElementById('google_erkannt').value = 'von GoogleMap nicht erkannt';
document.getElementById('google_erkannt').style.backgroundColor = 'red';
}
}
//--></script>
<form action="index.php?user-profil" method="POST" enctype="multipart/form-data" name="form">
<input id="gmapkoords" name="gmapkoords" type="hidden" value="{gmapkoords}" />
<fieldset>
<legend>Persönliche Daten ändern</legend>
<br />
<label style="float:left; width:35%;">{_lang_mail}</label><input style="margin-bottom:2px;" name="email" value="{email}" /><input type="hidden" name="aemail" value="{email}" /><font class="smalfont">{_lang_mustbeentered}</font><br />
<label style="float:left; width:35%;">{_lang_homepage}</label><input style="margin-bottom:2px;" name="homepage" value="{homepage}" /><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_icq}</label><input style="margin-bottom:2px;" name="icq" value="{icq}" /><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_msn}</label><input style="margin-bottom:2px;" name="msn" value="{msn}" /><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_yahoo}</label><input style="margin-bottom:2px;" name="yahoo" value="{yahoo}" /><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_aim}</label><input style="margin-bottom:2px;" name="aim" value="{aim}" /><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_birthday}</label><input style="margin-bottom:2px;" name="gebdatum" value="{gebdatum}" /><font class="smalfont">{_lang_dateformat}</font><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_state}</label><select style="margin-bottom:2px;" name="staat">{_list_staat@<option%1 value="%2">%3</option>}</select><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_hometown}</label><input style="margin-bottom:2px;" name="wohnort" value="{wohnort}" onchange="myLatLng()"/><input type="button" id="google_erkannt" value="GoogleMap Erkennung" onclick="myLatLng();" title="klicken um erneut zu erkennen" style="position:relative; left: 10px; bottom:2px;" /> <br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_sex}</label><input style="margin-bottom:2px;" type="radio" value="1" id="geschlecht1" name="geschlecht" {geschlecht1} /><label for="geschlecht1"> {_lang_male}</label>, <input id="geschlecht2" type="radio" value="2" name="geschlecht" {geschlecht2} /><label for="geschlecht2"> {_lang_female}</label>, <input id="geschlecht0" type="radio" value="0" name="geschlecht" {geschlecht0} /><label for="geschlecht0"> {_lang_itdoesntmatter}</label><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_status}</label><input id="status_aktiv" type="radio" value="1" name="status" {status1} /><label for="status_aktiv"> {_lang_active}</label>, <input id="status_inaktiv" type="radio" value="0" name="status" {status0} /><label for="status_inaktiv"> {_lang_inactive}</label><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_mails}<span class="smalfont"> {_lang_fromotherusers}?</span></label><input id="opt_mail1" type="radio" value="1" name="opt_mail" {opt_mail1} /><label for="opt_mail1"> {_lang_yes}</label>, <input id="opt_mail0" type="radio" value="0" name="opt_mail" {opt_mail0} /><label for="opt_mail0"> {_lang_no}</label><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_privatemessages}<span class="smalfont"> {_lang_fromotherusers}?</span></label><input id="opt_pm1" type="radio" value="1" name="opt_pm" {opt_pm1} /><label for="opt_pm1"> {_lang_yes}</label>, <input id="opt_pm0" type="radio" value="0" name="opt_pm" {opt_pm0} /><label for="opt_pm0"> {_lang_no}</label><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_privatemessages}<span class="smalfont"> {_lang_popupbynewmsg}?</span></label><input id="opt_pm_popup1" type="radio" value="1" name="opt_pm_popup" {opt_pm_popup1} /><label for="opt_pm_popup1"> {_lang_yes}</label>, <input id="opt_pm_popup0" type="radio" value="0" name="opt_pm_popup" {opt_pm_popup0} /><label for="opt_pm_popup0"> {_lang_no}</label><br style="fclear:both;" /><br />
{_if_{forum_usergallery}=='1'}<div align="center">
<a href="index.php?user-usergallery-{uid}">Usergallery</a> <a href="index.php?user-remove"/></a>
</div>{/_endif}<br />
{EXPLODE}
<fieldset>
<legend>{_lang_removeaccount}</legend>
<label style="float:left; width:35%;"> </label><input type="checkbox" value="yes" name="removeaccount" /> {_lang_delete}? <font class="smalfont">{_lang_mustbeentered}</font>
</fieldset>
<fieldset>
<legend>{_lang_avatar}</legend>
<label style="float:left; width:35%;"> </label>{avatarbild}<input type="checkbox" value="yes" name="avatarloeschen" /> {_lang_delete}?<br /><br />
<label style="float:left; width:35%;"> </label><input style="margin-bottom:2px;" type="file" name="avatarfile" /><br /><font class="smalfont"><br />{_lang_criterions}: {_lang_maxwidth} {Fabreite}px, {_lang_maxheight} {Fahohe}px {_lang_and} max size {Fasize} bytes. {_lang_otherwisenoaction}.</font><br />
</fieldset>
<br />
{EXPLODE}
<fieldset>
<legend>{_lang_signature}</legend>
<label style="float:left; width:35%;"><font class="smalfont">{_lang_max} {forum_max_sig} {_lang_signs}.</font></label><textarea style="margin-bottom:2px;" cols="60" rows="2" name="sig">{sig}</textarea><br />
</fieldset>
<br />
<fieldset>
<legend>{_lang_editpassword}</legend>
<br />
<label style="float:left; width:35%;">{_lang_current}</label><input style="margin-bottom:2px;" type="password" name="op" maxlength="20"><br />
<label style="float:left; width:35%;">{_lang_new}</label><input style="margin-bottom:2px;" type="password" name="np1" maxlength="20"><br />
<label style="float:left; width:35%;">{_lang_repeat}</label><input style="margin-bottom:2px;" type="password" name="np2" maxlength="20"><br />
</fieldset>
<br />
<fieldset>
<br />
{EXPLODE}
</fieldset>
<br />
<div align="center">
<input style="margin-bottom:2px;" type="submit" value="{_lang_send2}" name="submit">
</div>
</fieldset>
</form>
<script type="text/javascript"><!--
if (document.getElementById('gmapkoords').value != '') {
isKnown();
}
//--></script>
und das hier sind meine mit dem versuch es richtig einzubauen:
include/contents/user/profil_edit.php
<?php
# Copyright by: Manuel Staechele
# Support: www.ilch.de
# Mod by OloX
# www.mairu.ilch.net
# www.dms-gaming.com
defined ('main') or die ( 'no direct access' );
require_once("include/contents/googlemap/config.php");
$title = $allgAr['title'].' :: Users :: Profil';
$hmenu = $extented_forum_menu.'<a class="smalfont" href="?user">Users</a><b> » </b> Profil'.$extented_forum_menu_sufix;
$design = new design ( $title , $hmenu, 1);
if ( $_SESSION['authright'] <= -1 ) {
if ( empty ($_POST['submit']) ) {
$design->header();
$abf = 'SELECT email,wohnort,homepage,aim,msn,icq,yahoo,avatar,userpict,status,staat,gebdatum,sig,opt_pm_popup,opt_pm,opt_mail,geschlecht,spezrank,gmapkoords FROM `prefix_user` WHERE id = "'.$_SESSION['authid'].'"';
$erg = db_query($abf);
if ( db_num_rows($erg) > 0 ) {
$row = db_fetch_assoc($erg);
$tpl = new tpl ('user/profil_edit');
$row['staat'] = '<option></option>'.arliste ( $row['staat'] , get_nationality_array() , $tpl , 'staat' );
$row['geschlecht0'] = ( $row['geschlecht'] < 1 ? 'checked' : '' );
$row['geschlecht1'] = ( $row['geschlecht'] == 1 ? 'checked' : '' );
$row['geschlecht2'] = ( $row['geschlecht'] == 2 ? 'checked' : '' );
if ( $row['status'] == 1 ) { $row['status1'] = 'checked'; $row['status0'] = ''; } else { $row['status1'] = ''; $row['status0'] = 'checked'; }
if ( $row['opt_mail'] == 1 ) { $row['opt_mail1'] = 'checked'; $row['opt_mail0'] = ''; } else { $row['opt_mail1'] = ''; $row['opt_mail0'] = 'checked'; }
if ( $row['opt_pm'] == 1 ) { $row['opt_pm1'] = 'checked'; $row['opt_pm0'] = ''; } else { $row['opt_pm1'] = ''; $row['opt_pm0'] = 'checked'; }
if ( $row['opt_pm_popup'] == 1 ) { $row['opt_pm_popup1'] = 'checked'; $row['opt_pm_popup0'] = ''; } else { $row['opt_pm_popup1'] = ''; $row['opt_pm_popup0'] = 'checked'; }
$row['avatarbild'] = ( file_exists ( $row['avatar'] ) ? '<img src="'.$row['avatar'].'" alt=""><br />' : '' );
$row['userpict'] = ( file_exists ( $row['userpict'] ) ? '<img src="'.$row['userpict'].'" alt=""><br />' : '' );
$row['Fabreite'] = $allgAr['Fabreite'];
$row['Fahohe'] = $allgAr['Fahohe'];
$row['Fasize'] = $allgAr['Fasize'];
$row['ppicbreite'] = $allgAr['ppicbreite'];
$row['ppichohe'] = $allgAr['ppichohe'];
$row['ppicsize'] = $allgAr['ppicsize'];
$row['forum_max_sig'] = $allgAr['forum_max_sig'];
$row['uid'] = $_SESSION['authid'];
$row['forum_usergallery'] = $allgAr['forum_usergallery'];
$row['GOOGLE_MAP_KEY'] = GOOGLE_MAP_KEY;
$tpl->set_ar_out($row,0);
if ($allgAr['forum_avatar_upload']) $tpl->out(1);
$tpl->set_ar_out($row,2);
profilefields_change ( $_SESSION['authid'] );
$tpl->out(3);
} else {
$tpl = new tpl ( 'user/login.htm' );
$tpl->set_out('WDLINK','index.php',0);
}
} else { # submit
# change poassword
if ( !empty($_POST['np1']) AND !empty($_POST['np2']) AND !empty($_POST['op'])) {
if ($_POST['np1'] == $_POST['np2']) {
$akpw = db_result(db_query("SELECT pass FROM prefix_user WHERE id = ".$_SESSION['authid']),0);
if ($akpw == md5($_POST['op'])) {
$newpw = md5($_POST['np1']);
db_query("UPDATE prefix_user SET pass = '".$newpw."' WHERE id = ".$_SESSION['authid']);
setcookie(session_und_cookie_name(), $_SESSION['authid'].'='.$newpw, time() + 31104000, "/" );
$fmsg = $lang['passwortchanged'];
} else {
$fmsg = $lang['passwortwrong'];
}
} else {
$fmsg = $lang['passwortnotequal'];
}
}
# avatar speichern START
$avatar_sql_update = '';
if ( !empty ( $_FILES['avatarfile']['name'] ) AND $allgAr['forum_avatar_upload'] ) {
$file_tmpe = $_FILES['avatarfile']['tmp_name'];
$rile_type = ic_mime_type ($_FILES['avatarfile']['tmp_name']);
$file_type = $_FILES['avatarfile']['type'];
$file_size = $_FILES['avatarfile']['size'];
$fmsg = $lang['avatarisnopicture'];
$size = @getimagesize ($file_tmpe);
$endar = array (1 => 'gif', 2 => 'jpg', 3 => 'png');
if ( ($size[2] == 1 OR $size[2] == 2 OR $size[2] == 3) AND $size[0] > 10 AND $size[1] > 10 AND substr ( $file_type , 0 , 6 ) == 'image/' AND substr ( $rile_type , 0 , 6 ) == 'image/' ) {
$endung = $endar[$size[2]];
$breite = $size[0];
$hoehe = $size[1];
$fmsg = $lang['avatarcannotupload'];
if ( $file_size <= $allgAr['Fasize'] AND $breite <= $allgAr['Fabreite'] AND $hoehe <= $allgAr['Fahohe'] ) {
$neuer_name = 'include/images/avatars/'.$_SESSION['authid'].'.'.$endung;
@unlink (db_result(db_query("SELECT avatar FROM prefix_user WHERE id = ".$_SESSION['authid']),0));
move_uploaded_file ( $file_tmpe , $neuer_name );
@chmod($neuer_name, 0777);
$avatar_sql_update = "avatar = '".$neuer_name."',";
$fmsg = $lang['pictureuploaded'];
}
}
} elseif ( isset($_POST['avatarloeschen']) ) {
$fmsg = $lang['picturedelete'];
@unlink (db_result(db_query("SELECT avatar FROM prefix_user WHERE id = ".$_SESSION['authid']),0));
$avatar_sql_update = "avatar = '',";
}
# avatar speichern ENDE
# userpict speichern START
$userpict_sql_update = '';
if ( !empty ( $_FILES['userpictfile']['name'] )) {
$file_tmpe = $_FILES['userpictfile']['tmp_name'];
$rile_type = ic_mime_type ($_FILES['userpictfile']['tmp_name']);
$file_type = $_FILES['userpictfile']['type'];
$file_size = $_FILES['userpictfile']['size'];
$fmsg = $lang['userpictisnopicture'];
$size = @getimagesize ($file_tmpe);
$endar = array (1 => 'gif', 2 => 'jpg', 3 => 'png');
if ( ($size[2] == 1 OR $size[2] == 2 OR $size[2] == 3) AND $size[0] > 10 AND $size[1] > 10 AND substr ( $file_type , 0 , 6 ) == 'image/' AND substr ( $rile_type , 0 , 6 ) == 'image/' ) {
$endung = $endar[$size[2]];
$breite = $size[0];
$hoehe = $size[1];
$fmsg = $lang['userpictcannotupload'];
if ( $file_size <= $allgAr['ppicsize'] AND $breite <= $allgAr['ppicbreite'] AND $hoehe <= $allgAr['ppichohe'] ) {
$neuer_name = 'include/images/userpicts/'.$_SESSION['authid'].'.'.$endung;
@unlink (db_result(db_query("SELECT userpict FROM prefix_user WHERE id = ".$_SESSION['authid']),0));
move_uploaded_file ( $file_tmpe , $neuer_name );
@chmod($neuer_name, 0777);
$userpict_sql_update = "userpict = '".$neuer_name."',";
$fmsg = 'Avatar wurde erfolgreich hochgeladen.';
}
}
} elseif ( isset($_POST['userpictloeschen']) ) {
$fmsg = $lang['picturedelete'];
@unlink (db_result(db_query("SELECT userpict FROM prefix_user WHERE id = ".$_SESSION['authid']),0));
$userpict_sql_update = "userpict = '',";
}
# userpict speichern ENDE
# email aendern
if ($_POST['email'] != $_POST['aemail']) {
$id = $_SESSION['authid'].'||'.md5 (uniqid (rand()));
db_query("INSERT INTO prefix_usercheck (`check`,email,datime,ak)
VALUES ('".$id."','".escape($_POST['email'],'string')."',NOW(),3)");
$page = $_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"];
$text = $lang['changedthemail'] . sprintf ($lang['registconfirmlink'], $page, $id );
icmail ($_POST['email'], $lang['mail'].' '.$lang['changed'], $text );
$fmsg = $lang['pleaseconfirmmail'];
}
#
#remove account
if (isset($_POST['removeaccount'])) {
$id = $_SESSION['authid'].'-remove-'.md5 (uniqid (rand()));
db_query("INSERT INTO prefix_usercheck (`check`,email,datime,ak)
VALUES ('".$id."','".escape($_POST['email'],'string')."',NOW(),5)");
$page = $_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"];
$text = $lang['removeconfirm'] . sprintf ($lang['registconfirmlink'], $page, $id );
icmail ($_POST['email'], html_entity_decode($lang['removeaccount']), $text );
$fmsg = $lang['pleaseconfirmremove'];
}
#remove account
# statische felder speichern
db_query("UPDATE prefix_user
SET
homepage = '".get_homepage(escape($_POST['homepage'], 'string'))."',
wohnort = '".escape($_POST['wohnort'], 'string')."',
icq = '".escape($_POST['icq'], 'string')."',
msn = '".escape($_POST['msn'], 'string')."',
yahoo = '".escape($_POST['yahoo'], 'string')."',
".$avatar_sql_update."
".$userpict_sql_update."
aim = '".escape($_POST['aim'], 'string')."',
staat = '".escape($_POST['staat'], 'string')."',
geschlecht = '".escape($_POST['geschlecht'], 'string')."',
status = '".escape($_POST['status'], 'string')."',
opt_mail = '".escape($_POST['opt_mail'], 'string')."',
opt_pm = '".escape($_POST['opt_pm'], 'string')."',
opt_pm_popup = '".escape($_POST['opt_pm_popup'], 'string')."',
gebdatum = '".get_datum(escape($_POST['gebdatum'], 'string'))."',
sig = '".substr(escape($_POST['sig'], 'string'),0,$allgAr['forum_max_sig'])."',
gmapkoords = '".escape($_POST['gmapkoords'], 'string')."'
WHERE id = ".$_SESSION['authid']
);
# change other profil fields
profilefields_change_save ( $_SESSION['authid'] );
$design->header();
# definie and print msg
$fmsg = ( isset($fmsg) ? $fmsg : $lang['changesuccessful'] );
wd('?user-8' , $fmsg , 3 );
}
} else {
$tpl = new tpl ( 'user/login' );
$tpl->set_out('WDLINK', '?user-8', 0);
}
$design->footer();
?>
include/templates/user/profil_edit.htm
<script src="http://maps.google.com/maps?file=api&v=2&key={GOOGLE_MAP_KEY}" type="text/javascript"></script>
<script type="text/javascript"><!--
function myLatLng() {
var city = document.form.wohnort.value;
var state = document.form.staat.value.replace(/.gif/,'');
var adress = state+" "+city;
var geocoder = new GClientGeocoder();
geocoder.getLatLng(adress,
function(latlng){
if (!latlng) {
} else {
document.form.gmapkoords.value = latlng;
}
}
);
isKnown();
}
function isKnown() {
if (document.getElementById('gmapkoords').value != '') {
document.getElementById('google_erkannt').value = 'von GoogleMap erkannt';
document.getElementById('google_erkannt').style.backgroundColor = '#33FF66';
} else {
document.getElementById('google_erkannt').value = 'von GoogleMap nicht erkannt';
document.getElementById('google_erkannt').style.backgroundColor = 'red';
}
}
//--></script>
<form action="index.php?user-profil" method="POST" enctype="multipart/form-data">
<input id="gmapkoords" name="gmapkoords" type="hidden" value="{gmapkoords}" />
<fieldset>
<legend>Persönliche Daten ändern</legend>
<br />
<label style="float:left; width:35%;">{_lang_mail}</label><input style="margin-bottom:2px;" name="email" value="{email}" /><input type="hidden" name="aemail" value="{email}" /><font class="smalfont">{_lang_mustbeentered}</font><br />
<label style="float:left; width:35%;">{_lang_homepage}</label><input style="margin-bottom:2px;" name="homepage" value="{homepage}" /><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_hometown}</label><input style="margin-bottom:2px;" name="wohnort" value="{wohnort}" onchange="myLatLng()"/><input type="button" id="google_erkannt" value="GoogleMap Erkennung" onclick="myLatLng();" title="klicken um erneut zu erkennen" style="position:relative; left: 10px; bottom:2px;" /> <br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_icq}</label><input style="margin-bottom:2px;" name="icq" value="{icq}" /><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_msn}</label><input style="margin-bottom:2px;" name="msn" value="{msn}" /><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_yahoo}</label><input style="margin-bottom:2px;" name="yahoo" value="{yahoo}" /><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_aim}</label><input style="margin-bottom:2px;" name="aim" value="{aim}" /><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_birthday}</label><input style="margin-bottom:2px;" name="gebdatum" value="{gebdatum}" /><font class="smalfont">{_lang_dateformat}</font><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_state}</label><select style="margin-bottom:2px;" name="staat">{_list_staat@<option%1 value="%2">%3</option>}</select><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_sex}</label><input style="margin-bottom:2px;" type="radio" value="1" id="geschlecht1" name="geschlecht" {geschlecht1} /><label for="geschlecht1"> {_lang_male}</label>, <input id="geschlecht2" type="radio" value="2" name="geschlecht" {geschlecht2} /><label for="geschlecht2"> {_lang_female}</label>, <input id="geschlecht0" type="radio" value="0" name="geschlecht" {geschlecht0} /><label for="geschlecht0"> {_lang_itdoesntmatter}</label><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_status}</label><input id="status_aktiv" type="radio" value="1" name="status" {status1} /><label for="status_aktiv"> {_lang_active}</label>, <input id="status_inaktiv" type="radio" value="0" name="status" {status0} /><label for="status_inaktiv"> {_lang_inactive}</label><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_mails}<span class="smalfont"> {_lang_fromotherusers}?</span></label><input id="opt_mail1" type="radio" value="1" name="opt_mail" {opt_mail1} /><label for="opt_mail1"> {_lang_yes}</label>, <input id="opt_mail0" type="radio" value="0" name="opt_mail" {opt_mail0} /><label for="opt_mail0"> {_lang_no}</label><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_privatemessages}<span class="smalfont"> {_lang_fromotherusers}?</span></label><input id="opt_pm1" type="radio" value="1" name="opt_pm" {opt_pm1} /><label for="opt_pm1"> {_lang_yes}</label>, <input id="opt_pm0" type="radio" value="0" name="opt_pm" {opt_pm0} /><label for="opt_pm0"> {_lang_no}</label><br style="clear:both;" />
<label style="float:left; width:35%;">{_lang_privatemessages}<span class="smalfont"> {_lang_popupbynewmsg}?</span></label><input id="opt_pm_popup1" type="radio" value="1" name="opt_pm_popup" {opt_pm_popup1} /><label for="opt_pm_popup1"> {_lang_yes}</label>, <input id="opt_pm_popup0" type="radio" value="0" name="opt_pm_popup" {opt_pm_popup0} /><label for="opt_pm_popup0"> {_lang_no}</label><br style="fclear:both;" /><br />
{_if_{forum_usergallery}=='1'}<div align="center">
<a href="index.php?user-usergallery-{uid}">Usergallery</a> <a href="index.php?user-remove"/></a>
</div>{/_endif}<br />
{EXPLODE}
<fieldset>
<legend>{_lang_removeaccount}</legend>
<label style="float:left; width:35%;"> </label><input type="checkbox" value="yes" name="removeaccount" /> {_lang_delete}? <font class="smalfont">{_lang_mustbeentered}</font>
</fieldset>
<fieldset>
<legend>Player-Pic</legend>
<label style="float:left; width:35%;"> </label>{avatarbild}<br /><br />
<font class="smalfont"><br />{_lang_criterions}: <legend>nicht löschbar, kann nur vom Admin hochgeladen werden</legend>
</fieldset>
<fieldset>
<legend>{_lang_avatar}</legend>
<label style="float:left; width:35%;"> </label>{userpict}<input type="checkbox" value="yes" name="userpictloeschen" /> {_lang_delete}?<br /><br />
<label style="float:left; width:35%;"> </label><input style="margin-bottom:2px;" type="file" name="userpictfile" /><br /><font class="smalfont"><br />{_lang_criterions}: {_lang_maxwidth} {ppicbreite}px, {_lang_maxheight} {ppichohe}px {_lang_and} max size {ppicsize} bytes. {_lang_otherwisenoaction}.</font><br />
</fieldset>
<br />
{EXPLODE}
<fieldset>
<legend>{_lang_signature}</legend>
<label style="float:left; width:35%;"><font class="smalfont">{_lang_max} {forum_max_sig} {_lang_signs}.</font></label>
<textarea style="margin-bottom:2px;" cols="60" rows="5" name="sig">{sig}</textarea>
<br />
</fieldset>
<br />
<fieldset>
<legend>{_lang_editpassword}</legend>
<br />
<label style="float:left; width:35%;">{_lang_current}</label><input style="margin-bottom:2px;" type="password" name="op" maxlength="20"><br />
<label style="float:left; width:35%;">{_lang_new}</label><input style="margin-bottom:2px;" type="password" name="np1" maxlength="20"><br />
<label style="float:left; width:35%;">{_lang_repeat}</label><input style="margin-bottom:2px;" type="password" name="np2" maxlength="20"><br />
</fieldset>
<br />
<fieldset>
<br />
{EXPLODE}
</fieldset>
<br />
<div align="center">
<input style="margin-bottom:2px;" type="submit" value="{_lang_send2}" name="submit">
</div>
</fieldset>
</form>
<script type="text/javascript"><!--
if (document.getElementById('gmapkoords').value != '') {
isKnown();
}
//--></script>