コード例 #1
0
        if ($result->server_ip == "") {
            $ban_row["mod"] = "html";
        } else {
            $ban_row["mod"] = $result->gametype == "" || $result->gametype == "website" ? "html" : $result->gametype;
            $ban_row["nickname"] = htmlspecialchars($result->nickname);
        }
        if ($config->show_kick_count == "1") {
            $ban_row["kick_count"] = $result->ban_kicks;
            $ban_page["show_kicks"] = 1;
        }
        if ($config->show_demo_count == "1") {
            $ban_row["demo_count"] = sql_get_files_count($result->bid);
            $ban_page["show_demos"] = 1;
        }
        if ($config->show_comment_count == "1") {
            $ban_row["comment_count"] = sql_get_comments_count($result->bid);
            $ban_page["show_comments"] = 1;
        }
        $ban_list[] = $ban_row;
    }
    $smarty->assign("ban_list", $ban_list);
    $smarty->assign("ban_page", $ban_page);
}
//ban delete
if (isset($_POST["del_ban_x"]) && isset($_POST["bid"])) {
    //get all uploaded files for the ban and delete it
    $query = mysql_query("SELECT `id`,`demo_file` FROM `" . $config->db_prefix . "_files` WHERE `bid`=" . $bid) or die(mysql_error());
    while ($result = mysql_fetch_object($query)) {
        if (file_exists("include/files/" . $result->demo_file)) {
            //delete the file(s)
            if (file_exists("include/files/" . $result->demo_file . "_thumb")) {
コード例 #2
0
        }
        $db_size = 0;
        for ($i = 0; $i < count($tabledata); $i++) {
            $db_size += $tabledata[$i]["Data_length"] + $tabledata[$i]["Index_length"];
        }
        return $db_size;
    } else {
        return "_NOTAVAILABLE";
    }
}
function format_size($size)
{
    if ($size == "_NOTAVAILABLE") {
        return "_NOTAVAILABLE";
    }
    if ($size >= 1073741824) {
        return round($size / 1073741824, 2) . "GB";
    } elseif ($size >= 1048576) {
        return round($size / 1048576, 2) . "MB";
    } elseif ($size >= 1024) {
        return round($size / 1024, 2) . " KB";
    } else {
        return $size . " Byte";
    }
}
$smarty->assign("bans", array("count" => sql_get_bans_count(0), "activ" => sql_get_bans_count(1)));
$smarty->assign("db_size", format_size(db_size($config->db_db, $config->db_prefix)));
$smarty->assign("auto_prune", $config->auto_prune);
$smarty->assign("comment_count", array("count" => sql_get_comments_count(0), "fail" => sql_get_comments_count_fail(0)));
$smarty->assign("file_count", array("count" => sql_get_files_count(0), "fail" => sql_get_files_count_fail(0)));
$smarty->assign("msg", $user_msg);