|
09.04.2006, 00:19
У меня не получается переписать блок
PHP код:
<?php
if (!defined('BLOCK_FILE')) {
Header("Location: ../index.php");
exit;
}
global $user, $cookie, $prefix, $db, $anonymous, $gfx_chk, $userinfo;
if (is_user($user)) {
getusrinfo($user);
$uname = $userinfo['username'];
$user_id = $userinfo['user_id'];
$user_avatar = $userinfo['user_avatar'];
if ($user_avatar) {
$content .= "<br><center><img src=\"modules/Forums/images/avatars/$user_avatar\"></center><br>\n";
}
$user_id = intval($user_id);
$content .= "<center><b>"._BWEL.",<br>$uname</b></center><hr>\n";
$newpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM ".$prefix."_bbprivmsgs WHERE privmsgs_to_userid='$user_id' AND (privmsgs_type='5' OR privmsgs_type='1')"));
$content .= "<table border=\"0\"><tr valign=\"middle\"><td><a href=\"index.php?name=Account&op=logout\"><img src=\"images/blocks/logout.gif\" border=\"0\"></td><td><a href=\"index.php?name=Account&op=logout\">"._LOGOUT."</a></td></tr></table><hr>\n";
$content .= "<table border=\"0\" width=\"100%\"><tr valign=\"middle\"><td colspan=\"2\" align=\"center\"><a href=\"http://forum.gamesims.spb.ru\"><b>"._BPM."</b></a></td></tr>\n";
if ($newpms != 0) {
$content .= "<tr><td><img src=\"images/red_dot.gif\"></td><td width=\"90%\">"._BUNREAD.": $newpms</td></tr></table><hr>\n";
} else {
$content .= "<tr><td><img src=\"images/blocks/Contact.gif\"></td><td width=\"90%\">"._BUNREAD.": $newpms</td></tr></table><hr>\n";
}
} else {
$content .= "<form action=\"index.php?name=Account\" method=\"post\">";
$content .= "<br><center><img src=\"modules/Forums/images/avatars/0.gif\"></center><br>\n";
$content .= "<center><b>"._WELCOMETO.",<br>$anonymous</b></center><hr>\n";
$content .= "<table border=\"0\"><tr valign=\"middle\"><td><a href=\"index.php?name=Account&op=new_user\"><img src=\"images/blocks/new_user.gif\" border=\"0\"></td><td><a href=\"index.php?name=Account&op=new_user\">"._BREG."</a></td></tr></table>\n";
$content .= "<table border=\"0\"><tr valign=\"middle\"><td><a href=\"index.php?name=Account&op=pass_lost\"><img src=\"images/blocks/pass_lost.gif\" border=\"0\"></td><td><a href=\"index.php?name=Account&op=pass_lost\">"._PASSFOR."</a></td></tr></table><hr>\n";
$content .= "<table align=\"center\" width=\"100%\"><tr><td>"._NICKNAME.":</td><td><input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\"></td></tr>";
$content .= "<tr><td>"._PASSWORD.":</td><td><input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\"></td></tr>";
if (extension_loaded("gd") AND ($gfx_chk == 2 OR $gfx_chk == 4 OR $gfx_chk == 5 OR $gfx_chk == 7)) {
mt_srand ((double)microtime()*1000000);
$maxran = 1000000;
$random_num = mt_rand(0, $maxran);
$content .= "<tr><td>"._SECURITYCODE.":</td><td><img src='?gfx=gfx&random_num=$random_num' border='1' alt='"._SECURITYCODE."' title='"._SECURITYCODE."'></td></tr>";
$content .= "<tr><td>"._TYPESECCODE.":</td><td><input type=\"text\" name=\"gfx_check\" size=\"10\" maxlength=\"6\"></td></tr>";
$content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">\n";
} else {
$content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">\n";
$content .= "<input type=\"hidden\" name=\"gfx_check\" value=\"$code\">\n";
}
$content .= "<tr><td colspan=\"2\" align=\"center\"><input type=\"hidden\" name=\"op\" value=\"login\">\n";
$content .= "<input type=\"submit\" value=\""._LOGIN."\"></center></td></tr></form></table><hr>\n";
}
$strip = 10;
$result = $db->sql_query("SELECT uname, guest, module, UNIX_TIMESTAMP(now())-time AS time FROM ".$prefix."_session ORDER BY uname");
while (list($uname, $guest, $module, $time) = $db->sql_fetchrow($result)) {
$linkstrip = cutstr($module, $strip);
if ($guest == 0) {
$title_who = "<a href=\"index.php?name=Account&op=userinfo&username=$uname\" title=\"".displayTime($time)."\">$uname</a> - $linkstrip<br>";
$m++;
} else {
$title_who = "";
$u++;
}
$who_online[$guest] .= $title_who;
$i++;
}
if ($m == "") $m = 0;
if ($u == "") $u = 0;
if ($i == "") $i = 0;
$content .= "<table border=\"0\" width=\"100%\"><tr valign=\"middle\"><td colspan=\"2\" align=\"center\"><b>"._BVISIT."</b></td></tr>\n";
$content .= "<tr><td><img src=\"images/blocks/moderator.gif\"></td><td width=\"90%\">"._BMEM.": $m</td></tr>\n";
$content .= "<tr><td><img src=\"images/blocks/guest.gif\"></td width=\"90%\"><td>"._BVIS.": $u</td></tr>\n";
$content .= "<tr><td><img src=\"images/blocks/group.gif\"></td><td width=\"90%\">"._BOVER.": $i</td></tr></table>\n";
if ($who_online[0] != "") {
$content .= "<hr><table border=\"0\" width=\"100%\"><tr valign=\"middle\"><td align=\"center\"><b>"._BMEMVISIT."</b></td></tr><tr><td>$who_online[0]</td></tr></table>\n";
}
?>
Воть я делал по типу того что давался в комплекте но у меня не работает авторизация все ровно не подскажите как правельно?
P.S это стандартный блок я его почти не изменял.
|
|