Adds banner support and banners
32
banners.php
|
@ -1,22 +1,16 @@
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Lainchan Banners</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<?php
|
<?php
|
||||||
function listBannersInDir($dir) {
|
function getBannerSrc(){
|
||||||
if ($handle = opendir($dir)) {
|
$files = scandir(__dir__.'/banners/');
|
||||||
while (false !== ($entry = readdir($handle))) {
|
$files = array_diff($files, array('.', '..'));
|
||||||
if ($entry != "." && $entry != "..") {
|
return $files[array_rand($files)];
|
||||||
echo "<a href=\"$dir/$entry\"><img src=\"$dir/$entry\" alt=\"$entry\" style=\"width:348px;height:128px\"></a> ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
closedir($handle);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
listBannersInDir("banners_priority");
|
$filename = getBannerSrc();
|
||||||
listBannersInDir("banners");
|
$filename = "banners/" . $filename;
|
||||||
?>
|
$fp = fopen($filename, 'rb');
|
||||||
</body>
|
|
||||||
</html>
|
header("Content-Type: image/png");
|
||||||
|
header("Content-Length: " . filesize($filename));
|
||||||
|
|
||||||
|
fpassthru($fp);
|
||||||
|
?>
|
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 184 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 116 KiB |
|
@ -93,6 +93,9 @@ $config['threads_preview'] = 5;
|
||||||
$config['root'] = '/';
|
$config['root'] = '/';
|
||||||
$config['secure_trip_salt'] = 'ODQ2NDM0ODlmMmRhNzk2M2EyNjJlOW';
|
$config['secure_trip_salt'] = 'ODQ2NDM0ODlmMmRhNzk2M2EyNjJlOW';
|
||||||
|
|
||||||
|
//Banners
|
||||||
|
$config['url_banner'] = '/banners.php';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some users are having trouble posting when this is on,
|
* Some users are having trouble posting when this is on,
|
||||||
* with the message 'Your request looks automated; Post discarded.'
|
* with the message 'Your request looks automated; Post discarded.'
|
||||||
|
|