<html>
<head>
<title>Picture Index</title>
<meta name="AUTHOR" content="unknown">
<meta name="MODIFIER" content="p.t.lyman">
</head>
<body bgcolor=#ffffff>
<center>
<!--
<h1>Picture Index</h1>
-->

<?php
// Search title file in parent directory and if found, display title -- ptl
$dir1 = scandir(".");
foreach($dir1 as $file) {
     if (preg_match("/(.*)\.TITLE$/i", "$file", $matches))  echo "<h2>$matches[1]</h2>";
	}	
?>

<br>
<hr>

<table>
<colgroup width=155>
<thead>
<tr height=155>
<?php
   $wide = 5;
   $i = -1;
   $dir1 = scandir(".");

   foreach($dir1 as $file) {
	if (is_dir("$file") && "$file" != "." && "$file" != "..") {
	    echo "<td width=155 align=center><a href=";
	    echo '"';
	    echo rawurlencode($file);
	    echo '"';
	    echo "><img src=/icons/dir.png border=0></a>\n";
	    echo "<p>$file</p></td>\n";
	    ++$i;
	    if (($i % $wide) == ($wide - 1)) echo "</tr><tr height=155>\n";
	    
	} elseif (preg_match("/(.*)\.jpe?g$/i", "$file", $matches) ||
	          preg_match("/(.*)\.png$/i", "$file", $matches) ||
	          preg_match("/(.*)\.gif$/i", "$file", $matches)) {
	    echo "<td width=155 align=center><a href=";
	    echo '"';
	    echo rawurlencode($file);
	    echo '"';
	    echo "><img src=\"thumbnail.php?";
	    echo rawurlencode($file);
		
		// border changed from 0 to 3 --  ptl
	    echo "\" border=3></a>\n";
		
		// print picture names -- ptl
		echo "<p>$matches[1]</p></td>\n";	
		//end changes

	    if (file_exists("$matches[1].txt")) {
		echo "<p>";
		print file_get_contents("$matches[1].txt");
		echo "</p>\n";
	    }
	    echo "</td>\n";
	    ++$i;
	    if (($i % $wide) == ($wide - 1)) echo "</tr><tr height=155>\n";
	}
   }

?>
</tr>
</table>
<!-- copyright added -- ptl -->
<br>
<hr>
<small><bold> Copyright 2006-<? print(Date("Y")); ?> Cactus Radio, Inc.</bold></small>
</center>
</body>
</html>
