Adds banner support and banners

This commit is contained in:
nonmakina 2021-01-09 16:11:28 -06:00
parent f9a6b584e1
commit e48982cf41
27 changed files with 16 additions and 19 deletions

View File

@ -1,22 +1,16 @@
<html>
<head>
<title>Lainchan Banners</title>
</head>
<body>
<?php
function listBannersInDir($dir) {
if ($handle = opendir($dir)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
echo "<a href=\"$dir/$entry\"><img src=\"$dir/$entry\" alt=\"$entry\" style=\"width:348px;height:128px\"></a> ";
}
}
closedir($handle);
}
function getBannerSrc(){
$files = scandir(__dir__.'/banners/');
$files = array_diff($files, array('.', '..'));
return $files[array_rand($files)];
}
listBannersInDir("banners_priority");
listBannersInDir("banners");
?>
</body>
</html>
$filename = getBannerSrc();
$filename = "banners/" . $filename;
$fp = fopen($filename, 'rb');
header("Content-Type: image/png");
header("Content-Length: " . filesize($filename));
fpassthru($fp);
?>

BIN
banners/1608992480627.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
banners/1608992511794.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
banners/1608992524118.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
banners/1608992551600.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
banners/1608992576348.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
banners/1608992589414.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
banners/1608992682734.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
banners/1608993276367.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
banners/1608996011049.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
banners/1609004437891.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
banners/1609004460965.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
banners/1609010983068.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

BIN
banners/1610174020766-0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
banners/1610174020766-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
banners/1610174020766-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
banners/1610174020766-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
banners/1610174020766-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
banners/1610175053568.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
banners/1610178074936-0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
banners/1610178074936-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
banners/1610178074936-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
banners/1610178136375.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

BIN
banners/1610178320956-0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
banners/1610178320956-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

View File

@ -93,6 +93,9 @@ $config['threads_preview'] = 5;
$config['root'] = '/';
$config['secure_trip_salt'] = 'ODQ2NDM0ODlmMmRhNzk2M2EyNjJlOW';
//Banners
$config['url_banner'] = '/banners.php';
/*
* Some users are having trouble posting when this is on,
* with the message 'Your request looks automated; Post discarded.'