Advertisement
Syntafin

members.php

Feb 3rd, 2012
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.91 KB | None | 0 0
  1. <?php if( (isset($_GET['action'])) AND ($_GET['action'] == 'login') ) {
  2.     echo('<p>Das Login ist noch nicht verf&uuml;gbar!<br /><br /><a href="?p=members">Zur&uuml;ck</a></p>'."\n");
  3. }else if($_GET['action'] == 'register'){
  4.     echo('<p>Die Registrierung ist noch nicht aktiv!<br /><br /><a href="?p=members">Zur&uuml;ck</a></p>'."\n");
  5.     echo('<form name="reg" method="post" action="?p=members&amp;action=register&amp;do=send">'."\n");
  6.     echo('<p>'."\n");
  7.     echo('<label for="nick">Minecraft-Nutzername*:</label>'."\n");
  8.     echo('<input type="text" name="nick" id="nick" required>'."\n");
  9.     echo('<br />'."\n");
  10.     echo('<label for="dname">Anzeige Name*:</label>'."\n");
  11.     echo('<input type="text" name="dname" id="dname" required>'."\n");
  12.     echo('<label for="passwort"><br />'."\n");
  13.     echo('Passwort*:</label>'."\n");
  14.     echo('<input type="password" name="passwort" id="passwort" required>'."\n");
  15.     echo('<br />'."\n");
  16.     echo('<label for="email">Email-Adresse*:</label>'."\n");
  17.     echo('<input type="mail" name="email" id="email" required>'."\n");
  18.     echo('<br />'."\n");
  19.     echo('<br />'."\n");
  20.     echo('<input type="checkbox" name="agb" id="agb">'."\n");
  21.     echo('Ich habe die AGB/<a href="?p=faq&amp;mode=view&amp;id=2">Regeln</a> gelesen und akzeptiert.</p>'."\n");
  22.     echo('<p>'."\n");
  23.     echo(' <input type="submit" name="send" id="send" value="Registrierung abschlie&szlig;en">'."\n");
  24.     echo('</p>'."\n");
  25.     echo('</form>'."\n");
  26. }else if(isset($_GET['action']) == 'info'){
  27.     $user = $_GET['user'];
  28.     $sql = "SELECT * FROM user WHERE nick='".mysql_real_escape_string($user)."'";
  29.     $entry = mysql_query($sql,$datenbank) or die(mysql_error());
  30.     while($user = mysql_fetch_object($entry))
  31.     {
  32.         echo('<table width="95%">'."\n");
  33.         echo('<tr>'."\n");
  34.         echo('<th><p>Profil von '. $user->dname .'</p></th>'."\n");
  35.         echo('<th><a href="?p=members">Zur&uuml;ck zur &Uuml;bersicht</a></th>'."\n");
  36.         echo('</tr>'."\n");
  37.         echo('<tr>'."\n");
  38.         echo('<td><img src="content/images/avatare/'.$user->ava.'" width="120" height="120" alt="char'.$user->ava.'" /></td>'."\n");
  39.         echo('<td><p>'. $user->info .'</p></td>'."\n");
  40.         echo('</tr>'."\n");
  41.         echo('<tr>'."\n");
  42.         echo('<td><p>Mitglied seit:</p></td>'."\n");
  43.         echo('<td><p>'. $user->regdatum .'</p></td>'."\n");
  44.         echo('</tr>'."\n");
  45.         echo('<tr>'."\n");
  46.         echo('<td><p>Kontakt:</p></td>'."\n");
  47.         echo('<td>'."\n");
  48.         echo('<table>'."\n");
  49.         echo('<tr><p><img src="content/images/icq.png" alt="icq" width="50" height="50" border="0" /> '. $user->icq .'</p></tr>'."\n");
  50.         echo('<tr><p><img src="content/images/msn.png" alt="icq" width="50" height="50" border="0" /> '. $user->msn .'</p></tr>'."\n");
  51.         echo('<tr><p><img src="content/images/skype.png" alt="icq" width="50" height="50" border="0" /> '. $user->skype .'</p></tr>'."\n");
  52.         echo('<tr><p><img src="content/images/xmpp.png" alt="icq" width="50" height="50" border="0" /> '. $user->xmpp .'</p></td>'."\n");
  53.         echo('</table>'."\n");
  54.         echo('</tr>'."\n");
  55.         echo('<tr>'."\n");
  56.         echo('<td><p>Position:</p></td>'."\n");
  57.         echo('<td><p>'. $user->rank .'</p></td>'."\n");
  58.         echo('</tr>'."\n");
  59.         echo('</td>'."\n");
  60.         echo('</tr>'."\n");
  61.         echo('</table>'."\n");
  62.         echo('<table width="95%">'."\n");
  63.         echo('<tr>'."\n");
  64.         echo('<td>'. $user->signatur .'</td>'."\n");
  65.         echo('</tr>'."\n");
  66.         echo('</table>'."\n");
  67.         if($user->rank == 'Admin') {
  68.             echo('<h4>Letzte News Beitr&auml;ge</h4>'."\n");
  69.             echo('<ul class="archive">'."\n");
  70.             $sql2 = "SELECT * FROM news where autor='".mysql_real_escape_string($_GET['user'])."' ORDER BY id DESC LIMIT 0, 3";
  71.             $entry = mysql_query($sql2,$datenbank) or die(mysql_error());
  72.             while($lastnews = mysql_fetch_object($entry))
  73.             {
  74.                 echo('<li>'."\n");
  75.                 echo('<div class="post-title"><a href="?p=news&amp;mode=view&amp;id='.$lastnews->id.'">'.$lastnews->title.'</a></div>'."\n");
  76.                 echo('<div class="post-details">Geschrieben am '.$lastnews->datum.'</a> | Gespeichert unter <a href="?p=news&amp;sel=cat&amp;cat='.$lastnews->cat.'">'.$lastnews->cat.'</a></div>'."\n");
  77.                 echo('</li>'."\n");
  78.             }
  79.             echo('</ul>'."\n");
  80.         }elseif($user->rank == 'Mod') {
  81.             echo('<h4>Letzte News Beitr&auml;ge</h4>'."\n");
  82.             echo('<ul class="archive">'."\n");
  83.             $sql2 = "SELECT * FROM news where autor='".mysql_real_escape_string($_GET['user'])."' ORDER BY id DESC LIMIT 0, 3";
  84.             $entry = mysql_query($sql2,$datenbank) or die(mysql_error());
  85.             while($lastnews = mysql_fetch_object($entry))
  86.             {
  87.                 echo('<li>'."\n");
  88.                 echo('<div class="post-title"><a href="?p=news&amp;mode=view&amp;id='.$lastnews->id.'">'.$lastnews->title.'</a></div>'."\n");
  89.                 echo('<div class="post-details">Geschrieben am '.$lastnews->datum.'</a> | Gespeichert unter <a href="?p=news&amp;sel=cat&amp;cat='.$lastnews->cat.'">'.$lastnews->cat.'</a></div>'."\n");
  90.                 echo('</li>'."\n");
  91.             }
  92.             echo('</ul>'."\n");
  93.         }
  94.         echo('<p>&nbsp;&nbsp;</p>'."\n");
  95.         if($user->rank == 'Admin') {
  96.             echo('<h4>Letzte FAQ Eintr&auml;ge</h4>'."\n");
  97.             echo('<ul class="archive">'."\n");
  98.             $sql3 = "SELECT * FROM faq where autor='".mysql_real_escape_string($_GET['user'])."' ORDER BY id DESC LIMIT 0, 3";
  99.             $entry = mysql_query($sql3,$datenbank) or die(mysql_error());
  100.             while($lastfaq = mysql_fetch_object($entry))
  101.             {
  102.                 echo('<li>'."\n");
  103.                 echo('<div class="post-title"><a href="?p=news&amp;mode=view&amp;id='.$lastfaq->id.'">'.$lastfaq->title.'</a></div>'."\n");
  104.                 echo('<div class="post-details">Geschrieben am '.$lastfaq->datum.'</a></div>'."\n");
  105.                 echo('</li>'."\n");
  106.             }
  107.             echo('</ul>'."\n");
  108.         }elseif($user->rank == 'Mod') {
  109.             echo('<h4>Letzte FAQ Eintr&auml;ge</h4>'."\n");
  110.             echo('<ul class="archive">'."\n");
  111.             $sql3 = "SELECT * FROM faq where autor='".mysql_real_escape_string($_GET['user'])."' ORDER BY id DESC LIMIT 0, 3";
  112.             $entry = mysql_query($sql3,$datenbank) or die(mysql_error());
  113.             while($lastfaq = mysql_fetch_object($entry))
  114.             {
  115.                 echo('<li>'."\n");
  116.                 echo('<div class="post-title"><a href="?p=news&amp;mode=view&amp;id='.$lastfaq->id.'">'.$lastfaq->title.'</a></div>'."\n");
  117.                 echo('<div class="post-details">Geschrieben am '.$lastfaq->datum.'</a></div>'."\n");
  118.                 echo('</li>'."\n");
  119.             }
  120.             echo('</ul>'."\n");
  121.         }
  122.     }
  123. }else{
  124.     echo('<p><a href="?p=members&amp;action=login">Login</a> | <a href="?p=members&amp;action=register">Registrieren</a>'."\n");
  125.     echo('<p>&nbsp;</p>'."\n");
  126.     echo('<table>'."\n");
  127.     echo('<tr>'."\n");
  128.     echo('<th>Avatar</th>'."\n");
  129.     echo('<th>Nickname</th>'."\n");
  130.     echo('<th>Rang</th>'."\n");
  131.     echo('<th>Info</th>'."\n");
  132.     echo('</tr>'."\n");
  133.     $sql = "SELECT * FROM user ORDER BY id";
  134.     $entry = mysql_query($sql,$datenbank) or die(mysql_error());
  135.     while($user = mysql_fetch_object($entry))
  136.     {
  137.         echo('<tr>'."\n");
  138.         echo('<td>'."\n");
  139.         echo('<a href="?p=members&amp;action=info&amp;user='. $user->nick .'"><img src="content/images/avatare/'.$user->ava.'" width="120" height="120" alt="char'.$user->ava.'" /></a>'."\n");
  140.         echo('</td>'."\n");
  141.         echo('<td>'."\n");
  142.         echo('<p>'. $user->dname .'</p>'."\n");
  143.         echo('</td>'."\n");
  144.         echo('<td>'."\n");
  145.         echo('<p>'. $user->rank .'</p>'."\n");
  146.         echo('</td>'."\n");
  147.         echo('<td>'."\n");
  148.         echo('<p>'. $user->info .'</p>'."\n");
  149.         echo('</td>'."\n");
  150.         echo('</tr>'."\n");
  151.     }
  152.     echo('</table>'."\n");
  153. }
  154.  
  155. if(isset($_GET['do']) AND 'send' == $_GET['do']) {
  156. $sqlk = "INSERT INTO user
  157.                    (
  158.                        nick,
  159.                        dname,
  160.                        password,
  161.                        email,
  162.                    )
  163.        VALUES
  164.                    (
  165.                        '".mysql_real_escape_string($_POST['nick'])."',
  166.                        '".mysql_real_escape_string($_POST['dname'])."',
  167.                        MD5('$_POST['passwort'])'),
  168.                        '".mysql_real_escape_string($_POST['email'])."'
  169.                    )";
  170. echo $sqlk; die();
  171. $qry = mysql_query($sqlk,$datenbank) or die(mysql_error());
  172. }
  173. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement