tarihinde yayınlandı 1 Yorum

Klasör içindeki resimleri sayfa halinde gösterme

Klasör içindeki resimleri sayfa halinde gösterme (RESİM GALERİSİ)

php kod

[cc lang=”php”]
< table width=”410″ height=”710″ bgcolor=”#000000″ border=”0″
cellspacing=”8″ cellpadding=”8″ align=”center”>
< table width=”400″ height=”700″ bgcolor=”#f4f4f4″ border=”0″
cellspacing=”8″ cellpadding=”8″ align=”center”>
< td>
< center>
< ?php
# Resimleri cek
$dizin = “resim dizini(resim dosyası)”;//Resminizin Bulunduğu
Yolu Yazınız
$tutucu = opendir($dizin);
while($dosya = readdir($tutucu)){
if(is_file($dizin.”/”.$dosya))
$resim[] = $dosya;
}
closedir($tutucu);

# Ön bilgiler
$limit = 21; //Bir sayfada gösterilecek resim sayısı
$sf = $_GET[“sf”];
if($sf < 1) $sf = 1;
$toplam = count($resim);

# Bu bilgiler doğrultusunda
$kactan = ($sf-1) * $limit;
$kaca = ($kactan+$limit);
if($kaca > $toplam) $kaca = $toplam;

# $kactan başlayıp $kaca kadar resim bas
for($i=$kactan; $i < $kaca; $i++){
echo ”
< a href='”.$dizin.”/”.$resim[$i].”‘ target=’_blank’>
< img onContextMenu=’return false’ src='”.$dizin.”/”.$resim[$i].”‘
width=’100′ height=’100′ border=’0′>< /a>n”;
}
echo” < /br>< /br>< /br>”;
# Birden başlayıp sayfa sayısı kadar link bas
for($i=1; $i < $toplam / $limit; $i++){
if($sf == $i)
echo “$in”; else
echo “< a href=’resim.php?sf=$i’>$i< /a>n”;
}
?>
< /center>< tr>< /td>< /tr>< /table>
< tr>< /td>< /tr>< /table> [/cc]
—-
Önemli:
Resimlerinizin kopyalanmasının engelleyen kod: onContextMenu=’return false’
——————————-

Klasör içindeki resimleri sayfa halinde gösterme” üzerine 1 yorum

  1. Wonderful post and it’s definitly worth a comment from me. You’ve earned a loyal fan.

Yorumlar kapalı.