Code:if (eregi("block-User_Info.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
}
function convertIP ($xip) {
global $admin;
if (is_admin($admin)) return $xip;
$xipx = explode('.',$xip);
for ($i=2;$i<count($xipx);$i++) {
$xipx[$i] = preg_replace ('/(0|1|2|3|4|5|6|7|8|9)/', "x", $xipx[$i]);
}
return implode('.',$xipx);
}
$content = "";
mt_srand ((double)microtime()*1000000);
global $dbi, $nukeurl, $startdate, $user, $cookie, $prefix, $user_prefix, $db, $anonymous, $mode, $t, $f, $redirect, $random_num, $admin, $gfx_chk;
mt_srand ((double)microtime()*1000000);
$maxran = 1000000;
$random_num = mt_rand(0, $maxran);
$datekey = date("F j");
$rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
$code = substr($rcode, 2, 10);
cookiedecode($user);
$uname = $cookie[1];
// Get the last user added to the database and the total users, minus anonymous
$sql = "SELECT username,user_id FROM $user_prefix"._users." ORDER BY user_id DESC LIMIT 0,1";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$lastusername = $row[username];
$lastuser = $row[user_id];
$numrows = $db->sql_fetchrow($db->sql_query("SELECT count(user_id) user_id FROM $user_prefix"._users.""));
$numrows = $numrows['user_id'];
$numrows1 = $numrows-1;
$sql = "SELECT s.host_addr, u.user_id, u.username, u.user_allow_viewonline FROM $prefix"._session." s,".$user_prefix."_users u WHERE s.guest=0 AND u.username=s.uname";
$result = $db->sql_query($sql);
$member_online_num = $db->sql_numrows($result);
$who_online_now = "";
$i = 1;
$hiddenTotal = 0;
while ($member_result = $db->sql_fetchrow($result)) {
if ($i < 10) $zi = "0$i";
else $zi = $i;
if (is_admin($admin)) {
$zi = "<a href=\"http://www.samspade.org/t/lookat?a=".$member_result[host_addr]."\" target=\"_blank\">".$zi."</a>";
}
$sessionNameModified = strlen($member_result[username])<13?$member_result[username]:substr($member_result[username],0,10)."...";
if (!$member_result[user_allow_viewonline]&&!is_admin($admin)) {
$hiddenTotal++;
}
elseif (!$member_result[user_allow_viewonline]&&is_admin($admin)) {
$hiddenTotal++;
$who_online_now .= "$zi: <a href=\"userinfo-.html$member_result[username]\"><img src=\"images/blocks/icon_mini_profile.gif\" border=\"0\" alt=\"Check the profile of $member_result[username]\"></a> <a href=\"messages-post-.html$member_result[user_id]\"><img src=\"images/blocks/nopm.gif\" border=\"0\" alt=\"Send a quick private message to $member_result[username]\"></a> <A HREF=\"forums.html?file=profile&mode=viewprofile&u=$member_result[user_id]\">".$sessionNameModified."</a>(H)<br />\n";
$who_online_now .= ($i != $member_online_num ? " " : "");
$i++;
}
else {
$who_online_now .= "$zi: <a href=\"userinfo-.html$member_result[username]\"><img src=\"images/blocks/icon_mini_profile.gif\" border=\"0\" alt=\"Check the profile of $member_result[username]\"></a> <a href=\"messages-post-.html$member_result[user_id]\"><img src=\"images/blocks/nopm.gif\" border=\"0\" alt=\"Send a quick private message to $member_result[username]\"></a> <A HREF=\"forums.html?file=profile&mode=viewprofile&u=$member_result[user_id]\">".$sessionNameModified."</a><br />\n";
$who_online_now .= ($i != $member_online_num ? " " : "");
$i++;
}
}
$sql = "SELECT SQL_NO_CACHE uname, guest FROM $prefix"._session." WHERE guest=1";
$result = $db->sql_query($sql);
$gmember_online_num = $db->sql_numrows($result);
$gwho_online_now = "";
$gArray = Array();
while ($session = $db->sql_fetchrow($result)) {
if (isset($session["guest"]) and $session["guest"] == 1) {
$gArray[] = convertIP($session['uname']);
}
}
sort($gArray,SORT_NUMERIC);
for ($j=0;$j<count($gArray);$j++) {
if ($i < 10) $zi = "0$i";
else $zi = $i;
$gwho_online_now .= "$zi: <a href=\"http://www.samspade.org/t/lookat?a=".$gArray[$j]."\" target=\"_blank\">".$gArray[$j]."</a><br />\n";
$gwho_online_now .= ($i != $gmember_online_num ? " " : "");
$i++;
}
$Today = getdate();
//Formatting Current Date
$month = $Today['month'];
$mday = $Today['mday'];
$year = $Today['year'];
//Formatting Previous Date
$pmonth = $Today['month'];
$pmday = $Today['mday'];
//$pmday = $mday-1;
$pyear = $Today['year'];
//Month conversion into numeric mode
if ($pmonth=="January") { $pmonth=1; } else
if ($pmonth=="February") { $pmonth=2; } else
if ($pmonth=="March") { $pmonth=3; } else
if ($pmonth=="April") { $pmonth=4; } else
if ($pmonth=="May") { $pmonth=5; } else
if ($pmonth=="June") { $pmonth=6; } else
if ($pmonth=="July") { $pmonth=7; } else
if ($pmonth=="August") { $pmonth=8; } else
if ($pmonth=="September") { $pmonth=9; } else
if ($pmonth=="October") { $pmonth=10; } else
if ($pmonth=="November") { $pmonth=11; } else
if ($pmonth=="December") { $pmonth=12; };
$test = mktime (0,0,0,$pmonth,$pmday,$pyear,1);
//Creating SQL parameter
$curDate2 = "%".$month[0].$month[1].$month[2]."%".$mday."%".$year."%";
$preday = strftime ("%d",$test);
$premonth = strftime ("%B",$test);
$preyear = strftime ("%Y",$test);
$curDateP = "%".$premonth[0].$premonth[1].$premonth[2]."%".$preday."%".$preyear."%";
//Executing SQL Today
$row = $db->sql_fetchrow($db->sql_query("SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDate2'"));
$userCount = $row['userCount'];
//end
//Executing SQL Yesterday
$row2 = $db->sql_fetchrow($db->sql_query("SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDateP'"));
$userCount2 = $row2['userCount'];
//end
$sql = "SELECT uname FROM ".$prefix."_session WHERE guest=1";
$result = $db->sql_query($sql);
$guest_online_num = $db->sql_numrows($result);
$sql = "SELECT uname FROM ".$prefix."_session WHERE guest=0";
$result = $db->sql_query($sql);
$member_online_num = $db->sql_numrows($result)-$hiddenTotal;
$who_online_num = $guest_online_num + $member_online_num;
if (is_admin($admin)) $who_online_num = $who_online_num + $hiddenTotal;
$sql = "SELECT username FROM ".$prefix."_users_temp";
$result = $db->sql_query($sql);
$waiting = $db->sql_numrows($result);
$content .= "<form action=\"account.html\" method=\"post\">";
if (is_user($user)) {
$sqlp = "SELECT user_posts AS posts FROM $user_prefix"._users." WHERE username = '$uname'";
$result = $db->sql_query($sqlp);
$row = $db->sql_fetchrow($result);
$posts = $row[posts];
$sql = "SELECT user_avatar FROM " . $prefix."_users WHERE username='$uname' AND user_avatar IS NOT NULL";
$result = $db->sql_query($sql);
if ($result) {
$userinfo = $db->sql_fetchrow($result);
if ( ereg( "(http)", $userinfo[user_avatar]) ) {
$content .= "<br /><center><img src=\"$userinfo[user_avatar]\" /></center>\n";
}
else
if ($userinfo[user_avatar]) {
$content .= "<br /><center><img src=\"modules/Forums/images/avatars/$userinfo[user_avatar]\" /></center>\n";
}
}
if ($posts>0) $content .= "<br /><center>$posts post(s)</center>\n";
$content .= "<br /><img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$uname</b>.<br />\n\n";
$content .= "<a href=\"modules.php?name=Your_Account&op=logout\"><img src=\"images/blocks/arrow-blk.gif\" width=\"17\" border=0> Logout</a>\n<hr>\n";
$sql = "SELECT user_id FROM $user_prefix"._users." WHERE username='$uname'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$uid = $row[user_id];
$sql = "SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='5'";
$result = $db->sql_query($sql);
$een = $db->sql_numrows($result);
$sql = "SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='1'";
$result = $db->sql_query($sql);
$twee = $db->sql_numrows($result);
$newpms = $een + $twee;
$sql = "SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'";
$result = $db->sql_query($sql);
$oldpms = $db->sql_numrows($result);
$content .= "<img src=\"images/blocks/email-y.gif\" height=\"10\" width=\"14\"> <a href=\"messages.html\"><b>"._BPM."</b></a><br />\n";
$content .= "<img src=\"images/blocks/email-r.gif\" height=\"10\" width=\"14\"> "._BUNREAD.": <b>$newpms</b><br />\n";
$content .= "<img src=\"images/blocks/email-g.gif\" height=\"10\" width=\"14\"> "._BREAD.": <b>$oldpms</b><br />\n<hr>\n";
} else {
$content .= "<img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$anonymous</b>\n<hr>";
$content .= "<table><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></table>";
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 .=""._SECURITYCODE.": <img src='modules.php?name=Your_Account&op=gfx&random_num=$random_num' border='1' alt='"._SECURITYCODE."' title='"._SECURITYCODE."'>\n";
$content .="<br />"._TYPESECCODE.": <input type=\"text\" NAME=\"gfx_check\" SIZE=\"11\" MAXLENGTH=\"10\"><br>\n";
$content .="<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">\n";
}
$content .="<input type=\"hidden\" name=\"redirect\" value=$redirect>\n";
$content .="<input type=\"hidden\" name=\"mode\" value=$mode>\n";
$content .="<input type=\"hidden\" name=\"f\" value=$f>\n";
$content .="<input type=\"hidden\" name=\"t\" value=$t>\n";
$content .= "<input type=\"hidden\" name=\"op\" value=\"login\">";
$content .= "<input type=\"submit\" value=\""._LOGIN."\">\n<br /><a href=\"modules.php?name=Your_Account&op=new_user\">· "._BREG."</a><br>";
$content .= "<a href=\"modules.php?name=Your_Account&op=pass_lost\">· "._PASSWORDLOST."</a><hr>";
}
if (is_user($user)||is_admin($admin)) {
$content .= "<img src=\"images/blocks/group-2.gif\" height=\"14\" width=\"17\"> <b><u>"._BMEMP.":</u></b><br />\n";
$content .= "<img src=\"images/blocks/ur-moderator.gif\" height=\"14\" width=\"17\"> "._BLATEST.": <a href=\"userinfo-.html$lastusername\"><img src=\"images/blocks/icon_mini_profile.gif\" border=\"0\" alt=\"Check the profile of $lastusername\"></a> <A HREF=\"forums.html?file=profile&mode=viewprofile&u=$lastuser\"><b>$lastusername</b></a><br />\n";
if (is_admin($admin) AND @file_exists("modules/UserInfoAddons/index.php")) {
$btdLink = "<a href=\"modules.php?name=UserInfoAddons&timespan=today\">"._BTD."</a>";
$bydLink = "<a href=\"modules.php?name=UserInfoAddons&timespan=yest\">"._BYD."</a>";
}
else {
$btdLink = _BTD;
$bydLink = _BYD;
}
$content .= "<img src=\"images/blocks/ur-author.gif\" height=\"14\" width=\"17\"> ".$btdLink.": <b>$userCount</b><br />\n";
$content .= "<img src=\"images/blocks/ur-admin.gif\" height=\"14\" width=\"17\"> ".$bydLink.": <b>$userCount2</b><br />\n";
if (is_admin($admin) AND @file_exists("modules/Resend_Email/index.php")) $waitLink = "<a href=\"modules.php?name=Resend_Email\" title=\"Resend Email phpNuke Module at RavenPHPScripts\">".Waiting."</a>";
else $waitLink = Waiting;
$content .= "<img src=\"images/blocks/ur-member.gif\" height=\"14\" width=\"17\"> ".$waitLink.": <b>$waiting</b><br />\n";
$content .= "<img src=\"images/blocks/ur-guest.gif\" height=\"14\" width=\"17\"> "._BOVER.": <b>$numrows1</b><br />\n<hr>\n";
}
$content .= "<img src=\"images/blocks/group-3.gif\" height=\"14\" width=\"17\"> <b><u>"._BVISIT.":</u></b>\n<br />\n";
$content .= "<img src=\"images/blocks/ur-anony.gif\" height=\"14\" width=\"17\"> "._BVIS.": <b>$guest_online_num</b><br />\n";
$content .= "<img src=\"images/blocks/ur-member.gif\" height=\"14\" width=\"17\"> "._BMEM.": <b>$member_online_num</b><br />\n";
if (is_user($user)||is_admin($admin)) {
if (is_admin($admin)) {
$content .= "<img src=\"images/blocks/ur-hiddenmember.gif\" height=\"14\" width=\"17\"> "."Hidden".": <b>$hiddenTotal</b><br />\n";
}
$content .= "<img src=\"images/blocks/ur-registered.gif\" height=\"14\" width=\"17\"> "._BTT.": <b>$who_online_num</b><br />\n<hr noshade>\n";
if ($member_online_num > 0 || is_admin($admin)) {
$content .= "<img src=\"images/blocks/group-1.gif\" height=\"14\" width=\"17\" align=\"middle\"> <b><u>"._BON.":</u></b><br />$who_online_now";
$hr = "\n<hr noshade>\n";
}
if ($gmember_online_num > 0 && ($showGuests||($showGuestsAdmin&&is_admin($admin)))) {
$content .= "<br />$gwho_online_now";
$hr = "\n<hr noshade>\n";
}
$content .= $hr;
/* Hits for Today */
$t_time = time();
$t_year = date("Y", $t_time);
$t_month = date("n", $t_time);
$t_date = date("j", $t_time);
$result = sql_query("SELECT hits FROM $prefix"._stats_date." WHERE year='$t_year' AND month='$t_month' AND date='$t_date'", $dbi);
list($today) = sql_fetch_row($result, $dbi);
if (is_admin($admin)) {
/* Hits for Yesterday */
$y_time = $t_time - 86400;
$y_year = date("Y", $y_time);
$y_month = date("n", $y_time);
$y_date = date("j", $y_time);
$result = sql_query("SELECT hits FROM $prefix"._stats_date." WHERE year='$y_year' AND month='$y_month' AND date='$y_date'", $dbi);
list($yesterday) = sql_fetch_row($result, $dbi);
}
}
else {
$hr = "\n<hr noshade>\n";
$content .= $hr;
}
/* Hits in Total */
$totalhits = 0;
$result = sql_query("SELECT sum(hits) FROM $prefix"._stats_year."", $dbi);
list($totalhits) = sql_fetch_row($result, $dbi);
$content .= "<center><small>"._WERECEIVED."</small><br />\n";
$content .= "<b>$totalhits</b><br />\n";
$content .= "<small>"._PAGESVIEWS."<br />$startdate</small></center>";
$content .= "<hr noshade>";
if (is_user($user)||is_admin($admin)) {
$content .= "<center>"._BHITS." "._BTD.": <b>$today</b><br />";
if (is_admin($admin)) {
$content .= ""._BHITS." "._BYD.": <b>$yesterday</b><br /></center>";
}
else $content .= "</center>";
}
if ($showServerDateTime || ($showServerDateTimeAdmin&&is_admin($admin))) {
if (is_user($user)||is_admin($admin)) {
$content .= "<hr noshade>";
}
$sdt = date("j F Y\nH:i:s T");
$zone = date("Z")/3600;
if ($zone >= 0) {
$zone = "+".$zone;
}
$content .= "<center>"._SERDT."<br />$sdt (GMT $zone)</center>";
}
$content .= "</form>";
?>
|