Source code of Leftypol imageboard
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<?php
|
|
|
|
function getBannerSrc(){
|
|
|
|
$files = scandir(__dir__.'/banners/');
|
|
|
|
$files = array_diff($files, array('.', '..'));
|
|
|
|
return $files[array_rand($files)];
|
|
|
|
}
|
|
|
|
|
|
|
|
$filename = getBannerSrc();
|
|
|
|
$filename = "banners/" . $filename;
|
|
|
|
$fp = fopen($filename, 'rb');
|
|
|
|
|
|
|
|
header("Content-Type: image/png");
|
|
|
|
header("Content-Length: " . filesize($filename));
|
|
|
|
|
|
|
|
fpassthru($fp);
|
|
|
|
?>
|