<?php
$dir = "./upfiles/x/";
$Name=md5($_GET['UserName']);
if (is_dir($dir)) {
   if ($dh = opendir($dir)) {
       while (($file = readdir($dh)) != false) {
       		if(filetype($dir . $file)=="file")
       		{
       			$byName=explode("_",$file);
				$PhotoCode=substr($byName[1],0,12);
				if($_GET['UserName']=="ALL")
       			{
       			$img='<li class="imgstyle"><a href="#"><img border=0 src="./upfiles/x/'.$file.'"  onClick="winopen(\''.$PhotoCode.'\');return false;"></a></li>'.$img;
       				continue;	
       			}
       			if($byName[0]==$Name)
       			$img='<li class="imgstyle"><a href="#"><img border=0 src="./upfiles/x/'.$file.'" onClick="ReturnValue(\'[PP'.$PhotoCode.']\');return false;"></a></li>'.$img;	
       		}
       }
       closedir($dh);
   }
}
?>
<style type=text/css>
body{font-size:9pt;margin:0px;scrollbar-3dlight-color:ffffff;scrollbar-darkshadow-color:ffffff;scrollbar-track-color:FFFFFF;scrollbar-arrow-color:ffffff;scrollbar-shadow-color:ffffff}
#flinkbox li{ margin:2px 3px 2px 4px;}
#flinkbox li {
	float: left;
	width: 76px;
	height: 58px;
	margin-top: 1px;
	margin-right: 1px;
	margin-bottom: 1px;
	margin-left: 1px;
}
#flinkbox li img {
	height: 58px;
	width: 76px;
}
.imgstyle a {
	border: 2px solid #E9E9E9;
	display: block;
}
.imgstyle a:hover {
	border: 2px solid #FF6600;
}
</style>
<div id="flinkbox">
		<?=$img?>
</div>
<script>
function winopen(PhotoCode)
{
window.open('viewphoto.php?file='+PhotoCode,'view','height=285,width=319,top=0,left=0')
}
function ReturnValue(v)
{
top.F.Content.value+=v;
}
</script>