<?php
Function ShowUserBlock($showavatar=1) {
Define('_PMPL_', 'Prywatne Wiadomości');
global $dblink,$visitorInfo,$admin,$user;
if (isUser($user)) {
$rowuser = $dblink->get_row("SELECT avatar FROM memht_utenti WHERE user='$user'");
$avatar = outCode($rowuser['avatar']);
echo "<div>"._HI_." <b>$user</b>";
echo "<br/>";
if ($showavatar==1) {
if ($avatar=="") { $avatar = "blank.png"; }
echo "<img src='images/avatar/$avatar' border='0' title='$user' alt='Avatar' />\n";
}
echo "<div class='small'><a href='http://memht.pl/pvtmsg.html' title='"._PMPL_."'>"._PMPL_."</a></div>";
$pmnew = $dblink->get_num("SELECT id FROM memht_pvtmsg WHERE recipient='$user' AND new=1");
if ($pmnew>0) { echo "<div class='small'><a href='pvtmsg.html' title='"._NEWMESSAGES_."'><b>"._NEWMESSAGES_."</b></a>: $pmnew</div>"; }
echo "<br/>";
echo "<div class='small'><a href='users_edit.html' title='"._MODIFYPROFILE_."'>"._MODIFYPROFILE_."</a></div>\n";
echo "<div class='small'><a href='users_logout.html' title='"._LOGOUT_."'>"._LOGOUT_."</a></div>\n";
} else {
$numatp = $dblink->get_num("SELECT ip FROM memht_login_flood WHERE ip='".$visitorInfo['ip']."' AND attempts>=5");
if ($numatp==0) {
echo "<form name='userlogin' method='post' action='index.php?page=users'>\n";
echo "<table width='100%' align='center' border='0' class='login2'>\n";
echo "<tr><td align='right'><input type='text' name='post_username' class='text'></td></tr>\n";
echo "<tr><td align='right'><input type='password' name='post_password' class='text2' ></td></tr>\n";
echo "<tr><td><input type='submit' name='Submit' value='Zaloguj'></td><td class='small'><a href='users_register.html' title='"._REGISTER_."'>"._REGISTER_."</a></td></tr>\n";
echo "<tr><td> </td><td class='small'><a href='users_lostpassword.html' title='"._LOSTPASS_."'>"._LOSTPASS_."</a></td></tr>";
echo "</table>\n";
echo "<input type='hidden' name='login' value='true'>";
echo "</form>\n";
} else {
echo "<div align='center'><b>"._YOUMUSTWAITTOLOGINAGAIN_."</b></div>\n";
}
}
}
ShowUserBlock(1);
?> |