Ejemplo n.º 1
0
error_reporting(0);
$uid = isset($_GET["uid"]) ? $_GET["uid"] : 0;
$size = isset($_GET["size"]) ? $_GET["size"] : "";
$random = isset($_GET["random"]) ? $_GET["random"] : "";
$engine = isset($_GET["engine"]) ? strtolower($_GET["engine"]) : "";
if (!in_array($engine, array("local", "sae"))) {
    $engine = "local";
}
$bg = getbg($uid, $size);
if ($engine == "local") {
    $path = "./data/home/";
    $fileExists = file_exists($path . $bg);
} else {
    require_once "./system/extensions/enginedriver/sae/SAEFile.php";
    $file = new SAEFile();
    $path = $file->fileName("data/home/");
    $fileExists = $file->fileExists($path . $bg);
}
if ($fileExists) {
    $random = !empty($random) ? rand(1000, 9999) : "";
    $bgUrl = empty($random) ? $path . $bg : $path . $bg . "?random=" . $random;
} else {
    $size = in_array($size, array("big", "middle", "small")) ? $size : "small";
    $bgUrl = $path . "nobg_" . $size . ".jpg";
}
if (empty($random)) {
    header("HTTP/1.1 301 Moved Permanently");
    header("Last-Modified:" . date("r"));
    header("Expires: " . date("r", time() + 86400));
}
header("Location: " . $bgUrl);
Ejemplo n.º 2
0
error_reporting(0);
$uid = isset($_GET["uid"]) ? $_GET["uid"] : 0;
$size = isset($_GET["size"]) ? $_GET["size"] : "";
$random = isset($_GET["random"]) ? $_GET["random"] : "";
$engine = isset($_GET["engine"]) ? strtolower($_GET["engine"]) : "";
if (!in_array($engine, array("local", "sae"))) {
    $engine = "local";
}
$avatar = getavatar($uid, $size);
if ($engine == "local") {
    $path = "./data/avatar/";
    $fileExists = file_exists($path . $avatar);
} else {
    require_once "./system/extensions/enginedriver/sae/SAEFile.php";
    $file = new SAEFile();
    $path = $file->fileName("data/avatar/");
    $fileExists = $file->fileExists($path . $avatar);
}
if ($fileExists) {
    $random = !empty($random) ? rand(1000, 9999) : "";
    $avatarUrl = empty($random) ? $path . $avatar : $path . $avatar . "?random=" . $random;
} else {
    $size = in_array($size, array("big", "middle", "small")) ? $size : "middle";
    $avatarUrl = $path . "noavatar_" . $size . ".png";
}
if (empty($random)) {
    header("HTTP/1.1 301 Moved Permanently");
    header("Last-Modified:" . date("r"));
    header("Expires: " . date("r", time() + 86400));
}
header("Location: " . $avatarUrl);