2 <head
><title
>plsgen
-generated photoalbum
.</title
>
4 <link rel
='stylesheet' href
='indexstyle.css' type
='text/css' />
10 <h1
>Photo albums
!</h1
>
11 <a style
="display: block; float: right;" href
="rss.php"><img src
="images/rss_icon.png" alt
="RSS" border
="0" /></a
>
12 <div id
="head-link"><a href
="http://example.com">Update index
.php
!</a
>
19 //define the path as relative
22 //using the opendir function
23 $dir_handle = @opendir
($path) or die("Unable to open $path");
25 //running the while loop
26 while ($file = readdir($dir_handle)) {
27 $target = $path . $file;
28 if (($file != "images") && ($file != "generate") && ($file != ".") && ($file != "..")) {
29 if(file_exists($target)) {
30 if (!is_file($target)) {
31 if (is_file($target . "/.title")) {
32 $fd = fopen($target . "/.title", "r");
34 $buf = fgets($fd, 4096);
36 $album[$file] = "<span class='strong'>" . $buf . "</span>";
39 if (is_file($target . "/.indeximage")) {
40 $fd = fopen($target . "/.indeximage", "r");
41 $buf = $file . "/thumb/";
42 $buf .= fgets($fd, 4096);
45 $idximage[$file] = "<img src='" . $buf . "' alt='Thumb' />";
54 //closing the directory
55 closedir($dir_handle);
59 foreach ( $album as $key => $value ) {
60 echo "<div class='album'>";
61 echo "<div class='idxthumb'>";
62 echo "<a target=_blank href='" . $key . "'>";
66 echo "<div class='idxlink'>";
67 echo "<a target=_blank href='" . $key . "'>" . $key . "</a>\n";
69 echo "<div class='title'>$value</div>";
75 <div style
="font-family: sans; font-size: 7pt; color: #444; margin-top: 20px;">
76 Photo gallery index by Jon Langseth
, generated using
<a href
="index.phps">index
.php
</a
>