boxes/login.php
<?php
# Copyright by Manuel
# Support www.ilch.de
defined ('main') or die ( 'no direct access' );
$dif = date('Y-m-d H:i:s', time() - 60);
$abf = "SELECT uid FROM `prefix_online` WHERE uptime > '". $dif."'";
$resultID = db_query($abf);
$brk='';
$uid = array();
$guests = 0;
$guestn = $lang['guests'];
$content='';
while ($row = db_fetch_object($resultID)) {
if ($row->uid != 0 AND $brk!=$row->uid) {
$name=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$row->uid),0);
$content.='<a href="index.php?user-details-'.$row->uid.'">'.$name.'</a>, '."";
$uid[] = $row->uid;
}
}
$tpl = new tpl ( 'user/boxen_login.htm' );
if ( loggedin() ) {
if ( user_has_admin_right($menu,false) ) {
$tpl->set ( 'ADMIN', '<a class="logfarbe" href="admin.php?admin">'.$lang['adminarea'].'</a>' );
} else {
$tpl->set ( 'ADMIN', '' );
}
if ( $allgAr['Fpmf'] == 1 ) {
$erg = db_query("SELECT COUNT(id) FROM `prefix_pm` WHERE gelesen = 0 AND status < 1 AND eid = ".$_SESSION['authid']);
$check_pm = db_result($erg,0);
$nachrichten_link = '<a class="logfarbe" href="index.php?forum-privmsg">'.$lang['messages'].'</a> ('.$check_pm.')<br>';
} else {
$nachrichten_link = '';
}
$abf1 = 'SELECT id, name, avatar FROM prefix_user WHERE name = "'.$_SESSION['authname'].'"';
$erg1 = db_query($abf1);
$row = db_fetch_object($erg1);
$id = $row->id;
if ( file_exists($row->avatar)) {
$avatar = '<br><img src="'.$row->avatar.'" border="0"><br>';
}else{
$avatar = '<br><img src="include/images/avatars/avat.png" border="0"><br>';
}
$tpl->set ( 'UID' , $id );
$tpl->set ( 'AVATAR' , $avatar );
$tpl->set ( 'SID' , session_id() );
$tpl->set ( 'NACHRICHTEN' , $nachrichten_link );
$tpl->set ( 'NAME', $_SESSION['authname'] );
$tpl->set ( 'USER', $content );
$tpl->out (0);
} else {
if (empty($_POST['login_name'])) { $_POST['login_name'] = 'Nickname'; }
if (empty($_POST['login_pw'])) { $_POST['login_pw'] = 'הההההההה'; }
$regist = '';
if ( $allgAr['forum_regist'] == 1 ) {
$regist = ' <a href="index.php?user-regist">Regist</a>';
}
$tpl->set_ar_out ( array ( 'regist' => $regist, 'wdlink' => '?'.$allgAr['smodul'], 'PASS' => $_POST['login_pw'], 'NAME' => $_POST['login_name'] ) , 1 );
}
unset($tpl);
?>
templates/user/boxen_login.htm
<table width="230" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left"></td>
</tr>
<tr>
<td valign="top"><br />
{NACHRICHTEN}
<a class="logfarbe" href="index.php?user-8">{_lang_profil} edit</a> | <a class="logfarbe" href="?user-details-{UID}" alt="Dein Profil" title="Dein Profil">ansehen</a><br />
<a class="logfarbe" href="index.php?user-3">{_lang_logout}</a><br /><br />Hallo <b>{NAME}</b> {ADMIN}
</td>
</tr>
</table>
{EXPLODE}
<table width="100%" border="0" cellspacing="0" cellpadding="10">
<tr>
<td align="center" valign="middle">
<form method="POST">
<img border="0" src="include/designs/sepp010/img/username.png"> <input type="text" name="name" size="20" value="{NAME}" onFocus="if (value == '{NAME}') {value = ''}" onBlur="if (value == '') {value = '{NAME}'}" maxlength="15" style="margin-top:5px; " /><br />
<img border="0" src="include/designs/sepp010/img/passwort.png"> <input type="password" size="20" value="{PASS}" onFocus="if (value == '{PASS}') {value = ''}" onBlur="if (value == '') {value = '{PASS}'}" maxlength="20" name="pass" style="margin-top:5px; " /><br />
<input type="hidden" name="wdlink" value="{wdlink}" />
<input type="submit" name="user_login_sub" value="Login" style="margin-top:5px; " /> <a class="logfarbe" href="index.php?user-regist">Anmelden</a>
</form>
</td>
</tr>
</table>
das template kann noch angepasst werden. profil edit, profil show usw sind drin, der avatar kann mit
{AVATAR} eingefügt werden
Zuletzt modifiziert von Chapter am 20.07.2010 - 13:35:31