Esempio n. 1
0
        $cotherdataedit = "";
        $ctext = "";
    }
    $_GET["ctype"] = substr($_GET["ctype"], 0, 1);
    $cotherdata = $GLOBALS['db']->Execute("SELECT cid, aid, commenttxt, added, edittime,\n\t\t\t\t\t\t\t\t\t\t\t(SELECT user FROM `" . DB_PREFIX . "_admins` WHERE aid = C.aid) AS comname,\n\t\t\t\t\t\t\t\t\t\t\t(SELECT user FROM `" . DB_PREFIX . "_admins` WHERE aid = C.editaid) AS editname\n\t\t\t\t\t\t\t\t\t\t\tFROM `" . DB_PREFIX . "_comments` AS C\n\t\t\t\t\t\t\t\t\t\t\tWHERE type = ? AND bid = ?" . $cotherdataedit . " ORDER BY added desc", array($_GET["ctype"], $_GET["comment"]));
    $ocomments = array();
    while (!$cotherdata->EOF) {
        $coment = array();
        $coment['comname'] = $cotherdata->fields['comname'];
        $coment['added'] = SBDate($dateformat, $cotherdata->fields['added']);
        $coment['commenttxt'] = htmlspecialchars($cotherdata->fields['commenttxt']);
        $coment['commenttxt'] = str_replace("\n", "<br />", $coment['commenttxt']);
        // Parse links and wrap them in a <a href=""></a> tag to be easily clickable
        $coment['commenttxt'] = preg_replace('@(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)@', '<a href="$1" target="_blank">$1</a>', $coment['commenttxt']);
        if ($cotherdata->fields['editname'] != "") {
            $coment['edittime'] = SBDate($dateformat, $cotherdata->fields['edittime']);
            $coment['editname'] = $cotherdata->fields['editname'];
        } else {
            $coment['editname'] = "";
            $coment['edittime'] = "";
        }
        array_push($ocomments, $coment);
        $cotherdata->MoveNext();
    }
    $theme->assign('page', isset($_GET["page"]) ? $page : -1);
    $theme->assign('othercomments', $ocomments);
    $theme->assign('commenttext', isset($ctext) ? $ctext : "");
    $theme->assign('ctype', $_GET["ctype"]);
    $theme->assign('cid', isset($_GET["cid"]) ? $_GET["cid"] : "");
}
$theme->assign('view_comments', $view_comments);
        $page_numbers .= '<option value="' . $i . '">' . $i . '</option>';
    }
    $page_numbers .= '</select>';
}
$log_list = array();
foreach ($log as $l) {
    $log_item = array();
    if ($l['type'] == "m") {
        $log_item['type_img'] = "<img src='themes/" . SB_THEME . "/images/admin/help.png' alt='Info'>";
    } elseif ($l['type'] == "w") {
        $log_item['type_img'] = "<img src='themes/" . SB_THEME . "/images/admin/warning.png' alt='Warning'>";
    } elseif ($l['type'] == "e") {
        $log_item['type_img'] = "<img src='themes/" . SB_THEME . "/images/admin/error.png' alt='Warning'>";
    }
    $log_item['user'] = !empty($l['user']) ? $l['user'] : '******';
    $log_item['date_str'] = SBDate($dateformat, $l['created']);
    $log_item = array_merge($l, $log_item);
    array_push($log_list, $log_item);
}
// Theme stuff
$dh = opendir(SB_THEMES);
while (false !== ($filename = readdir($dh))) {
    $themes[] = $filename;
}
//$themes = scandir(SB_THEMES);
$valid_themes = array();
foreach ($themes as $thm) {
    if (@file_exists(SB_THEMES . $thm . "/theme.conf.php")) {
        $file = file_get_contents(SB_THEMES . $thm . "/theme.conf.php");
        if ($namesearch = preg_match_all('/define\\(\'theme_name\',[ ]*\\"(.+)\\"\\);/', $file, $thmname, PREG_PATTERN_ORDER)) {
            $thme['name'] = $thmname[1][0];
Esempio n. 3
0
    if (empty($admin['server_group']) || $admin['server_group'] == " ") {
        $admin['server_group'] = "No Group/Individual Permissions";
    }
    $num = $GLOBALS['db']->GetRow("SELECT count(authid) AS num FROM `" . DB_PREFIX . "_bans` WHERE aid = '" . $admin['aid'] . "'");
    $admin['bancount'] = $num['num'];
    $nodem = $GLOBALS['db']->GetRow("SELECT count(B.bid) AS num FROM `" . DB_PREFIX . "_bans` AS B WHERE aid = '" . $admin['aid'] . "' AND NOT EXISTS (SELECT D.demid FROM `" . DB_PREFIX . "_demos` AS D WHERE D.demid = B.bid)");
    $admin['aid'] = $admin['aid'];
    $admin['nodemocount'] = $nodem['num'];
    $admin['name'] = stripslashes($admin['user']);
    $admin['server_flag_string'] = SmFlagsToSb($userbank->GetProperty("srv_flags", $admin['aid']));
    $admin['web_flag_string'] = BitToString($userbank->GetProperty("extraflags", $admin['aid']));
    $lastvisit = $userbank->GetProperty("lastvisit", $admin['aid']);
    if (!$lastvisit) {
        $admin['lastvisit'] = "Never";
    } else {
        $admin['lastvisit'] = SBDate($dateformat, $userbank->GetProperty("lastvisit", $admin['aid']));
    }
    array_push($admin_list, $admin);
}
if ($page > 1) {
    $prev = CreateLinkR('<img border="0" alt="prev" src="images/left.gif" style="vertical-align:middle;" /> prev', "index.php?p=admin&c=admins&page=" . ($page - 1) . $advSearchString);
} else {
    $prev = "";
}
if ($AdminsEnd < $admin_count) {
    $next = CreateLinkR('next <img border="0" alt="prev" src="images/right.gif" style="vertical-align:middle;" />', "index.php?p=admin&c=admins&page=" . ($page + 1) . $advSearchString);
} else {
    $next = "";
}
//=================[ Start Layout ]==================================
$admin_nav = 'displaying&nbsp;' . $AdminsStart . '&nbsp;-&nbsp;' . $AdminsEnd . '&nbsp;of&nbsp;' . $admin_count . '&nbsp;results';
    $info['link_url'] = "window.location = '" . $info['search_link'] . "';";
    $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') {
Esempio n. 5
0
         $cdata['morecom'] = $morecom == 1 ? true : false;
         if ($commentres->fields['aid'] == $userbank->GetAid() || $userbank->HasAccess(ADMIN_OWNER)) {
             $cdata['editcomlink'] = CreateLinkR('<img src=\'images/edit.gif\' border=\'0\' alt=\'\' style=\'vertical-align:middle\' />', 'index.php?p=banlist&comment=' . (int) $sub['subid'] . '&ctype=S&cid=' . $commentres->fields['cid'], 'Edit Comment');
             if ($userbank->HasAccess(ADMIN_OWNER)) {
                 $cdata['delcomlink'] = "<a href=\"#\" class=\"tip\" title=\"<img src='images/delete.gif' border='0' alt='' style='vertical-align:middle' /> :: Delete Comment\" target=\"_self\" onclick=\"RemoveComment(" . $commentres->fields['cid'] . ",'S',-1);\"><img src='images/delete.gif' border='0' alt='' style='vertical-align:middle' /></a>";
             }
         } else {
             $cdata['editcomlink'] = "";
             $cdata['delcomlink'] = "";
         }
         $cdata['comname'] = $commentres->fields['comname'];
         $cdata['added'] = SBDate($dateformat, $commentres->fields['added']);
         $cdata['commenttxt'] = htmlspecialchars($commentres->fields['commenttxt']);
         $cdata['commenttxt'] = str_replace("\n", "<br />", $cdata['commenttxt']);
         if (!empty($commentres->fields['edittime'])) {
             $cdata['edittime'] = SBDate($dateformat, $commentres->fields['edittime']);
             $cdata['editname'] = $commentres->fields['editname'];
         } else {
             $cdata['edittime'] = "";
             $cdata['editname'] = "";
         }
         $morecom = 1;
         array_push($comment, $cdata);
         $commentres->MoveNext();
     }
 } else {
     $comment = "None";
 }
 $sub['commentdata'] = $comment;
 $sub['subaddcomment'] = CreateLinkR('<img src="images/details.gif" border="0" alt="" style="vertical-align:middle" /> Add Comment', 'index.php?p=banlist&comment=' . (int) $sub['subid'] . '&ctype=S');
 //----------------------------------------