Return to Snippet

Revision: 14048
at May 17, 2009 08:39 by pashky


Initial Code
<? $title = htmlspecialchars("Guy Fawkes Nights at EBI Campus & Cambridge 4-5.11.2008"); ?>
<html>
<head>
<title><?= $title ?></title>
<style type="text/css">
body { background: #666666;color: #cccccc;font-family: tahoma, verdana, sans-serif;padding: 30px; }
img { border: 1px solid #cccccc;margin-right: 30px;vertical-align:top; }
h1 { font-size: 30pt;font-weight: bold;margin-bottom:50px; }
div { font-size: 10pt; }
span { font-size: 30pt;font-weight: bold;font-family: impact,tahoma,sans-serif;color: #888888; }
a:link,a:hover,a:active,a:visited { color: #cccccc; text-decoration:underline}
</style>
</head>
<body>
<h1><?= $title ?></h1>
<p><a href="../">back to list</a></p>
<?
// just a comment to test and remove

$cwd = opendir('.');
if(!$cwd) die("can't open dir!");
	
$desc = array();
if(file_exists('descript.ion'))
	foreach(file('descript.ion') as $line)
		if(preg_match('/^(\\S+)\\s+(.*?)\\s*$/', $line, $d))
			$desc[$d[1]] = $d[2];
	
$images = array();
while($file = readdir($cwd))
{
	if(preg_match('/\\.(jpe?g|gif|png)$/i', $file) && is_readable($file))
	{
		list($width, $height, $type) = getimagesize($file);
		if($width && $height)
		{
			$images[$file] = array($width, $height);
		}
	}
}

$names = array_keys($images);
sort($names);
$k = 0;
foreach($names as $img)
{
	$i = $images[$img];
	?>
        <p><img src="<?=$img?>" width="<?=$i[0]?>" height="<?=$i[1]?>" alt=""><span><?=++$k?></span><div><?=htmlspecialchars($desc[$img])?></div></p>
	<?
}
?>
</body>
</html>

Initial URL


Initial Description


Initial Title
Image directory index

Initial Tags
image, web

Initial Language
PHP