//te bilzhu apraksti
$apraksti['DSC00001.JPG'] = 'Vidzemes height';
$apraksti['DSC00002.JPG'] = '4 elks on edge of a forest';
$apraksti['DSC00003.JPG'] = $apraksti['DSC00002.JPG'] ;
$apraksti['DSC00004.JPG'] = 'The highest hill in Latvia - Gaiziņkalns';
$apraksti['DSC00010.JPG'] = 'Vidzemes height';
$apraksti['DSC00011.JPG'] = $apraksti['DSC00010.JPG'];
$apraksti['DSC00012.JPG'] = 'Mailes, the center of middle distance competition';
$apraksti['DSC00013.JPG'] = $apraksti['DSC00012.JPG'];
$apraksti['DSC00014.JPG'] = $apraksti['DSC00012.JPG'];
$apraksti['DSC00015.JPG'] = $apraksti['DSC00012.JPG'];
$apraksti['DSC00017.JPG'] = '2005 World bronze medalist Ilmārs Bricis training in Mailes one week before world championship';
$apraksti['DSC00018.JPG'] = $apraksti['DSC00017.JPG'];
$apraksti['DSC00022.JPG'] = 'Vietalva`s terrain';
$apraksti['DSC00025.JPG'] = $apraksti['DSC00025.JPG'];
$apraksti['DSC00031.JPG'] = 'Reku kalns - accomodation place';
$apraksti['DSC00032.JPG'] = $apraksti['DSC00031.JPG'];
$apraksti['DSC00033.JPG'] = 'Relay and sprint competition center in Smeceres sils';
$apraksti['DSC00034.JPG'] = $apraksti['DSC00031.JPG'];
$apraksti['DSC00035.JPG'] = $apraksti['DSC00031.JPG'];
//te beidzas bilzhu apraksti
// spradzamy czy mamy konfig
if(is_file('config.cfg.php'))
require 'config.cfg.php';
else
die('Error, no config file');
//sprawdzamy czy mamy katalog ze zdjeciami
if(!is_dir($_images_dir_))
die('Error, no image directory');
$time_start = microtime(true);
//liczymy zdjecia (jpg i gif)
$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 ' '.$images[$_GET["img"]][filename].' ';
if($images[$_GET["img"]][filename] != '')
{
if($_GET["img"])
$_no_ = ceil(($_GET["img"]+1)/$_no_pics_per_page_);
else
$_no_ = 1;
if($_GET["img"] == 0)
$side = 'up next >> ';
elseif($_GET["img"] == ($noimage-1))
$side = '<< prev up ';
else
$side = '<< prev up next >> ';
echo $side.' '.$side.'
';
}
}
else
{
// echo $noimage.' '.print_r($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_);
// echo $nopos;
echo '
';
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_);
for($a = 1;$a<=$norows;$a++)
{
echo '
';
for($b = 1;$b<=$_no_cols_;$b++)
{
if($images[$index][filename] != '')
{
echo '
';
if($_filename_)
$nosaukums = $images[$index][filename];
if (!$apraksti[$nosaukums]) {
echo ''.$images[$index][filename].'
';
}
else {
echo ''.$apraksti [$nosaukums] .'
';
}
echo ' | ';
$index++;
}
else
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;
?>
|