if(is_file('config.cfg.php'))
{
require 'config.cfg.php';
}
else
{
die('Error, no config file');
}
if(!is_dir($_images_dir_))
{
die('Error, no image directory');
}
?>
Northern Virginia Gun Club
|
|
$time_start = microtime(true);
$noimage = 0;
if ($dh = opendir($_images_dir_))
{
while (($f = readdir($dh)) !== false)
{
if((substr(strtolower($f),-3) == 'jpg') || (substr(strtolower($f),-3) == 'jpg'))
{
$imageinfo = getimagesize($_images_dir_.$f);
$width = $imageinfo[0];
$height = $imageinfo[1];
$size = round(filesize($_images_dir_.$f)/1024,1).' KB';
$noimage++;
$images[] = array('filename' => $f, 'width' => $width, 'height' => $height, 'size' => $size);
array_multisort($images, $_sort_, SORT_REGULAR);
}
}
closedir($dh);
}
if($noimage)
{
if($_GET["img"] != '')
{
echo " ".$_page_title_." Image Count = ( ".count($images)." )
| | ";
if($images[$_GET["img"]][filename] != '')
{
echo "";
echo "";
echo "";
if($_GET["img"])
{
$_no_ = ceil(($_GET["img"]+1)/$_no_pics_per_page_);
}
else
{
$_no_ = 1;
}
if($_GET["img"] == 0)
{
$side = ' up ';
$side = $side.'next >> ';
}
else
{
if($_GET["img"] == ($noimage-1))
{
$side = '<< prev ';
$side = $side.'up ';
}
else
{
$side = '<< prev ';
$side = $side.'up ';
$side = $side.'next >> ';
}
}
echo $side.''.$side;
echo " | ";
echo " ";
echo " ";
}
}
else
{
echo " |
".$_page_title_." Image Count = ( ".count($images)." )
|
|
";
if($noimage > $_no_pics_per_page_)
{
$norows = ceil($_no_pics_per_page_/$_no_cols_);
}
else
{
$norows = ceil($noimage/$_no_cols_);
$nopos = ceil($noimage/$_no_pics_per_page_);
}
if($_GET["no"] == "")
{
$no = 1;
}
else
{
$no = $_GET["no"];
}
$index=abs($no-1)*$_no_pics_per_page_;
if(($noimage-$index)<$_no_pics_per_page_)
{
$norows= ceil(($noimage-$index)/$_no_cols_);
}
echo "";
for($a = 1;$a<=$norows;$a++)
{
echo "";
for($b = 1;$b<=$_no_cols_;$b++)
{
if($images[$index][filename] != '')
{
echo ' | ';
$index++;
}
else
{
echo ' | ';
}
}
echo "
";
}
echo "
";
echo "";
echo "";
if($nopos>1)
{
echo "";
for($i=1;$i<=$nopos;$i++)
{
if($i == $no)
{
echo ''.$i.' ';
}
else
{
echo ''.$i.' ';
}
}
echo "
";
}
}
}
else
{
die("No images in directory");
}
$time_end = microtime(true);
$time = $time_end - $time_start;
?>
|
|
© 2005-2006 Northern Virginia Gun Club • All Rights Reserved • Privacy Policy |
|