<?php
//error_reporting(2047|2048);
error_reporting(0);
include 'config.php';
class_exists('config') or die('Error load config class');
$config = new config(0, 0, 0);
$id = intval($_GET['id']);
if($id < 1) exit('Bad banner id');
if(isset($_GET['std'])) $dir = '/banners/std/'; else $dir = '/banners/';
$img = getimagesize($config->root.$dir.$id);
if(!$img) exit('Bad banner id');
header('Content-Type: '.$img['mime']);
echo file_get_contents($config->root.$dir.$id);
?>