Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define("ROOT", "img");
- $list = Array();
- foreach (scandir(ROOT) as $gallery) {
- if ($gallery == "." || $gallery == "..") continue;
- $gallery= ROOT."/".$gallery;
- $dir = dir($gallery);
- while ($file = $dir->read()) {
- $path = $gallery."/".$file;
- if ($file == "." || $file == "..") continue;
- if (is_dir($path)) continue;
- $list[$path] = filemtime($path);
- }
- }
- arsort($list);
- #bez regulernich vyrazu
- foreach ($list as $image_path => $time) {
- $tmp = explode("/", $image_path);
- $image_name = array_pop($tmp);
- $thumbnail_path = implode("/", $tmp)."/small/".$image_name;
- echo "<a href='$image_path' target='_blank' title='Vytvořeno ".date("j. n. Y H:i:s", $time)."'><img src='$thumbnail_path'></a>\n";
- }
- #s regulernimi vyrazy
- foreach ($list as $image_path => $time) {
- $thumbnail_path = ereg_replace("/([^/])+$", "/small\\0", $image_path);
- echo "<a href='$image_path' target='_blank' title='Vytvořeno ".date("j. n. Y H:i:s", $time)."'><img src='$thumbnail_path'></a>\n";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement