Example #1
0
 $data['ban_date'] = SBDate($dateformat, $res->fields['ban_created']);
 $data['player'] = addslashes($res->fields['player_name']);
 $data['type'] = $res->fields['type'];
 $data['steamid'] = $res->fields['authid'];
 $data['communityid'] = $res->fields['community_id'];
 $steam2id = $data['steamid'];
 $steam3parts = explode(':', $steam2id);
 $steamid3 = '[U:1:' . ($steam3parts[2] * 2 + $steam3parts[1]) . ']';
 $data['steamid3'] = $steamid3;
 if (isset($GLOBALS['config']['banlist.hideadminname']) && $GLOBALS['config']['banlist.hideadminname'] == "1" && !$userbank->is_admin()) {
     $data['admin'] = false;
 } else {
     $data['admin'] = stripslashes($res->fields['admin_name']);
 }
 $data['reason'] = stripslashes($res->fields['ban_reason']);
 $data['ban_length'] = $res->fields['ban_length'] == 0 ? 'Permanent' : SecondsToString(intval($res->fields['ban_length']));
 // Custom "listtable_1_banned" & "listtable_1_permanent" addition entries
 // Comment the 14 lines below out if they cause issues
 if ($res->fields['ban_length'] == 0) {
     $data['expires'] = 'never';
     $data['class'] = "listtable_1_permanent";
     $data['ub_reason'] = "";
     $data['unbanned'] = false;
 } else {
     $data['expires'] = SBDate($dateformat, $res->fields['ban_ends']);
     $data['class'] = "listtable_1_banned";
     $data['ub_reason'] = "";
     $data['unbanned'] = false;
 }
 // End custom entries
 if ($res->fields['row_type'] == 'D' || $res->fields['row_type'] == 'U' || $res->fields['row_type'] == 'E' || $res->fields['ban_length'] && $res->fields['ban_ends'] < time()) {
    $info['name'] = htmlspecialchars(addslashes($info['name']), ENT_QUOTES, 'UTF-8');
    $info['popup'] = "ShowBox('Игрок: " . $info['name'] . " заблокирован', '" . $info['name'] . " пытался войти на<br />' + document.getElementById('" . $info['server'] . "').title + '<br />at " . $info['date'] . "<br /><div align=middle><a href=" . $info['search_link'] . ">Показать детали.</a></div>', 'red', '', true);";
    $GLOBALS['server_qry'] .= "xajax_ServerHostProperty(" . $res->fields['sid'] . ", 'block_" . $res->fields['sid'] . "_{$blcount}', 'title', 100);";
    array_push($stopped, $info);
    $res->MoveNext();
    ++$blcount;
}
$res = $GLOBALS['db']->Execute("SELECT count(bid) FROM " . DB_PREFIX . "_bans");
$BanCount = (int) $res->fields[0];
$res = $GLOBALS['db']->Execute("SELECT bid, ba.ip, ba.authid, ba.name, created, ends, length, reason, ba.aid, ba.sid, ad.user, CONCAT(se.ip,':',se.port), se.sid, mo.icon, ba.RemoveType, ba.type\r\n\t\t\t    \t\t\t\tFROM " . DB_PREFIX . "_bans AS ba \r\n\t\t\t    \t\t\t\tLEFT JOIN " . DB_PREFIX . "_admins AS ad ON ba.aid = ad.aid\r\n\t\t\t    \t\t\t\tLEFT JOIN " . DB_PREFIX . "_servers AS se ON se.sid = ba.sid\r\n\t\t\t    \t\t\t\tLEFT JOIN " . DB_PREFIX . "_mods AS mo ON mo.mid = se.modid\r\n\t\t\t    \t\t\t\tORDER BY created DESC LIMIT 10");
$bans = array();
while (!$res->EOF) {
    $info = array();
    $info['name'] = stripslashes($res->fields[3]);
    $info['created'] = SBDate($dateformat, $res->fields['created']);
    $ltemp = explode(",", $res->fields[6] == 0 ? 'Навсегда' : SecondsToString(intval($res->fields[6])));
    $info['length'] = $ltemp[0];
    $info['icon'] = empty($res->fields[13]) ? 'web.png' : $res->fields[13];
    $info['authid'] = $res->fields[2];
    $info['ip'] = $res->fields[1];
    if ($res->fields[15] == 1) {
        $info['search_link'] = "index.php?p=banlist&advSearch=" . $info['ip'] . "&advType=ip&Submit";
    } else {
        $info['search_link'] = "index.php?p=banlist&advSearch=" . $info['authid'] . "&advType=steamid&Submit";
    }
    $info['link_url'] = "window.location = '" . $info['search_link'] . "';";
    $info['short_name'] = trunc($info['name'], 25, false);
    if ($res->fields[14] == 'D' || $res->fields[14] == 'U' || $res->fields[14] == 'E' || $res->fields[6] && $res->fields[5] < time()) {
        $info['unbanned'] = true;
        if ($res->fields[14] == 'D') {
            $info['ub_reason'] = 'У';
     default:
         $data['type_icon'] = '<img src="images/country/zz.gif" alt="Unknown block type" border="0" align="absmiddle" />';
         break;
 }
 $data['ban_date'] = SBDate($dateformat, $res->fields['ban_created']);
 $data['player'] = addslashes($res->fields['player_name']);
 $data['steamid'] = $res->fields['authid'];
 $data['communityid'] = $res->fields['community_id'];
 if (isset($GLOBALS['config']['banlist.hideadminname']) && $GLOBALS['config']['banlist.hideadminname'] == "1" && !$userbank->is_admin()) {
     $data['admin'] = false;
 } else {
     $data['admin'] = stripslashes($res->fields['admin_name']);
 }
 $data['reason'] = stripslashes($res->fields['ban_reason']);
 if ($res->fields['ban_length'] > 0) {
     $data['ban_length'] = SecondsToString(intval($res->fields['ban_length']));
     $data['expires'] = SBDate($dateformat, $res->fields['ban_ends']);
 } else {
     if ($res->fields['ban_length'] == 0) {
         $data['ban_length'] = 'Permanent';
         $data['expires'] = 'never';
     } else {
         $data['ban_length'] = 'Session';
         $data['expires'] = 'n/a';
     }
 }
 // Что за тип разбана - D? Я такой не видел, но оставлю так и быть.. for feature use...
 if ($res->fields['row_type'] == 'D' || $res->fields['row_type'] == 'U' || $res->fields['row_type'] == 'E' || $res->fields['ban_length'] && $res->fields['ban_ends'] < $data['c_time']) {
     $data['unbanned'] = true;
     $data['class'] = "listtable_1_unbanned";
     if ($res->fields['row_type'] == "D") {
$res = $GLOBALS['db']->Execute("SELECT count(bid) FROM " . DB_PREFIX . "_comms");
$CommCount = (int) $res->fields[0];
$res = $GLOBALS['db']->Execute("SELECT bid, ba.authid, ba.type, ba.name, created, ends, length, reason, ba.aid, ba.sid, ad.user, CONCAT(se.ip,':',se.port), se.sid, mo.icon, ba.RemoveType, ba.type\r\n\t\t\t\t    \t\t\t\tFROM " . DB_PREFIX . "_comms AS ba \r\n\t\t\t\t    \t\t\t\tLEFT JOIN " . DB_PREFIX . "_admins AS ad ON ba.aid = ad.aid\r\n\t\t\t\t    \t\t\t\tLEFT JOIN " . DB_PREFIX . "_servers AS se ON se.sid = ba.sid\r\n\t\t\t\t    \t\t\t\tLEFT JOIN " . DB_PREFIX . "_mods AS mo ON mo.mid = se.modid\r\n\t\t\t\t    \t\t\t\tORDER BY created DESC LIMIT 10");
$comms = array();
while (!$res->EOF) {
    $info = array();
    if ($res->fields['length'] == 0) {
        $info['perm'] = true;
        $info['unbanned'] = false;
    } else {
        $info['temp'] = true;
        $info['unbanned'] = false;
    }
    $info['name'] = stripslashes($res->fields[3]);
    $info['created'] = SBDate($dateformat, $res->fields['created']);
    $ltemp = explode(",", $res->fields[6] == 0 ? 'Permanent' : SecondsToString(intval($res->fields[6])));
    $info['length'] = $ltemp[0];
    $info['icon'] = empty($res->fields[13]) ? 'web.png' : $res->fields[13];
    $info['authid'] = $res->fields['authid'];
    $info['search_link'] = "index.php?p=commslist&advSearch=" . $info['authid'] . "&advType=steamid&Submit";
    $info['link_url'] = "window.location = '" . $info['search_link'] . "';";
    $info['short_name'] = trunc($info['name'], 25, false);
    $info['type'] = $res->fields['type'] == 2 ? "images/type_c.png" : "images/type_v.png";
    if ($res->fields[14] == 'D' || $res->fields[14] == 'U' || $res->fields[14] == 'E' || $res->fields[6] && $res->fields[5] < time()) {
        $info['unbanned'] = true;
        if ($res->fields[14] == 'D') {
            $info['ub_reason'] = 'D';
        } elseif ($res->fields[14] == 'U') {
            $info['ub_reason'] = 'U';
        } else {
            $info['ub_reason'] = 'E';
     }
 } else {
     $data['country'] = '<img src="images/country/zz.gif" alt="Unknown Country" border="0" align="absmiddle" />';
 }
 $data['ban_date'] = SBDate($dateformat, $res->fields['ban_created']);
 $data['player'] = addslashes($res->fields['player_name']);
 $data['type'] = $res->fields['type'];
 $data['steamid'] = $res->fields['authid'];
 $data['communityid'] = $res->fields['community_id'];
 if (isset($GLOBALS['config']['banlist.hideadminname']) && $GLOBALS['config']['banlist.hideadminname'] == "1" && !$userbank->is_admin()) {
     $data['admin'] = false;
 } else {
     $data['admin'] = stripslashes($res->fields['admin_name']);
 }
 $data['reason'] = stripslashes($res->fields['ban_reason']);
 $data['ban_length'] = $res->fields['ban_length'] == 0 ? 'Навсегда' : SecondsToString(intval($res->fields['ban_length']));
 if ($res->fields['row_type'] == 'D' || $res->fields['row_type'] == 'U' || $res->fields['row_type'] == 'E' || $res->fields['ban_length'] && $res->fields['ban_ends'] < time()) {
     $data['unbanned'] = true;
     $data['class'] = "listtable_1_unbanned";
     if ($res->fields['row_type'] == "D") {
         $data['ub_reason'] = "(Удалён)";
     } elseif ($res->fields['row_type'] == "U") {
         $data['ub_reason'] = "(Разбанен)";
     } else {
         $data['ub_reason'] = "(Истек)";
     }
     $data['ureason'] = stripslashes($res->fields['unban_reason']);
     $removedby = $GLOBALS['db']->GetRow("SELECT user FROM `" . DB_PREFIX . "_admins` WHERE aid = '" . $res->fields['RemovedBy'] . "'");
     $data['removedby'] = "";
     if (isset($removedby[0])) {
         $data['removedby'] = $removedby[0];
                if ($i % 2 == 0) {
                    $usersOnlineTable .= "<tr class='rowColor1'>";
                } else {
                    $usersOnlineTable .= "<tr class='rowColor2'>";
                }
                $usersOnlineTable .= "<td>";
                $usersOnlineTable .= $SteamPlayer->getId();
                $usersOnlineTable .= "</td>";
                $usersOnlineTable .= "<td>";
                $usersOnlineTable .= str_replace("\"", "''", $SteamPlayer->getName());
                $usersOnlineTable .= "</td>";
                $usersOnlineTable .= "<td>";
                $usersOnlineTable .= $SteamPlayer->getScore();
                $usersOnlineTable .= "</td>";
                $usersOnlineTable .= "<td>";
                $usersOnlineTable .= SecondsToString($SteamPlayer->getConnectTime());
                $usersOnlineTable .= "</td>";
                $usersOnlineTable .= "</tr>";
            }
            $usersOnlineTable .= "</table>";
            $usersOnlineTable .= "</div>";
        } else {
            $usersOnlineTable = $LAN_SERVERLIST_006;
        }
        ?>
				<img src="images/group.png" onmouseover="Tip('<?php 
        echo addslashes($usersOnlineTable);
        ?>
', SHADOW, true, FADEIN, 300, FADEOUT, 300, STICKY, 1, CLICKCLOSE, true, BGCOLOR, getStyleBackgroundColor('container'), BORDERCOLOR, getStyleBackgroundColor('serverListTable'))"/><br/>
				<?php 
    }