Browse Source
Merge pull request #117 from nonmakina/banners
Adds banner support and banners
pull/40/head
towards-a-new-leftypol
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with
16 additions and
20 deletions
-
banners.php
-
BIN
banners/1608992480627.jpg
-
BIN
banners/1608992511794.jpg
-
BIN
banners/1608992524118.jpg
-
BIN
banners/1608992551600.jpg
-
BIN
banners/1608992576348.jpg
-
BIN
banners/1608992589414.jpg
-
BIN
banners/1608992682734.jpg
-
BIN
banners/1608993276367.jpg
-
BIN
banners/1608996011049.png
-
BIN
banners/1609004437891.jpg
-
BIN
banners/1609004460965.jpg
-
BIN
banners/1609010983068.gif
-
BIN
banners/1610174020766-0.png
-
BIN
banners/1610174020766-1.png
-
BIN
banners/1610174020766-2.png
-
BIN
banners/1610174020766-3.png
-
BIN
banners/1610174020766-4.png
-
BIN
banners/1610175053568.png
-
BIN
banners/1610178074936-0.png
-
BIN
banners/1610178074936-3.png
-
BIN
banners/1610178074936-4.png
-
BIN
banners/1610178136375.png
-
BIN
banners/1610178320956-0.png
-
BIN
banners/1610178320956-1.png
-
BIN
banners/lain-bottom.png
-
inc/instance-config.php
-
stylesheets/style.css
|
|
@ -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"); |
|
|
|
$filename = getBannerSrc(); |
|
|
|
$filename = "banners/" . $filename; |
|
|
|
$fp = fopen($filename, 'rb'); |
|
|
|
|
|
|
|
header("Content-Type: image/png"); |
|
|
|
header("Content-Length: " . filesize($filename)); |
|
|
|
|
|
|
|
fpassthru($fp); |
|
|
|
?> |
|
|
|
</body> |
|
|
|
</html> |
|
|
|
Width:
|
Height:
|
Size: 54 KiB
|
Width:
|
Height:
|
Size: 56 KiB
|
Width:
|
Height:
|
Size: 28 KiB
|
Width:
|
Height:
|
Size: 50 KiB
|
Width:
|
Height:
|
Size: 35 KiB
|
Width:
|
Height:
|
Size: 62 KiB
|
Width:
|
Height:
|
Size: 14 KiB
|
Width:
|
Height:
|
Size: 44 KiB
|
Width:
|
Height:
|
Size: 63 KiB
|
Width:
|
Height:
|
Size: 51 KiB
|
Width:
|
Height:
|
Size: 48 KiB
|
Width:
|
Height:
|
Size: 184 KiB
|
Width:
|
Height:
|
Size: 62 KiB
|
Width:
|
Height:
|
Size: 52 KiB
|
Width:
|
Height:
|
Size: 66 KiB
|
Width:
|
Height:
|
Size: 64 KiB
|
Width:
|
Height:
|
Size: 46 KiB
|
Width:
|
Height:
|
Size: 14 KiB
|
Width:
|
Height:
|
Size: 56 KiB
|
Width:
|
Height:
|
Size: 40 KiB
|
Width:
|
Height:
|
Size: 60 KiB
|
Width:
|
Height:
|
Size: 72 KiB
|
Width:
|
Height:
|
Size: 50 KiB
|
Width:
|
Height:
|
Size: 20 KiB
|
Width:
|
Height:
|
Size: 116 KiB
|
|
|
@ -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.' |
|
|
|
|
|
@ -380,7 +380,6 @@ div.banner a:hover { |
|
|
|
|
|
|
|
img.banner,img.board_image { |
|
|
|
display: block; |
|
|
|
border: 1px solid #a9a9a9; |
|
|
|
margin: 3em auto 0 auto; |
|
|
|
} |
|
|
|
|
|
|
|