2 $pagetitle = "Example photoalbum.";
3 $css_file = 'indexstyle.css';
4 $parent_url = "http://example.com";
5 $parent_linktext = "UPDATE index.php";
6 $contact_address = "someone@example.com";
8 //define the path as relative
11 //using the opendir function
12 $dir_handle = @opendir
($path) or die("Unable to open $path");
14 //running the while loop
15 while ($file = readdir($dir_handle)) {
16 $target = $path . $file;
17 if (($file != "images") && ($file != "generate") && ($file != ".") && ($file != "..")) {
18 if(file_exists($target)) {
19 if (!is_file($target)) {
20 if (is_file($target . "/.title")) {
21 $fd = fopen($target . "/.title", "r");
23 $buf = fgets($fd, 4096);
25 $album[$file] = "<span class='strong'>" . $buf . "</span>";
28 if (is_file($target . "/.indeximage")) {
29 $fd = fopen($target . "/.indeximage", "r");
30 $buf = $file . "/thumb/";
31 $buf .= fgets($fd, 4096);
34 $idximage[$file] = "<img src='" . $buf . "' alt='Thumb' />";
43 //closing the directory
44 closedir($dir_handle);
48 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
49 <html xmlns
="http://www.w3.org/1999/xhtml">
51 <title
><?
=$pagetitle?
></title
>
53 <link rel
='stylesheet' href
='<?=$css_file?>' type
='text/css' />
54 <meta http
-equiv
="Content-type" content
="text/html;charset=UTF-8" />
60 <h1
><?
=$pagetitle?
></h1
>
61 <a style
="display: block; float: right;" href
="rss.php"><img src
="images/rss_icon.png" alt
="RSS" border
="0" /></a
>
63 <div id
="head-link"><a href
="<?=$parent_url?>"><?
=$parent_linktext?
></a
>
65 <a href
="latest.php">Latest updates
</a
>
72 foreach ( $album as $key => $value ) {
73 echo "<div class='album'>";
74 echo "<div class='idxthumb'>";
75 echo "<a target='_blank' href='" . $key . "'>";
79 echo "<div class='idxlink'>";
80 echo "<a target='_blank' href='" . $key . "'>" . $key . "</a>\n";
82 echo "<div class='title'>$value</div>";
88 <div style
="font-family: sans; font-size: 7pt; color: #444; margin-top: 20px;">
89 <a href
="http://wiki.defcon.no/projects/plsgen">plsgen
: Perl Simple Gallery Generator
</a
>