0 ORDER BY user_id DESC LIMIT 1"; list($lastuser) = $db->sql_fetchrow($db->sql_query($sql)); return $lastuser; } //Total Members function numusers() { global $prefix, $db; $sql = "SELECT COUNT(*) FROM ".$prefix."_users WHERE user_id > 1"; list($numrows) = $db->sql_fetchrow($db->sql_query($sql)); $numrows = number_format($numrows); return $numrows; } //Total Waiting function waiting_users() { global $prefix, $db; $sql = "SELECT COUNT(*) FROM ".$prefix."_users_temp"; list($numrowswaiting) = $db->sql_fetchrow($db->sql_query($sql)); return $numrowswaiting; } //New Users Today and Yesterday function new_users() { global $prefix, $db; $sql = "SELECT COUNT(*) FROM ".$prefix."_users WHERE user_regdate='".date("M d, Y")."'"; list($userCount[0]) = $db->sql_fetchrow($db->sql_query($sql)); $sql = "SELECT COUNT(*) FROM ".$prefix."_users WHERE user_regdate='".date("M d, Y", time()-86400)."'"; list($userCount[1]) = $db->sql_fetchrow($db->sql_query($sql)); return $userCount; } if ($dopmpopup == 1) { if ($userinfo['user_popup_pm'] && $userinfo['user_new_privmsg']) { $content .= ""; } } //Registered users online $members = $db->sql_query("SELECT w.uname, w.module, w.url, u.user_id, u.user_level, u.user_allow_viewonline FROM ".$prefix."_session AS w LEFT JOIN ".$prefix."_users AS u ON u.username = w.uname WHERE guest = '0' ORDER by u.user_id ASC"); $guests = $db->sql_query("SELECT uname FROM ".$prefix."_session WHERE guest ='1'"); //Online Total data $online_num[0] = $db->sql_numrows($members); $online_num[1] = $db->sql_numrows($guests); $online_num[2] = $online_num[0] + $online_num[1]; //Assemble the online registered users $who_online_now = ""; $i = 1; while ($session = $db->sql_fetchrow($members)) { //Allow View? if ($session['user_allow_viewonline'] || is_admin($admin)) { if ($i < 10) $czi = "0$i"; else $czi = $i; //$uid = intval($session['user_id']); $uname = $session['uname']; $ulevel = intval($session['user_level']); $mod = $session['module']; $url = $session['url']; if ($Version_Num < 7.6) { if(preg_match("/admin/", $url)) { $mod = "Private"; $url = "index.php"; } } elseif ($Version_Num >= 7.6) { if(preg_match("/".$admin_file."/", $url)) { $mod = "Private"; $url = "index.php"; } } if ((is_admin($admin)) && ($showonlyadmin == 0)) { $where = "$czi. "; } elseif ($showonlyadmin == 1) { $where = "$czi. "; } else { $where = "$czi. "; } if ($ulevel == 2) { $who_online_now .= "
$where$uname \n"; } elseif ($ulevel == 3) { $who_online_now .= "
$where$uname \n"; } else { $who_online_now .= "
$where$uname\n"; } $who_online_now .= ( $i != $online_num[0] ? "" : "" ); $i++; } else { $hidden++; } } //Allow View $db->sql_freeresult($members); //Mostonline data $result = $db->sql_query("SELECT total, members, nonmembers FROM ".$prefix."_mostonline"); $row = $db->sql_fetchrow($result); $total = intval($row['total']); $members = intval($row['members']); $nonmembers = intval($row['nonmembers']); $db->sql_freeresult($result); //Break Mostonline Total? if ($total < $online_num[2]) { $db->sql_query("DELETE FROM ".$prefix."_mostonline WHERE total='$total' LIMIT 1"); $db->sql_query("INSERT INTO ".$prefix."_mostonline VALUES ('$online_num[2]','$online_num[0]','$online_num[1]')"); } if (is_user($user)) { //Greet User $urname = $userinfo['username']; $content .= "
 \n"; $content .= "\n"; if ($useavatars == 1) { //Avatars... $bbconf = array(); $result = $db->sql_query("SELECT * FROM ".$prefix."_bbconfig"); while(list($config_name, $config_value) = $db->sql_fetchrow($result)){ $bbconf[$config_name] = $config_value; } if ($userinfo['user_allowavatar']) { if ($userinfo['user_avatar_type'] == 1) { $content .= "


\n"; } elseif ($userinfo['user_avatar_type'] == 2) { $content .= "


\n"; } elseif ($userinfo['user_avatar'] == "") { $content .= "

\n"; } else { $content .= "


\n"; } } } if ($usebbranks == 1) { //Ranks... $result_rank = $db->sql_query("SELECT * FROM ".$prefix."_bbranks ORDER BY rank_special, rank_min"); $ranksrow = array(); while ( $row = $db->sql_fetchrow($result_rank) ) { $ranksrow[] = $row; } $db->sql_freeresult($result_rank); if ($userinfo['user_rank']) { for($j = 0; $j < count($ranksrow); $j++) { if ($userinfo['user_rank'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special']) { $poster_rank = $ranksrow[$j]['rank_title']; $rank_image = ($ranksrow[$j]['rank_image']) ? ''.$poster_rank.'
' : ''; } } } else { for($j = 0; $j < count($ranksrow); $j++) { if ($userinfo['user_posts'] >= $ranksrow[$j]['rank_min'] && !$ranksrow[$j]['rank_special']) { $poster_rank = $ranksrow[$j]['rank_title']; $rank_image = ($ranksrow[$j]['rank_image']) ? ''.$poster_rank.'
' : ''; } } } $content .= "
".$rank_image."".$poster_rank."
\n"; } //Line to separate $content .= "
"; $content .= "\n"; $content .= ""._CZ_ACCOUNTINFO."
\n"; if ($showpoints == 1) { $userpoints = number_format($userinfo[$sitepoints]); $content .= "\n"; $content .= ""._CZ_POINTS."$userpoints
\n"; } if ($showpms == 1) { $pms = $userinfo['user_new_privmsg']; $content .= "\n"; $content .= ""._CZ_PRUNREAD."$pms
\n"; } $content .= "\n"; $content .= ""._CZ_LOGOUT."
\n"; //Line to separate $content .= "
"; } else { //Display LOGIN information for Guests Only mt_srand ((double)microtime()*1000000); $maxran = 1000000; $random_num = mt_rand(0, $maxran); //Greet Guest $content .= " \n"; $content .= "\n"; //Line to separate $content .= "
"; //Links to Register or Regain Password $content .= "\n"; $content .= ""._CZ_REGISTER."
\n"; $content .= "\n"; $content .= ""._CZ_LOSTPASSWORD."

\n"; //LOGIN Box $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; if (extension_loaded("gd") AND ($gfx_chk == 2 OR $gfx_chk == 4 OR $gfx_chk == 5 OR $gfx_chk == 7)) { if ($Version_Num < 7.5) { $security_code_url = "modules.php?name=Your_Account&op=gfx&random_num=$random_num"; } elseif ($Version_Num >= 7.5) { $security_code_url = "?gfx=gfx&random_num=$random_num"; } $content .= "\n"; $content .= "\n"; $content .= "\n"; } else { $content .= ""; $content .= ""; } $content .= "
"._CZ_SECURITYCODE." "._SECURITYCODE."
"._CZ_TYPESECCODE."
\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= " \n"; //Line to separate $content .= "
"; } // Info for users who are logged in AND Guests $last = new_users(); $lastuser = last_user(); $content .= "\n"; $content .= ""._CZ_MEMBERSHIP."
\n"; $content .= " "._CZ_TODAY."".$last[0]."
\n"; $content .= " "._CZ_YESTERDAY."".$last[1]."
\n"; $content .= " "._CZ_WAITING."".waiting_users()."
\n"; $content .= " "._CZ_TOTALMEMBERS."".numusers()."
\n"; $content .= " "._CZ_LATEST."\n"; $content .= "$lastuser
\n"; //Line to separate $content .= "
"; //Mostonline if ($showmost==1) { $content .= "\n"; $content .= ""._CZ_MOSTONLINE."
\n"; $content .= " "._CZ_VISITORS."".number_format($nonmembers)."
\n"; $content .= " "._CZ_MEMBERS."".number_format($members)."
\n"; $content .= " "._CZ_TOTALONLINE."".number_format($total)."
\n"; //Line to separate $content .= "
"; }//Show Most //Total Online $content .= "\n"; $content .= ""._CZ_ONLINEINFO."
\n"; $content .= " "._CZ_VISITORS."".number_format($online_num[1])."
\n"; $content .= " "._CZ_MEMBERS."".number_format($online_num[0])."
\n"; if ($hidden ==""){ $hidden = "0"; } if ($hidden == 0) { } else { $content .= " "._CZ_HIDDENUSERS."$hidden
\n"; } $content .= " "._CZ_TOTALONLINE."".number_format($online_num[2])."
\n"; //Users Online List if (is_user($user) || is_admin($admin)) { //Line to separate $content .= "
"; $content .= "\n"; $content .= ""._CZ_ONLINELIST."\n"; if ($online_num[0]>10) { $content .= "
"; $content .= "$who_online_now\n"; $content .= "
"; } else { $content .= "$who_online_now\n"; } } ?>