Browse Source

Merge pull request #34 from AshtonHarding/master

fixed stream spit | tested on home-server, works fine.
pull/40/head
Michael Walker 9 years ago
parent
commit
528bf314f3
  1. 13
      b.php
  2. 3
      stylesheets/style.css

13
b.php

@ -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;
?> ?>

3
stylesheets/style.css

@ -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 {

Loading…
Cancel
Save