ilch Forum » Ilch Clan 1.1 » Module und Modifikationen » Profiledit1.0

Geschlossen
  1. #1
    User Pic
    Soldat53b gelöschter User
    Hallo ich hab da mal ne frage,

    ich hab mir das Profiledit1.0 von Nero runter geladen und installiert und co. Funkst auch super.

    Aber ich wollte mal fragen ob irgentjemand weiß und mir sagen kann wie man bzw ob man, den avatar und das userpic in sachen maxsize von einander trennen kann.

    denn unter admin.php?allg kann man nur die maxgröße des Avatars angeben und nicht die von dem userbild den für beide wird das selbe genommen...

    MfG Soldat53b


    verwendete ilchClan Version: 1.1
    0 Mitglieder finden den Beitrag gut.
  2. #2
    User Pic
    Rock@wulf Hall Of Fame
    Registriert seit
    03.06.2004
    Beiträge
    3.282
    Beitragswertungen
    239 Beitragspunkte
    kann man muss man nur etwas ergänzen allerdings dauert das ne weile
    Meine Postings repräsentieren meine Meinung wenn nicht anders gekennzeichnet.
    MFG Rock@wulf
    0 Mitglieder finden den Beitrag gut.
  3. #3
    User Pic
    Soldat53b gelöschter User
    kann mir das denn jeamnd erklären?
    0 Mitglieder finden den Beitrag gut.
  4. #4
    User Pic
    Rock@wulf Hall Of Fame
    Registriert seit
    03.06.2004
    Beiträge
    3.282
    Beitragswertungen
    239 Beitragspunkte
    in wie weit kennst du dich in php und sql aus?
    Meine Postings repräsentieren meine Meinung wenn nicht anders gekennzeichnet.
    MFG Rock@wulf
    0 Mitglieder finden den Beitrag gut.
  5. #5
    User Pic
    Gerni Mitglied
    Registriert seit
    10.08.2006
    Beiträge
    874
    Beitragswertungen
    0 Beitragspunkte
    mhm... ich probiere es die Tage mal, mal sehen ob ich dir dabei helfen kann


    Zuletzt modifiziert von Gerni am 17.05.2009 - 09:20:21
    kleinere geänderte Module für Ilch auf unserer HP: externer Link
    0 Mitglieder finden den Beitrag gut.
  6. #6
    User Pic
    Soldat53b gelöschter User
    naja so ein bisschen... mit sql etwas weniger...

    ZitatZitat geschrieben von Gerni

    mhm... ich probiere es die Tage mal, mal sehen ob ich dir dabei helfen kann


    danke das ist nett


    Zuletzt modifiziert von Soldat53b am 17.05.2009 - 13:19:00
    0 Mitglieder finden den Beitrag gut.
  7. #7
    User Pic
    Soldat53b gelöschter User
    Und hat jemand was?
    0 Mitglieder finden den Beitrag gut.
  8. #8
    User Pic
    Rock@wulf Hall Of Fame
    Registriert seit
    03.06.2004
    Beiträge
    3.282
    Beitragswertungen
    239 Beitragspunkte
    naja so ein bisschen... mit sql etwas weniger...

    Es ist mir immernoch nicht ganz klar, wie man so eine Anfrage stellen kann ohne mindestes die grungentnisse der benötigten sprachen zu beherrschen.

    Erklären ist da eigentlich macht mir das eben jemand

    Da das Erklären wahrscheinlich länger dauert als das selber schreiben

    ich werde die Tage danach sehen und die Entsprechenden Codezeilen hier posten.
    Meine Postings repräsentieren meine Meinung wenn nicht anders gekennzeichnet.
    MFG Rock@wulf
    0 Mitglieder finden den Beitrag gut.
  9. #9
    User Pic
    OloX Hall Of Fame
    Registriert seit
    25.02.2006
    Beiträge
    990
    Beitragswertungen
    23 Beitragspunkte
    Hi Soldat53b,

    include/contents/user/profil_edit.php
    <?php 
    #   Copyright by: Manuel Staechele
    #   Support: www.ilch.de
    
    
    defined ('main') or die ( 'no direct access' );
    
    
    $title = $allgAr['title'].' :: Users :: Profil';
    $hmenu  = $extented_forum_menu.'<a class="smalfont" href="?user">Users</a><b> &raquo; </b> Profil'.$extented_forum_menu_sufix;
    $design = new design ( $title , $hmenu, 1, 'forum/index.htm' );
    
    
    
    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 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'; }
        /*Script change by Nero Start */
        $row['userbild'] = ( file_exists ( $row['userpict'] ) ? '<img src="'.$row['userpict'].'" alt=""><br />' : '' );
        /*Script change by Nero Ende */
        $row['avatarbild'] = ( file_exists ( $row['avatar'] ) ? '<img src="'.$row['avatar'].'" alt=""><br />' : '' );
        $row['ppicbreite'] = $allgAr['ppicbreite'];
        $row['ppichohe'] = $allgAr['ppichohe'];
        $row['ppicsize'] = $allgAr['ppicsize'];		
        $row['Fabreite'] = $allgAr['Fabreite'];
        $row['Fahohe'] = $allgAr['Fahohe'];
        $row['Fasize'] = $allgAr['Fasize'];
        $row['forum_max_sig'] = $allgAr['forum_max_sig'];
        
        $tpl->set_ar_out($row,0);
    
                    profilefields_change ( $_SESSION['authid'] );
                    $tpl->out(1);
                    
      } 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'] ) ) {
                                    $file_tmpe = $_FILES['avatarfile']['tmp_name'];
                                    $file_type = $_FILES['avatarfile']['type'];
                                    $file_size = $_FILES['avatarfile']['size'];
                                    $file_name = $_FILES['avatarfile']['name'];
            $fmsg = $lang['avatarisnopicture']; 
                                    if ( substr ( $file_type , 0 , 6 ) == 'image/' ) {
                                      $endung = preg_replace("/.*\.([^\.]+)/", "\\1", $file_name);
                                      $size   = getimagesize($file_tmpe);
              $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 );
                $avatar_sql_update = "avatar = '".$neuer_name."',";
                $fmsg = $lang['pictureupload']; 
                                            }
                                    }
                            } 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
      
      /*Script change by Nero Start */
      # 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 = 'Player-Pic 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
      /*Script change by Nero 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'];
      }
      #
      
      
      # 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'])."'
                                    WHERE id = ".$_SESSION['authid']
          )OR die('datenbankprob.');
            
      
            # 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 type="text/javascript">
            <!--
            function showhide(name) {
                    var menge = 3;
                    var i = 1;
                    while(menge >= i){
                            var e = document.getElementById('aF999'+i);
                            e.style.display = 'none';
                            i++;
                    }
                    var e = document.getElementById(name);
                    e.style.display = 'block';
            }
            -->
    </script>
    
    
    
    <form action="index.php?user-profil" method="POST" enctype="multipart/form-data">
            <fieldset>
            <legend>Persönliche Daten ändern</legend>
            <span style="padding-bottom:10px;display:block;"><a title="Anzeigen/Verstecken" href="javascript:showhide('aF9991')">Haupteinstellungen</a> &nbsp; <a title="Anzeigen/Verstecken" href="javascript:showhide('aF9992')">{_lang_editpassword}</a> &nbsp; <a title="Anzeigen/Verstecken" href="javascript:showhide('aF9993')">&Uuml;brige Felder</a></span>
            <div style="display:block;" id="aF9991">
            <fieldset>
              <legend>Haupteinstellungen</legend>
                      <br />
                      <label style="float:left; width:25%;">{_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:25%;">{_lang_homepage}</label><input style="margin-bottom:2px;" name="homepage" value="{homepage}" /><br style="clear:both;" />
                            <label style="float:left; width:25%;">{_lang_hometown}</label><input style="margin-bottom:2px;" name="wohnort" value="{wohnort}" /><br style="clear:both;" />
                            <label style="float:left; width:25%;">{_lang_icq}</label><input style="margin-bottom:2px;" name="icq" value="{icq}" /><br style="clear:both;" />
                            <label style="float:left; width:25%;">{_lang_msn}</label><input style="margin-bottom:2px;" name="msn" value="{msn}" /><br style="clear:both;" />
                            <label style="float:left; width:25%;">{_lang_yahoo}</label><input style="margin-bottom:2px;" name="yahoo" value="{yahoo}" /><br style="clear:both;" />
                            <label style="float:left; width:25%;">{_lang_aim}</label><input style="margin-bottom:2px;" name="aim" value="{aim}" /><br style="clear:both;" />
                            <label style="float:left; width:25%;">{_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:25%;">{_lang_state}</label><select style="margin-bottom:2px;" name="staat">{_list_staat@<option%1 value="%2">%3</option>}</select><br style="clear:both;" /><br />
                            <label style="float:left; width:40%;">{_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:40%;">{_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:40%;">{_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:40%;">{_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:40%;">{_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="clear:both;" /><br />
                            <!--Script change by Nero Start -->
                            <fieldset>
    			  <legend>Player-Pic</legend>
    			    <label style="float:left; width:35%;">&nbsp;</label>{userpict}<input type="checkbox" value="yes" name="userpictloeschen" /> {_lang_delete}?<br /><br />
    			    <label style="float:left; width:35%;">&nbsp;</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 />
                            <!--Script change by Nero Ende -->
                            <fieldset>
                              <legend>{_lang_avatar}</legend>
                                <label style="float:left; width:40%;">&nbsp;</label>{avatarbild}<input type="checkbox" value="yes" name="avatarloeschen" /> {_lang_delete}?<br /><br />
                                <label style="float:left; width:40%;">&nbsp;</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 />
                            <fieldset>
                              <legend>{_lang_signature}</legend>
                                <label style="float:left; width:40%;"><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 />
                            </div>
                            <div style="display:none;" id="aF9992">
                            <fieldset>
                              <legend>{_lang_editpassword}</legend>
                                <br />
                                <label style="float:left; width:40%;">{_lang_current}</label><input style="margin-bottom:2px;" type="password" name="op" maxlength="20"><br />
                                <label style="float:left; width:40%;">{_lang_new}</label><input style="margin-bottom:2px;" type="password" name="np1" maxlength="20"><br />
                                <label style="float:left; width:40%;">{_lang_repeat}</label><input style="margin-bottom:2px;" type="password" name="np2" maxlength="20"><br />
                            </fieldset>
                            </div>
            <div style="display:none;" id="aF9993">
    
    
        {EXPLODE} 
          </fieldset>
          </div>
          <br />
          <label style="float:left; width:35%;">&nbsp;</label><input style="margin-bottom:2px;" type="submit" value="{_lang_send2}" name="submit"><br />
            </fieldset>
    </form>


    install.php Abspeichern und im ROOT hochladen und ausführen zwinker
    <?php
    define ( 'main' , TRUE );
    require_once('include/includes/config.php');
    require_once('include/includes/func/db/mysql.php');
    db_connect();
    
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>-=] Installation [=-</title>
    </head>
    <body>';
    if ( db_query("INSERT INTO `prefix_config` (`schl`, `typ`, `kat`, `frage`, `wert`) VALUES
    ('ppicbreite', 'input', 'Forum Optionen', 'max Breite f&uuml;r das Player-Pic', '150'),
    ('ppichohe', 'input', 'Forum Optionen', 'max H&ouml;he f&uuml;r das Player-Pic', '150'), 
    ('ppicsize', 'input', 'Forum Optionen', 'max Gr&ouml;&szlig;e in Bytes f&uuml;r das Player-Pic', '1048576');") )
    echo '<div align="center" style="font: 12px Tahoma; color: #045d96; width:500px; border: 1px dashed #00CCFF; background-color:#D8D8D8; margin:10px; padding:5px;">Installation <strong>erfolgreich</strong> abgeschlossen.<br />Bitte <strong>install.php</strong> l&ouml;schen.</div>
    </body>
    </html>';
    else 
    echo '<div align="center" style="font: 12px Tahoma; color: #045d96; width:500px; border: 1px dashed #00CCFF; background-color:#D8D8D8; margin:10px; padding:5px;">Fehler aufgetreten:<br />'.mysql_error().'</div>
    </body>
    </html>';
    
    db_close();
    ?>


    MfG OloX
    PHP, JavaScript, CSS
    0 Mitglieder finden den Beitrag gut.
  10. #10
    User Pic
    Soldat53b gelöschter User
    also ich hab das andere ja schon installiert...

    kann ich das andere einfach überinstallieren?

    Edit:

    "ah habs schon rausgefunden ^^

    Vielen dank ^^"

    Edit:
    "
    Da warn noch zwei kleine "Fehler", habs sie aber berrichtigt,
    1. Es muss so sein da sonst die Rote fehlermeldung kommt.
    $design = new design ( $title , $hmenu,);

    2. Hier was das erste userpict noch userbild.
    /*Script change by Nero Start */ 
        $row['userpict'] = ( file_exists ( $row['userpict'] ) ? '<img src="'.$row['userpict'].'" alt=""><br />' : '' ); 
        /*Script change by Nero Ende */

    <?php
    #   Copyright by: Manuel Staechele
    #   Support: www.ilch.de
    
    
    defined ('main') or die ( 'no direct access' );
    
    
    $title = $allgAr['title'].' :: Users :: Profil';
    $hmenu  = $extented_forum_menu.'<a class="smalfont" href="index.php?user">Users</a><b> &raquo; </b> Profil'.$extented_forum_menu_sufix;
    $design = new design ( $title , $hmenu);
    
    
    
    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 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'; }
        /*Script change by Nero Start */
        $row['userpict'] = ( file_exists ( $row['userpict'] ) ? '<img src="'.$row['userpict'].'" alt=""><br />' : '' );
        /*Script change by Nero Ende */
        $row['avatarbild'] = ( file_exists ( $row['avatar'] ) ? '<img src="'.$row['avatar'].'" alt=""><br />' : '' );
        $row['ppicbreite'] = $allgAr['ppicbreite'];
        $row['ppichohe'] = $allgAr['ppichohe'];
        $row['ppicsize'] = $allgAr['ppicsize'];
        $row['Fabreite'] = $allgAr['Fabreite'];
        $row['Fahohe'] = $allgAr['Fahohe'];
        $row['Fasize'] = $allgAr['Fasize'];
        $row['forum_max_sig'] = $allgAr['forum_max_sig'];
    
        $tpl->set_ar_out($row,0);
    
                    profilefields_change ( $_SESSION['authid'] );
                    $tpl->out(1);
    
      } 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'] ) ) {
                                    $file_tmpe = $_FILES['avatarfile']['tmp_name'];
                                    $file_type = $_FILES['avatarfile']['type'];
                                    $file_size = $_FILES['avatarfile']['size'];
                                    $file_name = $_FILES['avatarfile']['name'];
            $fmsg = $lang['avatarisnopicture'];
                                    if ( substr ( $file_type , 0 , 6 ) == 'image/' ) {
                                      $endung = preg_replace("/.*\.([^\.]+)/", "\\1", $file_name);
                                      $size   = getimagesize($file_tmpe);
              $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 );
                $avatar_sql_update = "avatar = '".$neuer_name."',";
                $fmsg = $lang['pictureupload'];
                                            }
                                    }
                            } 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
    
      /*Script change by Nero Start */
      # 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 = 'Player-Pic 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
      /*Script change by Nero 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'];
      }
      #
    
    
      # 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'])."'
                                    WHERE id = ".$_SESSION['authid']
          )OR die('datenbankprob.');
    
    
            # 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();
    ?>



    Zuletzt modifiziert von Soldat53b am 20.05.2009 - 14:13:56
    0 Mitglieder finden den Beitrag gut.
  11. #11
    User Pic
    OloX Hall Of Fame
    Registriert seit
    25.02.2006
    Beiträge
    990
    Beitragswertungen
    23 Beitragspunkte
    Ja musst du ....funzt es ?
    MfG OloX
    PHP, JavaScript, CSS
    0 Mitglieder finden den Beitrag gut.
  12. #12
    User Pic
    Soldat53b gelöschter User
    ja bis auf die zwei kleinen fehler die ich (siehe oben)

    berrichtigt habe


    vielen dank nochmal
    0 Mitglieder finden den Beitrag gut.
  13. #13
    User Pic
    OloX Hall Of Fame
    Registriert seit
    25.02.2006
    Beiträge
    990
    Beitragswertungen
    23 Beitragspunkte
    Klein Problem zwinker
    PHP, JavaScript, CSS
    0 Mitglieder finden den Beitrag gut.
  14. #14
    User Pic
    Soldat53b gelöschter User
    noch eine sache die für andere ganz interessant sein könnte

    damit es auch im admin berreich funkst:

    Edit:
    User.php
    <?php
    #   Copyright by: Manuel Staechele
    #   Support: www.ilch.de
    
    
    defined ('main') or die ( 'no direct access' );
    defined ('admin') or die ( 'only admin access' );
    
    
    
    function user_get_group_list ($uid) {
      $l = 'Mitglied in Gruppen:<br />';
      $erg = db_query("SELECT prefix_groups.name FROM prefix_groupusers LEFT JOIN prefix_groups ON prefix_groups.id = prefix_groupusers.gid WHERE prefix_groupusers.uid = ".$uid);
      while ($r = db_fetch_assoc($erg)) {
        $l .= '- '.$r['name'].'<br />';
      }
      return ($l);
    }
    
    function user_get_all_mod_list () {
      $l = '';
      $erg = db_query("SELECT DISTINCT name FROM prefix_modules WHERE fright = 1 ORDER BY prefix_modules.name");
      while ($r = db_fetch_assoc($erg)) {
        $x = $r['name'];
        $l .= '<th style="font-size: 9px; font-weight: normal;" title="'.$r['name'].'" valign="bottom">'.$x.'</th>';
      }
      return ($l);
    }
    
    
    function user_get_mod_change_list ($uid) {
      $l = '';
      $erg = db_query("SELECT prefix_modules.id, uid FROM prefix_modules LEFT JOIN prefix_modulerights ON prefix_modulerights.mid = prefix_modules.id AND prefix_modulerights.uid = ".$uid." WHERE fright = 1 ORDER BY prefix_modules.name");
      while ($r = db_fetch_assoc($erg)) {
        if ($r['uid'] == '') { $c = ''; } else { $c = ' checked'; }
        $l .= '<td align="center"><input onChange="changeModulRecht('.$r['id'].','.$uid.')" type="checkbox" id="MN'.$r['id'].$uid.'" name="MN'.$r['id'].$uid.'" '.$c.' /></td>';
      }
      return ($l);
    }
    
    function user_get_mod_list ($uid) {
      $l = 'Modulrechte:<br />';
      $erg = db_query("SELECT DISTINCT module FROM prefix_modulerights WHERE uid = ".$uid);
      while ($r = db_fetch_assoc($erg)) {
        $l .= '- '.$r['module'].'<br />';
      }
      return ($l);
    }
    
    function getfl($gid) {
      $liste = '';
      $erg = db_query("SELECT view,name,reply,start,mods FROM prefix_forums WHERE view = ".$gid." OR reply = ".$gid." OR start = ".$gid." OR mods = ".$gid);
            while ($row = db_fetch_assoc($erg) ) {
              $v = ( $row['view'] == $gid ? 'sehen/lesen,' : '' );
                    $r = ( $row['reply'] == $gid ? 'antworten,' : '' );
                    $s = ( $row['start'] == $gid ? 'Themen starten,' : '' );
                    $m = ( $row['mods'] == $gid ? 'Moderieren,' : '' );
              $liste .= $row['name'].'<span class="smalfont">('.$v.$r.$s.$m.')</span>&nbsp;';
            }
      return($liste);
    }
    
    $um = $menu->get(1);
    switch($um) {
            default :
        $design = new design ( 'Admins Area', 'Admins Area', 2 );
        $design->header();
        $q = '';
        if ( isset($_REQUEST['q']) ) {
          $q = escape($_REQUEST['q'],'string');
        }
        $tpl = new tpl ( 'user/user', 1);
        $tpl->set('modlall', user_get_all_mod_list());
        $tpl->set('anzmods', db_result(db_query("SELECT COUNT(*) FROM prefix_modules WHERE fright = 1"),0) );
        $tpl->set_out('q',unescape($q),0);
    
        $q = str_replace('*','%',$q);
        if ( strpos($q,'%') === FALSE ) {
          $q = $q.'%';
        }
    
        $limit = 15;  // Limit
        $page = ($menu->getA(1) == 'p' ? $menu->getE(1) : 1 );
        $MPL = db_make_sites ($page , "WHERE name LIKE '".$q."'" , $limit , '?user' , 'user' );
        $anfang = ($page - 1) * $limit;
        $class = '';
        $q = "SELECT name,recht,id FROM `prefix_user` WHERE name LIKE '".$q."' ORDER by recht,posts DESC LIMIT ".$anfang.",".$limit;
        $erg = db_query($q);
        while ($row = db_fetch_object($erg)) {
                if ($class == 'Cmite') { $class = 'Cnorm'; } else { $class = 'Cmite'; }
                $ar = array ( 'name' => $row->name,
            'class' => $class,
            'id' => $row->id,
            'grouplist' => user_get_group_list($row->id),
                  'recht' => dblistee($row->recht,"SELECT id,name FROM prefix_grundrechte ORDER BY id ASC"),
            'modslist' => user_get_mod_change_list($row->id),
                );
    
                $tpl->set_ar_out($ar,1);
        }
        $tpl->set_out('MPL',$MPL,2);
        $design->footer();
              break;
    
      # modulrechte fuer einen user aendern
      case 'modulrecht' :
        $uid = intval($menu->get(2));
        $modul = intval($_REQUEST['modul']);
        $aktion = $_REQUEST['aktion'];
        if ( $aktion == 'eintragen' AND 0 == db_result(db_query("SELECT COUNT(*) FROM prefix_modulerights WHERE mid = '".$modul."' AND uid = ".$uid),0) ) {
          db_query("INSERT INTO prefix_modulerights (mid,uid) VALUES ('".$modul."',".$uid.")");
        } elseif ($aktion == 'loeschen' AND 1 == db_result(db_query("SELECT COUNT(*) FROM prefix_modulerights WHERE mid = '".$modul."' AND uid = ".$uid),0) ) {
          db_query("DELETE FROM prefix_modulerights WHERE mid = '".$modul."' AND uid = ".$uid);
        }
        ?><html><head><script language="JavaScript" type="text/javascript"><!--  opener.location.reload();
        function closeThisWindow() { opener.focus(); window.close(); } closeThisWindow()
        //--></script></head><body></body></html><?php
        break;
    
      # gruppen zugehoerigkeiten eines users aendern
      case 'gruppen' :
        $uid = $menu->get(2);
        if (isset($_POST['usergroups'])) {
          $erg = db_query("SELECT id FROM prefix_groups");
          while($row = db_fetch_assoc($erg) ) {
                  $ck = db_count_query("SELECT COUNT(uid) FROM prefix_groupusers WHERE uid = ".$uid." AND gid = ".$row['id']);
                   if ( $ck == 0 AND isset ( $_POST['grprhave'][$row['id']][$uid] ) ) {
                          db_query("INSERT INTO prefix_groupusers (uid,gid) VALUES ( ".$uid.", ".$row['id']." )");
                        } elseif ( $ck == 1 AND !isset ( $_POST['grprhave'][$row['id']][$uid] ) ) {
                          db_query("DELETE FROM prefix_groupusers WHERE uid = ".$uid." AND gid = ".$row['id']);
                        }
          }
        }
    
              $user_name = db_result(db_query("SELECT name FROM prefix_user WHERE id = ".$uid),0);
              $tpl = new tpl ( 'user/gruppen', 1);
              $tpl->set_ar_out( array('username'=>$user_name,'userid'=>$uid),0);
              $class = 'Cnorm';
              $erg = db_query("SELECT name,id FROM prefix_groups");
        while($row = db_fetch_assoc($erg) ) {
                $ck = db_count_query("SELECT COUNT(uid) FROM prefix_groupusers WHERE uid = ".$uid." AND gid = ".$row['id']);
                      $row['ck'] = ( $ck == 0 ? '' : 'checked' );
                $class = ($class == 'Cnorm' ? 'Cmite' : 'Cnorm' );
                $row['class'] = $class;
                $tpl->set_ar_out($row,1);
              }
              $tpl->out(2);
        break;
    
      # das recht eines users aendern
      case 'changeRecht' :
        $uid  = $menu->get(2);
        $altes_recht = db_result(db_query("SELECT recht FROM prefix_user WHERE id = ".$uid),0);
        $neues_recht = escape($_GET['newr'], 'integer');
        if (($neues_recht > $_SESSION['authright'] AND $altes_recht > $_SESSION['authright']) OR ($_SESSION['authid'] == 1 AND $uid <> 1)) {
          $q = "UPDATE prefix_user SET recht = ".$neues_recht." WHERE id = ".$uid;
          db_query($q);
        }
        ?><html><head><script language="JavaScript" type="text/javascript"><!--
        function closeThisWindow() { opener.focus(); window.close(); } closeThisWindow()
        //--></script></head><body></body></html><?php
        break;
    
      # details eines users anzeigen
            case 1 :
        $design = new design ( 'Admins Area', 'Admins Area', 2 );
        $design->header();
              if ( isset ($_REQUEST['uID'])) { $uid = $_REQUEST['uID']; } else {$uid = $menu->get(2); }
        $erg = db_query("SELECT name,email,id,recht,wohnort,homepage,aim,msn,icq,yahoo,avatar,userpict,status,staat,gebdatum,sig,opt_pm,opt_pm_popup,opt_mail,geschlecht,spezrank FROM prefix_user WHERE id = '".$uid."'");
                    if ( db_num_rows($erg) == 0 ) {
                die ('Fehler: Username nicht gefunden <a href="?user">zur&uuml;ck</a>');
              } else {
                            $row = db_fetch_assoc($erg);
    
                            $tpl = new tpl ( 'user/details', 1);
                            $row['recht'] = dbliste ( $row['recht'] , $tpl, 'recht', "SELECT id,name FROM prefix_grundrechte ORDER BY id ASC");
                            $row['staat'] = '<option></option>'.arliste ( $row['staat'] , get_nationality_array() , $tpl , 'staat' );
          $row['spezrank'] = '<option></option>'.dbliste ( $row['spezrank'], $tpl, 'spezrank', "SELECT id, bez FROM prefix_ranks WHERE spez = 1"  );
    
          $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'; }
          /*Script change by Nero Start */
          $row['userpict'] = ( file_exists ( $row['userpict'] ) ? '<img src="'.$row['userpict'].'" alt=""><br />' : '' );
          $row['avatarbild'] = ( file_exists ( $row['avatar'] ) ? '<img src="'.$row['avatar'].'" alt=""><br />' : '' );
        $row['ppicbreite'] = $allgAr['ppicbreite'];
        $row['ppichohe'] = $allgAr['ppichohe'];
        $row['ppicsize'] = $allgAr['ppicsize'];
        $row['Fabreite'] = $allgAr['Fabreite'];
        $row['Fahohe'] = $allgAr['Fahohe'];
        $row['Fasize'] = $allgAr['Fasize'];
        $row['forum_max_sig'] = $allgAr['forum_max_sig'];
           /*Script change by Nero Ende */
    
                            $tpl->set_ar_out ($row,0);
    
                            profilefields_change ( $row['id'] );
    
                            $tpl->out(1);
              }
        $design->footer();
              break;
    
      # details des users aendern
            case 2 :
        $design = new design ( 'Admins Area', 'Admins Area', 2 );
        $design->header();
              $changeok = true;
                    $uid = escape($_POST['uID'], 'integer');
    
                    $altes_recht = db_result(db_query("SELECT recht FROM prefix_user WHERE id = ".$uid),0);
        $neues_recht = escape($_POST['urecht'], 'integer');
        if (($neues_recht <= $_SESSION['authright'] OR $altes_recht <= $_SESSION['authright']) AND $_SESSION['authid'] > 1) {
          $changeok = false;
        }
    
                    if ( $changeok ) {
    
                    if (isset($_POST['userdel'])) {
                      db_query('DELETE FROM prefix_user WHERE id = "'.$uid.'"');
                            db_query('DELETE FROM prefix_userfields WHERE uid = "'.$uid.'"');
          db_query("DELETE FROM prefix_groupusers WHERE uid = ".$uid);
          db_query("DELETE FROM prefix_modulerights WHERE uid = ".$uid);
          db_query("DELETE FROM prefix_pm WHERE eid = ".$uid);
                            wd ('?user','User wurde erfolgreich gel&ouml;scht');
                    } else {
                      $abf = "SELECT * FROM prefix_user WHERE id = '".$uid."'";
                            $erg = db_query($abf);
                            $row = db_fetch_object($erg);
    
                      if (isset($_POST['passw'])) {
                        $newPass = genkey ( 8 );
                                    $newPassMD5 = md5($newPass);
                                    icmail ( $row->email , 'neues Password' , "Hallo\n\nDein Password wurde soeben von einem Administrator geaendert es ist nun:\n\n$newPass\n\nGru� der Administrator");
                        db_query('UPDATE `prefix_user` SET pass = "'.$newPassMD5.'" WHERE id = "'.$_POST['uID'].'"');
                            }
    
          profilefields_change_save ( $_POST['uID'] );
    
          /*Script change by Nero Start */
            # avatar speichern START
                            $avatar_sql_update = '';
          if ( !empty ( $_FILES['avatarfile']['name'] ) ) {
                                    $file_tmpe = $_FILES['avatarfile']['tmp_name'];
                                    $file_type = $_FILES['avatarfile']['type'];
                                    $file_size = $_FILES['avatarfile']['size'];
                                    $file_name = $_FILES['avatarfile']['name'];
            $fmsg = $lang['avatarisnopicture'];
                                    if ( substr ( $file_type , 0 , 6 ) == 'image/' ) {
                                      $endung = preg_replace("/.*\.([^\.]+)/", "\\1", $file_name);
                                      $size   = getimagesize($file_tmpe);
              $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/'.$uid.'.'.$endung;
                                                    @unlink (db_result(db_query("SELECT avatar FROM prefix_user WHERE id = ".$uid),0));
                move_uploaded_file ( $file_tmpe , $neuer_name );
                $avatar_sql_update = 'avatar = "'.$neuer_name.'",';
                $fmsg = $lang['pictureupload'].'(avatar = '.$neuer_name.')';
                                            }
                                    }
                            } elseif ( isset($_POST['avatardel']) ) {
            $fmsg = $lang['picturedelete'];
            @unlink (db_result(db_query("SELECT avatar FROM prefix_user WHERE id = ".$uid),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'];
                                    $file_type = $_FILES['userpictfile']['type'];
                                    $file_size = $_FILES['userpictfile']['size'];
                                    $file_name = $_FILES['userpictfile']['name'];
            $fmsg = $lang['userpictisnopicture'];
                                    if ( substr ( $file_type , 0 , 6 ) == 'image/' ) {
                                      $endung = preg_replace("/.*\.([^\.]+)/", "\\1", $file_name);
                                      $size   = getimagesize($file_tmpe);
              $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/'.$uid.'.'.$endung;
                                                    @unlink (db_result(db_query("SELECT userpict FROM prefix_user WHERE id = ".$uid),0));
                move_uploaded_file ( $file_tmpe , $neuer_name );
                $userpict_sql_update = 'userpict = "'.$neuer_name.'",';
                $fmsg = $lang['pictureupload'].'(userpict = '.$neuer_name.')';
                                            }
                                    }
                            } elseif ( isset($_POST['userpictdel']) ) {
            $fmsg = $lang['picturedelete'];
            @unlink (db_result(db_query("SELECT userpict FROM prefix_user WHERE id = ".$uid),0));
            $userpict_sql_update = 'userpict = "",';
          }
    
      # userpict speichern ENDE
      /*Script change by Nero Ende */
    
    
    
    
          $usaName1     = escape($_POST['usaName1'], 'string');
          $email        = escape($_POST['email'], 'string');
          $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');
          $aim          = escape($_POST['aim'], 'string');
          $staat        = escape($_POST['staat'], 'string');
          $spezrank     = escape($_POST['spezrank'], 'integer');
          $geschlecht   = escape($_POST['geschlecht'], 'integer');
          $status       = escape($_POST['status'], 'integer');
          $opt_mail     = escape($_POST['opt_mail'], 'integer');
          $opt_pm       = escape($_POST['opt_pm'], 'integer');
          $opt_pm_popup = escape($_POST['opt_pm_popup'], 'integer');
          $gebdatum     = escape($_POST['gebdatum'], 'string');
          $sig          = escape($_POST['sig'], 'string');
    
          db_query('UPDATE prefix_user SET
                                            name  = "'.$usaName1.'",
                                            recht = "'.$neues_recht.'",
                                            email = "'.$email.'",
                                              homepage = "'.$homepage.'",
                                              wohnort = "'.$wohnort.'",
                                              icq = "'.$icq.'",
                                              msn = "'.$msn.'",
                                              yahoo = "'.$yahoo.'",
                                              aim = "'.$aim.'",
                                              '.$avatar_sql_update.'
                                              '.$userpict_sql_update.'
                                              staat = "'.$staat.'",
                                              spezrank = "'.$spezrank.'",
                                              geschlecht = "'.$geschlecht.'",
                                              status = "'.$status.'",
                                              opt_mail = "'.$opt_mail.'",
                                              opt_pm = "'.$opt_pm.'",
                                              opt_pm_popup = "'.$opt_pm_popup.'",
                                              gebdatum = "'.$gebdatum.'",
                                              sig = "'.$sig.'"
          WHERE id = '.$uid) OR die('datenbankprob');
              }
                    }
                    $fmsg = ( isset($fmsg) ? $fmsg : '');
                    wd('admin.php?user-1-'.$uid,'Das Profil wurde erfolgreich geaendert <br /> '.$fmsg,2);
        $design->footer();
              break;
    
      # mal kurz nen neuen user anlegen
      case 'createNewUser' :
        $msg = '';
        if (!empty($_POST['name']) AND !empty($_POST['pass']) AND !empty($_POST['email'])) {
                $erg = db_query("SELECT id FROM prefix_user WHERE name = BINARY '".$_POST['name']."'");
                      if ( db_num_rows($erg) > 0 ) {
           $msg = 'Der Name ist leider schon vorhanden!';
                      } else {
                        $new_pass = $_POST['pass'];
                        $md5_pass = md5($new_pass);
                        db_query("INSERT INTO prefix_user (name,pass,recht,regist,llogin,email)
                        VALUES('".$_POST['name']."','".$md5_pass."',".$_POST['recht'].",'".time()."','".time()."','".$_POST['email']."')");
                        $userid = db_last_id();
                        db_query("INSERT INTO prefix_userfields (uid,fid,val) VALUES (".$userid.",2,'1')");
                        db_query("INSERT INTO prefix_userfields (uid,fid,val) VALUES (".$userid.",3,'1')");
    
                        if (isset($_POST['info']) ) {
                          $page = $_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"];
                                $page = str_replace('admin.php','index.php',$page);
              $tpl = new tpl ('user/new_user_email', 1);
              $tpl->set('name', $_POST['name']);
              $tpl->set('pass', $_POST['pass']);
              $tpl->set('page', $page);
              $txt = $tpl->get(0);
              unset($tpl);
                          icmail ( $_POST['email'], 'Admin hat dich angelegt', $txt );
                        }
                        $msg = 'Benutzer angelegt <a href="javascript:closeThisWindow()">Fenster schliesen</a>';
          }
        }
        $pass = '';
        $email = '';
        $recht= '';
        if (isset($_POST['pass'])) { $pass = $_POST['pass']; }
        if (isset($_POST['email'])) { $email = $_POST['email']; }
        if (isset($_POST['recht'])) { $recht = $_POST['recht']; }else{$recht = '-1';}
        $tpl = new tpl ('user/new_user', 1);
        $tpl->set('msg',$msg);
        $tpl->set('pass',$pass);
        $tpl->set('email',$email);
        $tpl->set('recht',dblistee($recht,"SELECT id,name FROM prefix_grundrechte ORDER BY id ASC"));
        $tpl->out(0);
        break;
    
      # einen user komplett loeschen
      case 'deleteUser' :
        $uid  = $menu->get(2);
        if ( $uid <> 1 ) {
                      db_query("DELETE FROM prefix_user WHERE id = ".$uid);
                            db_query("DELETE FROM prefix_userfields WHERE uid = ".$uid);
          db_query("DELETE FROM prefix_groupusers WHERE uid = ".$uid);
          db_query("DELETE FROM prefix_modulerights WHERE uid = ".$uid);
          db_query("DELETE FROM prefix_pm WHERE eid = ".$uid);
          ?><html><head><script language="JavaScript" type="text/javascript"><!--
          function closeThisWindow() { opener.location.reload(); opener.focus(); window.close(); } closeThisWindow()
          //--></script></head><body></body></html><?php
        }
        break;
    }
    
    
    
    
    ?>


    details.htm
    <form action="admin.php?user-2" method="POST" enctype="multipart/form-data">
            <input type="hidden" name="uID" value="{id}">
    
      <table border="0" cellspacing="1" cellpadding="3" class="border">
              <tr class="Chead"><td colspan="2"><b>Details von {name}</b></td></tr>
         <tr>
          <td width="20%" class="Cmite">Recht</td>
          <td width="80%" class="Cnorm"><select name="urecht">{_list_recht@<option%1 value="%2">%3</option>}</select></td>
        </tr><tr>
          <td class="Cmite">Name</td>
          <td class="Cnorm"><input name='usaName1' maxlength="100" value='{name}'></td>
        </tr><tr>
          <td class="Cmite">eMail</td>
          <td class="Cnorm"><input name='email' maxlength="100" value='{email}'></td>
        </tr><tr>
                      <td class="Cmite">Homepage</td>
                            <td class="Cnorm"><input name="homepage" value="{homepage}" /></td>
                    </tr><tr>
                      <td class="Cmite">Wohnort</td>
                            <td class="Cnorm"><input name="wohnort" value="{wohnort}" /></td>
                    </tr><tr>
                      <td class="Cmite">ICQ</td>
                            <td class="Cnorm"><input name="icq" value="{icq}" /></td>
                    </tr><tr>
                      <td class="Cmite">MSN</td>
                            <td class="Cnorm"><input name="msn" value="{msn}" /></td>
                    </tr><tr>
                      <td class="Cmite">Yahoo</td>
                            <td class="Cnorm"><input name="yahoo" value="{yahoo}" /></td>
                    </tr><tr>
                      <td class="Cmite">AIM</td>
                            <td class="Cnorm"><input name="aim" value="{aim}" /></td>
                    </tr><tr>
                      <td class="Cmite">Gebdatum</td>
                            <td class="Cnorm"><input name="gebdatum" value="{gebdatum}" /></td>
                    </tr><tr>
          <td class="Cmite">Staat</td>
          <td class="Cnorm"><select name="staat">{_list_staat@<option%1 value="%2">%3</option>}</select></td>
        </tr><tr>
          <td class="Cmite">Rank</td>
          <td class="Cnorm"><select name="spezrank">{_list_spezrank@<option%1 value="%2">%3</option>}</select></td>
        </tr><tr>
          <td class="Cmite">Geschlecht</td>
          <td class="Cnorm"><input type="radio" value="1" name="geschlecht" {geschlecht1} /> männlich, <input type="radio" value="2" name="geschlecht" {geschlecht2} /> weiblich, <input type="radio" value="0" name="geschlecht" {geschlecht0} /> wurstegal</td>
        </tr><tr>
          <td class="Cmite">Status</td>
          <td class="Cnorm"><input type="radio" value="1" name="status" {status1} /> aktiv, <input type="radio" value="0" name="status" {status0} /> inaktiv</td>
        </tr><tr>
          <td class="Cmite">eMails</td>
          <td class="Cnorm"><input type="radio" value="1" name="opt_mail" {opt_mail1} /> ja, <input type="radio" value="0" name="opt_mail" {opt_mail0} /> nein &nbsp; ||Erklärung: eMails von anderen Usern?</td>
        </tr><tr>
          <td class="Cmite">PrivMsgs</td>
          <td class="Cnorm"><input type="radio" value="1" name="opt_pm" {opt_pm1} /> ja, <input type="radio" value="0" name="opt_pm" {opt_pm0} /> nein &nbsp; ||Erklärung: PrivMsgs von anderen Usern?</td>
        </tr><tr>
          <td class="Cmite">PrivMsgs Popup</td>
          <td class="Cnorm"><input type="radio" value="1" name="opt_pm_popup" {opt_pm_popup1} /> ja, <input type="radio" value="0" name="opt_pm_popup" {opt_pm_popup0} /> nein &nbsp; ||Erklärung: Popup bei einer neuen PrivMsgs?</td>
        </tr><tr>
                           <!--Script change by Nero Ende -->
                      <td class="Cmite">{_lang_userpict}</td>
                            <td class="Cnorm">
                                <label style="float:left; width:35%;">&nbsp;</label>{userpict}<input type="checkbox" value="yes" name="userpictdel" /> {_lang_delete}?<br /><br />
                                <label style="float:left; width:35%;">&nbsp;</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 />
                            </td>
                             </tr><tr>
                      <td class="Cmite">{_lang_avatar}</td>
                            <td class="Cnorm">
                                <label style="float:left; width:35%;">&nbsp;</label>{avatarbild}<input type="checkbox" value="yes" name="avatardel" /> {_lang_delete}?<br /><br />
                                <label style="float:left; width:35%;">&nbsp;</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 />
                           <!--Script change by Nero Ende -->
                           </td>
        </tr><tr>
                      <td class="Cmite">Userpict</td>
                            <td class="Cnorm"><input type="checkbox" name="userpictdel" value="1">Löschen ?</td>
                    </tr><tr>
          <td class="Cmite">Password</td>
          <td class="Cnorm"><input type="checkbox" name="passw" value="1">neues generieren ?</td>
        </tr><tr>
          <td class="Cmite">User</td>
          <td class="Cnorm"><input type="checkbox" name="userdel" value="1">Löschen ? <font color="#FF0000">Achtung der User wird <strong>ohne Rückfrage</strong> gelöscht</font></td>
        </tr><tr>
                      <td class="Cmite">Signature</td>
                            <td class="Cnorm"><textarea cols="60" rows="2" name="sig">{sig}</textarea></td>
                    </tr><tr>
          <td colspan="2" class="Cnorm">
    
    
      <fieldset><legend>Profilefields </legend>
    
        {EXPLODE}
    
     </fieldset>
        </td></tr>
                    <tr>
          <td class="Cdark"></td>
          <td class="Cdark">
            <input type='submit' value='Ändern' name="submit">
          </td>
        </tr>
    
      </table>
    </form>



    Zuletzt modifiziert von Soldat53b am 20.05.2009 - 17:53:45
    0 Mitglieder finden den Beitrag gut.
Geschlossen

Zurück zu Module und Modifikationen

Optionen: Bei einer Antwort zu diesem Thema eine eMail erhalten