Skip to content

Instantly share code, notes, and snippets.

@RoyBellingan
Created May 28, 2022 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RoyBellingan/b11dece8265a88789e7b43bfe191977b to your computer and use it in GitHub Desktop.
Save RoyBellingan/b11dece8265a88789e7b43bfe191977b to your computer and use it in GitHub Desktop.
ReasonableImageGallery.php
<meta name="viewport" content="width=device-width, initial-scale=0.5">
<style>
html,body {
text-size-adjust: none;
-webkit-text-size-adjust: none;
-moz-text-size-adjust: none;
-ms-text-size-adjust: none;
font-size:30px;
}
body, .mobileCry{
background-color:black;
color:silver;
}
.img{
float:left;
margin-left: 8px;
}
a{
color:silver;
}
</style>
<?php
$page = $_GET["page"];
if ($page < 1){
$page = 1;
}
chdir("thumb/");
$set = glob("*.JPG");
$i = 0;
$j = 0;
$head = '';
$pack = '';
foreach($set as $file ){
if($i % 50 == 0){
$j++;
$head .= <<<EOD
<a href="index.php?page=$j">Page $j</a>
EOD;
}
if($i > (($page -1) * 50) && $i < $page * 50){
$pack .= <<<EOD
<a href="rsx/$file">
<div class="img">
<img src="thumb/$file"> <br>
</a>
</div>
EOD;
}
$i++;
}
echo "<span class='mobileCry'>" . $head ."<br> </span>\n";
echo $pack ."<br>\n";
echo '<div style="clear:both"></div>';
echo "<span class='mobileCry'>" . $head ."<br> </span>\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment