<?php

function photo_code($directory$photo_uri)
{
    if(
file_exists("$directory/$photo_uri"))
    {
        list(
$width$height) = GetImageSize("$directory/$photo_uri");
        
$width.="px";
        
$height.="px";

        print(
"<p><img src=\"$photo_uri\" style=\"width: $width; height: $height; border: 2px solid black; padding: 3px;\" alt=\"Photo $photo_uri\" /></p>\n");
        print(
"<p style=\"padding-bottom: 30px;\"><a href=\"?show=$photo_uri\" title=\"Unique page for this photo.\">$photo_uri</a></p>\n");
    }
}

if(isset(
$_GET["show"]))
{
    
$current_photo=$_GET["show"];
}


$dump_dir dir (".");
while(
$dumped_photo $dump_dir->read())
{
    
$extension substr(strrchr($dumped_photo,"."),1);
    if(
$extension=="jpg")
    {
        
$photos[]=$dumped_photo;
    }    
}
$this_dir=getcwd();
$dump_dir->close();
rsort($photos);
$path=explode("/"$this_dir);
$collection=$path[5];

    
$title 'Photo Dump ' $collection;
    
$description 'Dumped photographs on various topics.';             
    
$keywords 'photographs';         $created 'Dec. 2002';
    
$styles '
    
    #content { 
    background-color: #fff; 
    padding-top: 0px;
    }
    
    h1 {
    margin: 0px;
    }

    '
;
include(
$_SERVER['DOCUMENT_ROOT'] . "/inc.top");
?>


<!-- Dumped Photos Script first developed by Stephanie Booth (http://climbtothestars.org/). View original code and vague tutorial here: http://climbtothestars.org/coding/dumpedphotos/. If you try to make money out of this, you will roast in hell. Modify and redistribute as you wish as long as this notice remains. -->


<h1><a href="/dumps/" title="An index of the public galleries available here.">Dumped Photos</a>: <a href="/dumps/<?php print($collection); ?>/" title="Index for this photo collection."><?php print($collection); ?></a></h1>
<?php
if($current_photo=="list")
    {
?>
        <ul>
        <li><a href="?" title="View all photos.">ALL/TOUT</a></li>
        <?php

        
foreach($photos as $key => $photo)
        {
            print(
"<li><a href=\"?show=$photo\" title=\"View photo $photo.\">$photo</a></li>\n");
        }
        
?>

        </ul>

        <?php
    
}
    elseif(isset(
$current_photo))
    {
        
$dump_dir dir (".");
        do
        {
            
$this_one=$dump_dir->read();
        }
        while(
$this_one!=$current_photo);
        
        
$next_one=$dump_dir->read();
        
$dump_dir->close();
        print(
"<p style=\"text-align: right;\"><a href=\"?show=$next_one\" title=\"Next photograph.\">random photo &gt;&gt;&gt;</a></p>");
        
photo_code($this_dir$current_photo);
        print(
"<p><a href=\"?\" title=\"View all photos.\">all/toutes photos</a> || <a href=\"?show=list\" title=\"View text-only list of all photos.\">text only list</a></p>");
    }

else
{
        print(
"<p><a href=\"?show=list\" title=\"View text-only list of all photos.\">text only list</a></p>");
        foreach(
$photos as $key => $photo)
        {
            
photo_code($this_dir$photo);
        }

}
?>
<p>These photographs are dumped here "as is". They are not optimized, not sorted, and if they look low-quality, it might be because they have been taken with my <a href="http://www.orange.com/English/forwardthinking/spvsmartphone2.asp?bhcp=1" title="The Smartphone: fruit of collaboration between Orange and Microsoft. Fun, despite the inevitable bugs.">SPV (Smartphone)</a>.</p>

<p>If you are bothered by the publication of a photograph picturing you, just drop me a line and I will remove it.</p> 
<?php
include($_SERVER['DOCUMENT_ROOT'] . "/inc.bottom");
?>