public static function showImage() { global $_IMAGES; if (isset($_GET['img'])) { $mtime = gmdate('r', filemtime($_SERVER['SCRIPT_FILENAME'])); $etag = md5($mtime . $_SERVER['SCRIPT_FILENAME']); if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $mtime || isset($_SERVER['HTTP_IF_NONE_MATCH']) && str_replace('"', '', stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])) == $etag) { header('HTTP/1.1 304 Not Modified'); return true; } else { header('ETag: "' . $etag . '"'); header('Last-Modified: ' . $mtime); header('Content-type: image/gif'); if (strlen($_GET['img']) > 0 && isset($_IMAGES[$_GET['img']])) { print base64_decode($_IMAGES[$_GET['img']]); } else { print base64_decode($_IMAGES["unknown"]); } } return true; } else { if (isset($_GET['thumb'])) { if (strlen($_GET['thumb']) > 0 && EncodeExplorer::getConfig('thumbnails') == true) { ImageServer::showThumbnail($_GET['thumb']); } return true; } } return false; }
/** * Checks if an image is requested and displays one if needed * * @return true/false */ public static function showImage() { if (isset($_GET['thumb'])) { $inline = isset($_GET['in']) ? true : false; if (strlen($_GET['thumb']) > 0 && (SetUp::getConfig('thumbnails') == true || SetUp::getConfig('inline_thumbs') == true)) { ImageServer::showThumbnail($_GET['thumb'], $inline); } return true; } return false; }