Ara :
HOME
ASP
PHP
JAVASCRIPT
C#
Add Code
Turkish
ASP Code Samples
PHP Code Samples
JavaScript Code Samples
C# Code Samples
PHP Code Sample
PHP Beautiful Image Gallery Example
This image gallery exampe shows all images in the selected folder. You can adjust your image gallery by changing variables in line 1-2 and 3.
// Author: Mian Shafiq-ur-Rehman $dir = "images/"; // Resimlerin bulunduÄ?u klasör $re = "/\.(jpg|gif|psd)$/"; // Resim türleri $inOneRow = 5; // Bir satırda kaç resim görüntülenecek. ?> function popup_window($imgPath) { if(file_exists($imgPath)) { $size= @getimagesize( $imgPath ); $width=$size[0]; $height=$size[1]; $width = ($width < 200 ? 250 : ($width + 50)); $height = ($height < 300 ? 350 : ($height + 50)); $popup= "
"; return $popup; } } /* Resimler listeleniyor ve tıklandıÄ?ı zaman pop-up penceresinde orjinal boyutunda gözüküyor. */ if(is_dir($dir)) { $allFiles = opendir($dir); while ($file = readdir($allFiles)) { if(!is_dir($dir.'/'.$file)) { if (preg_match($re,strtolower($file))) { $thumbs[] = popup_window($dir.'/'.$file); } } } closedir($allFiles); } $totalThumbs = count($thumbs); ?>
Image Gallery
Resim Galerisi
$j=0; for ($i=0; $i<$totalThumbs; $i++) { if($i == $j) { $j+=$inOneRow; echo "
"; } ?>
echo $thumbs[$i]?>
echo "Resim " . ($i+1)?>
} ?>
Added By : Administrator
Back to PHP Code Samples
email :
info@kodornekleri.com