sql_fetchrow($db->sql_query("SELECT count FROM ".$prefix."_counter WHERE type='total' AND var='hits'")); //Today hits list($today_hits) = $db->sql_fetchrow($db->sql_query("SELECT hits FROM ".$prefix."_stats_date WHERE year='".date("Y")."' AND month='".date("n")."' AND date='".date("j")."'")); //Yesterday $y_time = time() - 86400; $y_year = date("Y", $y_time); $y_month = date("n", $y_time); $y_date = date("j", $y_time); list($yesterday) = $db->sql_fetchrow($db->sql_query("SELECT hits FROM ".$prefix."_stats_date WHERE year='$y_year' AND month='$y_month' AND date='$y_date'")); //Output $pageviews = "

"._UMPAGEVIEWS."
"; $pageviews .= ""; $pageviews .= ""; $pageviews .= ""; $pageviews .= ""; $pageviews .= "
· "._UMHITSTODAY.": $today_hits
· ".Yesterday.": $yesterday
· "._UMHITSTOTAL.": $total_hits
"; return $pageviews; } function useronline() { global $db, $prefix, $user_prefix, $Show_Online, $memres; $memres = $db->sql_query("SELECT uname, guest FROM $prefix"._session." WHERE guest=0 ORDER BY uname"); $anonres = $db->sql_query("SELECT uname FROM ".$prefix."_session WHERE guest = 1 ORDER BY uname"); $online_num[0] = $db->sql_numrows($memres); $online_num[1] = $db->sql_numrows($anonres); $online_num[2] = $online_num[0] + $online_num[1]; if ($Show_Online == 1) { for($i = 1; $i <= $online_num[0]; $i++) { $content .= $i; $session = $db->sql_fetchrow($memres); list($uid, $user_rank) = $db->sql_fetchrow($db->sql_query("SELECT user_id, user_rank FROM ".$user_prefix."_users WHERE username='".$session['uname']."'")); intval($uid); $uname = $session['uname']; if (isset($session['guest']) and $session['guest'] == 0) { if ($i < 10) { if ($user_rank == 0 ) { $online_num[3] .= "  0$i: $uname
"; } else { $rank_image = $db->sql_fetchrow($db->sql_query("SELECT rank_title, rank_image_online FROM ".$prefix."_bbranks WHERE rank_id='$user_rank'")); if ($rank_image['rank_image_online'] != "") { $rank_name = " \"\""; } else { $rank_name = ""; } $online_num[3] .= "  0$i: $uname$rank_name
"; } } else { if ($user_rank == 0 ) { $online_num[3] .= "  $i: $uname
"; } else { $rank_image = $db->sql_fetchrow($db->sql_query("SELECT rank_title, rank_image_online FROM ".$prefix."_bbranks WHERE rank_id='$user_rank'")); if ($rank_image['rank_image_online'] != "") { $rank_name = " \"\""; } else { $rank_name = ""; } $online_num[3] .= "  $i: $uname$rank_name
"; } } } } } return $online_num; } function num_users() { global $user_prefix, $db; list($numrows) = $db->sql_fetchrow($db->sql_query("SELECT COUNT(*) FROM ".$user_prefix."_users WHERE user_id > 1 AND user_level >= 0")); return $numrows; } function newusers() { global $user_prefix, $db; list($userCount[0]) = $db->sql_fetchrow($db->sql_query("SELECT COUNT(*) FROM ".$user_prefix."_users WHERE user_regdate='".date("M d, Y")."'")); list($userCount[1]) = $db->sql_fetchrow($db->sql_query("SELECT COUNT(*) FROM ".$user_prefix."_users WHERE user_regdate='".date("M d, Y", time()-86400)."'")); return $userCount; } function lastuserid() { global $db, $user_prefix; $sql = "SELECT user_id FROM ".$user_prefix."_users order by user_id DESC limit 0,1"; list($lastuserid) = $db->sql_fetchrow($db->sql_query($sql)); return $lastuserid; } function lastuser() { global $db, $user_prefix; $sql = "SELECT username FROM ".$user_prefix."_users ORDER BY user_id DESC LIMIT 1"; list($lastuser) = $db->sql_fetchrow($db->sql_query($sql)); return $lastuser; } function pms($id) { global $prefix, $userinfo, $db; intval($id); $usrid = $userinfo[user_id]; if ($id == 1) { $id = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$usrid' AND (privmsgs_type='1' OR privmsgs_type='5')")); } else { $id = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$usrid' AND privmsgs_type='0'")); } return $id; } if (is_user($user)) { if ($userinfo[user_avatar]) { if ($userinfo['user_avatar_type'] == 0) { $content .= "
"._UMWELB."
\"\"
".$userinfo['username']."\n

"; } else if (ereg( "(http)", $userinfo['user_avatar']) ) { $content .= "
"._UMWELB."
\"\"
".$userinfo['username']."

"; } else if ($userinfo['user_avatar']) { $content .= "
"._UMWELB."
\"\"
".$userinfo['username']."\n

"; } } $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "
"._UMPM."
  "._UMNMSG.": ".pms('1')."
  "._UMOMSG.": ".pms('0')."\n
\n"; } else { // $content .= "
"._ASREGISTERED."

"; // $content .= "
\"no
"._BWEL." $anonymous
\n
"; $content .= "
"._BWEL." $anonymous
\n
"; $content .= "
\n"; $content .= "
\n"; $content .= _NICKNAME.":
\n"; $content .= _PASSWORD.":
\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "  [ "._UMREG." ]\n"; $content .= "
\n"; $content .= "
\n"; } $num_users = newusers(); $last = lastuser(); $users = useronline(); $lastuid = lastuserid(); $content .= "
"._BMEMP.":
\n"; $content .= "  "._BLATEST.": $last
\n"; $content .= "  "._BTD.": $num_users[0]
\n"; $content .= "  "._BYD.": $num_users[1]
\n"; $content .= "  "._BOVER.": ".num_users()."
\n
\n"; $content .= ""._UMONLINE." [$users[2]]:\n
\n"; $content .= "  "._BVIS.": $users[1]
\n"; $content .= "  "._BMEM.": $users[0]\n"; if ($Show_Online == 1) { $content .= "
\n "._UMON."
$who_online $users[3]"; } if ($Show_Hits == 1) { $content .= pageview(); } if (is_user($user)) { $content .= "
"._UMBEXIT."
"; } if (is_admin($admin)) { $content .= "
"._UMBADMINEXIT."
"; } $content .= "
"; ?>