} if (C_CHAT_BOOT) { $CondForQueryM = "(username='******' OR message='stripslashes(sprintf(L_ENTER_ROM, \"" . $U . "\"))' OR message='stripslashes(sprintf(L_ENTER_ROM_NOSOUND, \"" . $U . "\"))' OR ((username='******' OR username LIKE 'SYS top%' OR username='******' OR username='******' OR username='******' OR username='******' OR username='******' OR username='******' OR username='******' OR username='******' OR username='******') AND address='{$U}'))"; $DbLink->query("SELECT type,m_time,room FROM " . C_MSG_TBL . " WHERE " . $CondForQueryM . " ORDER BY m_time DESC LIMIT 1"); list($m_type, $m_time, $m_room) = $DbLink->next_record(); $CondForQueryU = "status!='a' AND status!='t' AND status!='m' AND username='******' AND username!='" . C_BOT_NAME . "' AND awaystat='0' AND (u_time > " . ($m_time + C_USR_DEL * 60) . " OR (status ='k' AND u_time < " . (time() - 20) . "))" . $Hide . ""; $DbLink->query("DELETE FROM " . C_USR_TBL . " WHERE " . $CondForQueryU . ""); $CleanUsrTbl = $DbLink->affected_rows() > 0; if ($CleanUsrTbl) { // Ghost Control mod by Ciprian if (C_SPECIAL_GHOSTS != "") { $sghosts = ""; $sghosts = str_replace("'", "", C_SPECIAL_GHOSTS); $sghosts = str_replace(" AND username != ", ",", $sghosts); } if ($sghosts != "" && ghosts_in(stripslashes($U), $sghosts, $Charset) || C_HIDE_ADMINS && ($status == "a" || $status == "t") || C_HIDE_MODERS && $status == "m") { } else { $DbLink->query("INSERT INTO " . C_MSG_TBL . " VALUES ('" . $m_type . "', '" . $m_room . "', 'SYS exit', '', " . time() . ", '', 'sprintf(L_BOOT_ROM, \"{$U}\")', '', '')"); } if (C_EN_STATS) { $DbLink->query("UPDATE " . C_STS_TBL . " SET seconds_away=seconds_away+({$curtime}-last_away), longest_away=IF({$curtime}-last_away < longest_away, longest_away, {$curtime}-last_away), last_away='' WHERE (stat_date=FROM_UNIXTIME(last_away,'%Y-%m-%d') OR stat_date=FROM_UNIXTIME(last_in,'%Y-%m-%d')) AND room='{$m_room}' AND username='******' AND last_away!='0'"); $DbLink->query("UPDATE " . C_STS_TBL . " SET seconds_in=seconds_in+({$curtime}-last_in), longest_in=IF({$curtime}-last_in < longest_in, longest_in, {$curtime}-last_in), last_in='' WHERE stat_date=FROM_UNIXTIME(last_in,'%Y-%m-%d') AND room='{$m_room}' AND username='******' AND last_in!='0'"); } if ($DbLink) { $DbLink->clean_results(); } $botpath = "botfb/" . $U; // file is in DIR "botfb" and called "username" if (file_exists($botpath)) { unlink($botpath); }
$Chat = new DB(); $Chat->query("SELECT room,username,u_time,status FROM " . C_USR_TBL . " WHERE username != '" . C_BOT_NAME . "' AND (u_time<'" . (time() - 60) . "' OR (status = 'k' AND u_time<'" . (time() - 20) . "'))"); while (list($userroom, $userclosed, $usertime, $statusclosed) = $Chat->next_record()) { // $when = date('r', $usertime + C_TMZ_OFFSET*60*60); $when = $usertime + C_TMZ_OFFSET * 60 * 60; $when = stristr(PHP_OS, 'win') ? '\\".utf_conv(WIN_DEFAULT,$Charset,strftime(L_LONG_DATETIME,' . $when . ')).\\"' : '\\".strftime(L_LONG_DATETIME,' . $when . ').\\"'; $ChatM->query("SELECT type FROM " . C_MSG_TBL . " WHERE room = '" . $userroom . "' ORDER BY m_time DESC LIMIT 1"); list($usertype) = $ChatM->next_record(); $userclosed = addslashes($userclosed); // Ghost Control mod by Ciprian if (C_SPECIAL_GHOSTS != "") { $sghosts = ""; $sghosts = str_replace("'", "", C_SPECIAL_GHOSTS); $sghosts = str_replace(" AND username != ", ",", $sghosts); } if ($sghosts != "" && ghosts_in($userclosed, $sghosts, $Charset) || C_HIDE_ADMINS && ($statusclosed == "a" || $statusclosed == "t") || C_HIDE_MODERS && $statusclosed == "m") { } else { $ChatM->query("INSERT INTO " . C_MSG_TBL . " VALUES ('" . $usertype . "', '" . $userroom . "', 'SYS exit', '', '" . time() . "', '', 'sprintf(L_CLOSED_ROM, \"(" . $when . ") " . $userclosed . "\")', '', '')"); } if (C_EN_STATS) { $ChatM->query("UPDATE " . C_STS_TBL . " SET seconds_away=seconds_away+({$usertime}-last_away), longest_away=IF({$usertime}-last_away < longest_away, longest_away, {$usertime}-last_away), last_away='' WHERE (stat_date=FROM_UNIXTIME(last_away,'%Y-%m-%d') OR stat_date=FROM_UNIXTIME(last_in,'%Y-%m-%d')) AND room='{$userroom}' AND username='******' AND last_away!='0'"); $ChatM->query("UPDATE " . C_STS_TBL . " SET seconds_in=seconds_in+({$usertime}-last_in), longest_in=IF({$usertime}-last_in < longest_in, longest_in, {$usertime}-last_in), last_in='' WHERE stat_date=FROM_UNIXTIME(last_in,'%Y-%m-%d') AND room='{$userroom}' AND username='******' AND last_in!='0'"); } $ChatM->query("DELETE FROM " . C_USR_TBL . " WHERE username='******'"); $CleanUsrTbl = $ChatM->affected_rows() > 0; $highpath = "botfb/" . $userclosed; // file is in DIR "botfb" and called "username" if (file_exists($highpath)) { unlink($highpath); } // checks to see if user file exists.
function display_connected($Private, $Full, $String1, $String2, $Charset, $gi) { $List = ""; global $ordquery, $DbLink, $DefaultDispChatRooms, $res_init, $disp_note, $L; if ($Private) { $query = "SELECT DISTINCT u.username, u.latin1, u.room, u.r_time, u.ip, u.status, u.country_code, u.country_name FROM " . C_USR_TBL . " u ORDER BY {$ordquery}"; } else { $query = "SELECT DISTINCT u.username, u.latin1, u.room, u.r_time, u.ip, u.status, u.country_code, u.country_name FROM " . C_USR_TBL . " u, " . C_MSG_TBL . " m WHERE u.room = m.room AND m.type = 1 ORDER BY {$ordquery}"; } $DbLink->query($query); $NbUsers = $DbLink->num_rows(); // Ghost Control mod by Ciprian if ($Full && $NbUsers >= 1) { $sghosts = ""; $sghosts = str_replace("'", "", C_SPECIAL_GHOSTS); $sghosts = str_replace(" AND username != ", ",", $sghosts); if ($NbUsers == 1) { echo $String1 . "<br />"; } else { echo $NbUsers . " " . NB_USERS_IN . "<br />"; } while (list($UserU, $Latin1U, $RoomU, $RTime, $IP, $StatusU, $COUNTRY_CODE, $COUNTRY_NAME) = $DbLink->next_record()) { if (is_array($DefaultDispChatRooms) && in_array($RoomU . " [R]", $DefaultDispChatRooms)) { $RoomU .= " [" . $res_init . "]"; $disp_note = 1; } if ($Latin1U) { $UserU = htmlentities($UserU); } $ghost = 0; $superghost = 0; if ($sghosts != "" && ghosts_in($UserU, $sghosts, $Charset) || C_HIDE_MODERS && $StatusU == "m" || C_HIDE_ADMINS && ($StatusU == "a" || $StatusU == "t")) { if ($StatusU == "a" || $StatusU == "t") { $superghost = 1; } else { $ghost = 1; } } $user_not = $UserU; $UserU = user_status($UserU, $StatusU, $ghost, $superghost); $RTime = strftime(L_SHORT_DATETIME, $RTime + C_TMZ_OFFSET * 60 * 60); if (stristr(PHP_OS, 'win') && (strstr($L, "chinese") || strstr($L, "korean") || strstr($L, "japanese"))) { $RTime = str_replace(" ", "", $RTime); } // GeoIP mode for country flags if (C_USE_FLAGS) { if ((!isset($COUNTRY_CODE) || $COUNTRY_CODE == "") && $user_not != C_BOT_NAME && $user_not != C_QUOTE_NAME) { $COUNTRY_CODE = geoip_country_code_by_addr($gi, ltrim($IP, "p")); if (empty($COUNTRY_CODE)) { $COUNTRY_CODE = "LAN"; $COUNTRY_NAME = "Other/LAN"; } if ($COUNTRY_CODE != "LAN") { $COUNTRY_NAME = $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$COUNTRY_CODE]]; } if ($PROXY || substr($IP, 0, 1) == "p") { $COUNTRY_NAME .= " (Proxy Server)"; } } $c_flag = " <img src=\"./plugins/countryflags/flags/" . strtolower($COUNTRY_CODE) . ".gif\" alt=\"" . $COUNTRY_NAME . "\" title=\"" . $COUNTRY_NAME . "\" border=\"0\"> (" . $COUNTRY_CODE . ")"; } $List .= "<tr><td>" . $UserU . "</td><td>" . $RoomU . "</td><td>" . L_LURKING_4 . " " . $RTime . ($user_not != C_BOT_NAME && $user_not != C_QUOTE_NAME ? "</td><td>" . $IP . (isset($c_flag) ? $c_flag : "") : ""); // GeoIP Country flags initialization unset($IP); unset($COUNTRY_CODE); unset($COUNTRY_NAME); unset($c_flag); } echo $List; unset($List); } elseif (!$Full) { echo $NbUsers . " " . $String1; } else { echo $String2; } $DbLink->clean_results(); }
} } $c_flag = " <img src=\"./plugins/countryflags/flags/" . strtolower($COUNTRY_CODE) . ".gif\" alt=\"" . $COUNTRY_NAME . "\" title=\"" . $COUNTRY_NAME . "\" border=\"0\"> (" . $COUNTRY_CODE . ")"; } if ($data[username] == "Guest") { $data[username] = L_LURKING_5; } if ($status == "a" || $status == "t") { if (C_SPECIAL_GHOSTS != "") { $sghosts = ""; $sghosts = str_replace("'", "", C_SPECIAL_GHOSTS); $sghosts = str_replace(" AND username != ", ",", $sghosts); } $ghost = 0; $superghost = 0; if ($sghosts != "" && ghosts_in($data[username], $sghosts, $Charset) || C_HIDE_MODERS && $data[status] == "m" || C_HIDE_ADMINS && ($data[status] == "a" || $data[status] == "t")) { if ($data[status] == "a" || $data[status] == "t") { $superghost = 1; } else { $ghost = 1; } } } $User = user_status($data[username], $data[status], $ghost, $superghost, $status); echo "<tr><td>" . $User . "</td>"; echo "<td nowrap=\"nowrap\">" . $data[ip] . $c_flag . "</td>"; echo "<td width=\"100%\">" . $data[browser] . "</td></tr>"; // GeoIP Country flags initialization unset($User); unset($data[ip]); unset($data[country_code]);
function display_connected($Private, $Full, $NU, $String1, $String2, $DbLink, $Charset) { global $L; $List = ""; global $DefaultDispChatRooms, $res_init, $disp_note, $status; if ($NU > 0) { echo $String1; if ($Full) { // GeoIP mode for country flags if (C_USE_FLAGS && ($status == "a" || $status == "t" || $status == "m" || C_SHOW_FLAGS)) { if (!class_exists("GeoIP")) { include "plugins/countryflags/geoip.inc"; } if (!isset($gi)) { $gi = geoip_open("plugins/countryflags/GeoIP.dat", GEOIP_STANDARD); } } // Restricted rooms mod by Ciprian while (list($User, $Latin1, $Room, $RTime, $StatusU, $IP, $COUNTRY_CODE, $COUNTRY_NAME) = $DbLink->next_record()) { if (is_array($DefaultDispChatRooms) && in_array($Room . " [R]", $DefaultDispChatRooms)) { $Room .= " [" . $res_init . "]"; $disp_note = 1; } if ($Latin1) { $User = htmlentities($User); } if ($status == "a" || $status == "t") { $ghost = 0; $superghost = 0; $sghosts = str_replace("'", "", C_SPECIAL_GHOSTS); $sghosts = str_replace(" AND username != ", ",", $sghosts); if ($sghosts != "" && ghosts_in($User, $sghosts, $Charset) || C_HIDE_MODERS && $StatusU == "m" || C_HIDE_ADMINS && ($StatusU == "a" || $StatusU == "t")) { if ($StatusU == "a" || $StatusU == "t") { $superghost = 1; } else { $ghost = 1; } } } $user_not = $User; $User = user_status($User, $StatusU, $ghost, $superghost, $status); $RTime = strftime(L_SHORT_DATETIME, $RTime + C_TMZ_OFFSET * 60 * 60); if (stristr(PHP_OS, 'win') && (strstr($L, "chinese") || strstr($L, "korean") || strstr($L, "japanese"))) { $RTime = str_replace(" ", "", $RTime); } // GeoIP mode for country flags $show_ip = ""; if (C_USE_FLAGS && ($status == "a" || $status == "t" || $status == "m" || C_SHOW_FLAGS) && $user_not != C_BOT_NAME) { if (!isset($COUNTRY_CODE) || $COUNTRY_CODE == "") { $COUNTRY_CODE = geoip_country_code_by_addr($gi, ltrim($IP, "p")); // GeoIP mode for country flags if (empty($COUNTRY_CODE)) { $COUNTRY_CODE = "LAN"; $COUNTRY_NAME = "Other/LAN"; } if ($COUNTRY_CODE != "LAN") { $COUNTRY_NAME = $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$COUNTRY_CODE]]; } if ($PROXY || substr($IP, 0, 1) == "p") { $COUNTRY_NAME .= " (Proxy Server)"; } } $c_flag = " <img src=\"./plugins/countryflags/flags/" . strtolower($COUNTRY_CODE) . ".gif\" alt=\"" . $COUNTRY_NAME . "\" title=\"" . $COUNTRY_NAME . "\" border=\"0\"> (" . $COUNTRY_CODE . ")"; if ($status == "a" || $status == "t") { $show_ip = "</td><td nowrap=\"nowrap\">" . $IP . $c_flag; } elseif (C_SHOW_FLAGS || $status == "m") { $show_ip = "</td><td nowrap=\"nowrap\">" . $c_flag; } } $List .= "<tr><td nowrap=\"nowrap\">" . $User . "</td><td nowrap=\"nowrap\">" . $Room . "</td><td nowrap=\"nowrap\">" . L_LURKING_4 . " " . $RTime . $show_ip; // GeoIP Country flags initialization unset($User); unset($Room); unset($RTime); unset($IP); unset($COUNTRY_CODE); unset($COUNTRY_NAME); unset($c_flag); } echo $List; // GeoIP mode for country flags # if(isset($gi) && $gi != "") geoip_close($gi); # if(isset($gi6) && $gi6 != "") geoip_close($gi6); } } else { echo $String2; } $DbLink->clean_results(); $DbLink->close(); }
function display_connected($Private, $Full, $String1, $String2, $Charset) { $List = ""; global $ordquery, $DbLink, $DefaultDispChatRooms, $res_init, $disp_note, $L; if ($Private) { $query = "SELECT DISTINCT u.username, u.latin1, u.room, u.r_time, u.ip, u.status FROM " . C_USR_TBL . " u ORDER BY {$ordquery}"; } else { $query = "SELECT DISTINCT u.username, u.latin1, u.room, u.r_time, u.ip, u.status FROM " . C_USR_TBL . " u, " . C_MSG_TBL . " m WHERE u.room = m.room AND m.type = 1 ORDER BY {$ordquery}"; } $DbLink->query($query); $NbUsers = $DbLink->num_rows(); // Ghost Control mod by Ciprian if ($NbUsers == 1) { if ($Full) { $sghosts = ""; $sghosts = str_replace("'", "", C_SPECIAL_GHOSTS); $sghosts = str_replace(" AND username != ", ",", $sghosts); echo $String1 . "<br />"; while (list($UserU, $Latin1U, $RoomU, $RTime, $IP, $Status) = $DbLink->next_record()) { if (is_array($DefaultDispChatRooms) && in_array($RoomU . " [R]", $DefaultDispChatRooms)) { $RoomU .= " [" . $res_init . "]"; $disp_note = 1; } if ($Latin1) { $UserU = htmlentities($UserU); } $ghost = 0; $superghost = 0; if ($sghosts != "" && ghosts_in($UserU, $sghosts, $Charset) || C_HIDE_MODERS && $Status == "m" || C_HIDE_ADMINS && ($Status == "a" || $Status == "t")) { if ($Status == "a" || $Status == "t") { $superghost = 1; } else { $ghost = 1; } } $UserU = user_status($UserU, $Status, $ghost, $superghost); $RTime = strftime(L_SHORT_DATETIME, $RTime + C_TMZ_OFFSET * 60 * 60); if (stristr(PHP_OS, 'win') && (strstr($L, "chinese") || strstr($L, "korean") || strstr($L, "japanese"))) { $RTime = str_replace(" ", "", $RTime); } $List .= "<tr><td>" . $UserU . "</td><td>" . $RoomU . "</td><td>" . L_LURKING_4 . " " . $RTime . "</td><td>" . $IP; } echo $List; } else { echo $NbUsers . " " . $String1; } } elseif ($NbUsers > 1) { if ($Full) { $sghosts = ""; $sghosts = str_replace("'", "", C_SPECIAL_GHOSTS); $sghosts = str_replace(" AND username != ", ",", $sghosts); echo $NbUsers . " " . NB_USERS_IN . "<br />"; while (list($UserU, $Latin1U, $RoomU, $RTime, $IP, $Status) = $DbLink->next_record()) { if (is_array($DefaultDispChatRooms) && in_array($RoomU . " [R]", $DefaultDispChatRooms)) { $RoomU .= " [" . $res_init . "]"; $disp_note = 1; } if ($Latin1U) { $UserU = htmlentities($UserU); } $ghost = 0; $superghost = 0; if ($sghosts != "" && ghosts_in($UserU, $sghosts, $Charset) || C_HIDE_MODERS && $Status == "m" || C_HIDE_ADMINS && ($Status == "a" || $Status == "t")) { if ($Status == "a" || $Status == "t") { $superghost = 1; } else { $ghost = 1; } } $UserU = user_status($UserU, $Status, $ghost, $superghost); $RTime = date("d-M, H:i:s", $RTime + C_TMZ_OFFSET * 60 * 60); $List .= "<tr><td>" . $UserU . "</td><td>" . $RoomU . "</td><td>" . L_LURKING_4 . " " . $RTime . "</td><td>" . $IP . ""; } echo $List; } else { echo $NbUsers . " " . $String1; } unset($List); } else { echo $String2; } $DbLink->clean_results(); }