Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. $dizin = "images/galeri/"; // resminizin bulunduğu yolu yazınız örn: " klasor/ "  
  2. $tutucu = opendir($dizin); // dizin aç  
  3. while($dosya = readdir($tutucu)){  
  4. if(is_file($dizin.$dosya))  
  5. $resim[] = $dosya;  
  6. }  
  7. closedir($tutucu);  
  8.  
  9. // ön bilgiler  
  10. $limit = 8; // sayfada gösterilecek resim sayısı  
  11. $sf = @$_GET["sf"]; // get metodu ile sayfa numarasını alma // get başındaki '@' işareti sayfa numarası yok ise hata vermesini önler  
  12. if($sf < 1) $sf = 1;  
  13. $toplam = count($resim); // toplam resim sayısı  
  14.  
  15. // bu bilgiler doğrultusunda sayfa ayarları  
  16. $kactan = ($sf-1) * $limit;  
  17. $kaca = ($kactan+$limit);  
  18. if($kaca > $toplam) $kaca = $toplam;  
  19.  
  20. // $kactan başlayıp $kaca kadar resim basar  
  21. for($i=$kactan; $i < $kaca; $i++){ ?>
  22. <li>  
  23. <a href="<?php echo $dizin.$resim[$i]; ?>" rel='tip1'><img  src="<?php echo $dizin.$resim[$i]; ?>" width="50" height="50"> </a></li>  
  24. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement