예제 #1
0
header("Pragma: no-cache");
header("Cache-Control: no-cache, must-revalidate");
header("Keep-Alive: timeout=5, max=100");
initDataProvider();
$parameters = getTargetParameters();
$html = "";
if (!empty($_GET["id"]) && is_numeric($_GET["id"])) {
    $prefix = !empty($_GET["type"]) && $_GET["type"] == "overlay" ? "overlay" : "inlay";
    if (operatorsAvailable(0, $parameters["exclude"], $parameters["include_group"], $parameters["include_user"]) > 0) {
        exit(getFileById($_GET["id"], true, $prefix));
    } else {
        if (!empty($_GET["cboo"])) {
            header("Content-Type: image/gif;");
            exit(file_get_contents(PATH_IMAGES . "chat_blank.gif"));
        } else {
            exit(getFileById($_GET["id"], false, $prefix));
        }
    }
} else {
    if (!empty($_GET["tl"]) && !empty($_GET["srv"])) {
        $html = "<a href=\\\"javascript:void(window.open('<!--server-->','','width=" . $CONFIG["wcl_window_width"] . ",height=" . $CONFIG["wcl_window_height"] . ",left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes'))\\\" <!--class-->><!--text--></a>";
        $html = str_replace("<!--server-->", htmlentities(base64UrlDecode($_GET["srv"]), ENT_QUOTES, "UTF-8"), $html);
        if (!empty($_GET["tlont"]) && operatorsAvailable(0, $parameters["exclude"], $parameters["include_group"], $parameters["include_user"]) > 0) {
            if (!empty($_GET["tlonc"])) {
                $html = str_replace("<!--class-->", "class=\\\"" . htmlentities(base64UrlDecode($_GET["tlonc"]), ENT_QUOTES, "UTF-8") . "\\\"", $html);
            } else {
                $html = str_replace("<!--class-->", "", $html);
            }
            $html = processPlaceholders($html);
            $html = str_replace("<!--text-->", htmlentities(base64UrlDecode($_GET["tlont"]), ENT_QUOTES, "UTF-8"), $html);
        } else {
예제 #2
0
function getFileById($_id, $_online, $_prefix)
{
    $int = $_online ? "1" : "0";
    if ($_online && @file_exists("./banner/" . $_prefix . "_" . $_id . "_1.gif") || !$_online && @file_exists("./banner/" . $_prefix . "_" . $_id . "_0.gif")) {
        header("Content-Type: image/gif;");
        return "./banner/" . $_prefix . "_" . $_id . "_" . $int . ".gif";
    } else {
        if ($_online && @file_exists("./banner/" . $_prefix . "_" . $_id . "_1.png") || !$_online && @file_exists("./banner/" . $_prefix . "_" . $_id . "_0.png")) {
            header("Content-Type: image/png;");
            return "./banner/" . $_prefix . "_" . $_id . "_" . $int . ".png";
        } else {
            if ($_prefix == "inlay") {
                return getFileById($_id, $_online, "livezilla");
            } else {
                header("HTTP/1.0 404 Not Found");
                exit;
            }
        }
    }
}