Skip to content

Instantly share code, notes, and snippets.

@Battleroid
Last active September 18, 2020 18:22
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Battleroid/10013948 to your computer and use it in GitHub Desktop.
Save Battleroid/10013948 to your computer and use it in GitHub Desktop.
Banner script for TinyBoard. Works perfect.
<?php
$dir = "static/banners/";
$images = array();
if ($handle = scandir($dir)) {
foreach ($handle as $target) {
if (!in_array($target, [".", ".."])) {
$images[] = $target;
}
}
}
shuffle($images);
header("Location: {$dir}/{$images[0]}");
?>
@scallywag
Copy link

so once I have the .php created what directory do I upload it to, and where do I go after uploading it?

@ElGatoSaez
Copy link

@itsasylum this might help: vichan-devel/vichan#238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment