Merge pull request #34 from AshtonHarding/master

fixed stream spit | tested on home-server, works fine.
This commit is contained in:
Michael Walker 2015-09-23 01:27:35 +01:00
commit 528bf314f3
2 changed files with 21 additions and 19 deletions

13
b.php
View File

@ -4,17 +4,18 @@ $dir = "banners/";
$files = scandir($dir); $files = scandir($dir);
$images = array_diff($files, array('.', '..')); $images = array_diff($files, array('.', '..'));
$name = $images[array_rand($images)]; $name = $images[array_rand($images)];
// open the file in a binary mode
$fp = fopen($dir . $name, 'rb'); // snags the extension
$img_extension = pathinfo($name, PATHINFO_EXTENSION);
// send the right headers // send the right headers
header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1 header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1
header('Pragma: no-cache'); // HTTP 1.0 header('Pragma: no-cache'); // HTTP 1.0
header('Expires: 0'); // Proxies header('Expires: 0'); // Proxies
header('Content-Type: ' . $fp['type']); header("Content-type: image/" . $img_extension);
header('Content-Length: ' . $fp['bytes']); header("Content-Disposition: inline; filename=" . $name);
// dump the picture and stop the script // readfile displays the image, passthru seems to spits stream.
fpassthru($fp); readfile($dir.$name);
exit; exit;
?> ?>

View File

@ -1,7 +1,7 @@
/* backup version before modifying bar.top */ /* backup version before modifying bar.top */
/*for trollin /*for trollin
audio { audio {
display:none; display:none;
} }
*/ */
@ -80,7 +80,7 @@ input[name="post"] {
[name="post"] [type="text"][name="subject"] { [name="post"] [type="text"][name="subject"] {
width: calc(100% - 74px); width: calc(100% - 74px);
min-width: 162px; min-width: 162px;
} }
input#upload_file { input#upload_file {
width: 180px; width: 180px;
@ -89,7 +89,7 @@ input#upload_file {
[name="post"] [type="text"]:not([name="subject"]), [name="post"] textarea { [name="post"] [type="text"]:not([name="subject"]), [name="post"] textarea {
width: 236px; width: 236px;
min-width: 236px; min-width: 236px;
} }
input#upload_file { input#upload_file {
width: 160px; width: 160px;
} }
@ -191,7 +191,7 @@ header div.subtitle {
top: -120px; top: -120px;
left: -30px; left: -30px;
pointer-events: none; pointer-events: none;
} }
[data-board] > .files > :nth-child(1).multifile > a:before { [data-board] > .files > :nth-child(1).multifile > a:before {
content: url('/static/partyhat.gif'); content: url('/static/partyhat.gif');
@ -319,7 +319,8 @@ div.delete [type="submit"] {
div.postcontainer div.postcontainer
{ {
display: inline-block; display: inline-block;
white-space: nowrap; white-space: nowrap; /* changed "nowrap" to */
word-break: break-word; /* bugfix: letters no longer shoot around the screen */
max-width: 100%!important; max-width: 100%!important;
} }
div.post.reply p { div.post.reply p {
@ -347,10 +348,10 @@ div.post.reply div.body a {
white-space: pre-wrap; white-space: pre-wrap;
} }
div.post div.body { div.post div.body {
white-space: pre-wrap; /* css-3 */ white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */ white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */ white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: normal; word-wrap: normal;
margin-left: 19px; margin-left: 19px;
} }
@ -459,7 +460,7 @@ fieldset label {
display: table; display: table;
position: fixed; position: fixed;
width: 100%; width: 100%;
left: 0px; left: 0px;
z-index: 3; z-index: 3;
background-color: #D6DAF0; background-color: #D6DAF0;
border-color: #B7C5D9; border-color: #B7C5D9;
@ -469,7 +470,7 @@ fieldset label {
vertical-align: middle; vertical-align: middle;
} }
.bar.top { .bar.top {
text-align: center; text-align: center;
top: 0px; top: 0px;
border-bottom: 1px solid #B7C5D9; border-bottom: 1px solid #B7C5D9;
} }
@ -504,7 +505,7 @@ div.pages.top {
z-index: 99; z-index: 99;
font-size: 10pt; font-size: 10pt;
text-align: left; text-align: left;
} }
div.pages a.selected { div.pages a.selected {
@ -521,7 +522,7 @@ div.pages form {
} }
div.pages form input { div.pages form input {
margin: 0 5px; margin: 0 5px;
margin-top: -1px; margin-top: -1px;
display: inline; display: inline;
} }
@ -536,7 +537,7 @@ div.boardlist {
#style-select { #style-select {
display: table-cell; display: table-cell;
font-size: 10pt; font-size: 10pt;
z-index: 3; z-index: 3;
text-align: right; text-align: right;
width: auto; width: auto;
} }