• 18-09-2009, 04:19:06
    #1
    Kimlik doğrulama veya yönetimden onay bekliyor.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Arşiv</title>
    </head><body><table width="900" bgcolor="#f4f4f4" border="0" cellspacing="8" cellpadding="8" align="center"><tr><td align="center">
    <?php
    error_reporting(E_ALL ^ E_NOTICE);
    $dizin = "../";
    $tutucu = opendir($dizin);
    while($dosya = readdir($tutucu)){
    if(is_file($dizin."/".$dosya))
    $resim[] = $dosya;
    }
    closedir($tutucu);
    $limit = 20;
    $sf = $_GET["sf"];
    $toplam = count($resim);
    if($sf < 1) $sf = 1;
    $kactan = ($sf-1) * $limit;
    $kaca = ($kactan+$limit);
    if($kaca > $toplam) $kaca = $toplam;
    for($i=$kactan; $i < $kaca; $i++){
    echo '<a href="'.$dizin.'/'.$resim[$i].'" target="_blank"><img src="'.$dizin.'/'.$resim[$i].'" border="0" /></a>';
    }
    echo "<br /><br />";
    for($i=1; $i < $toplam / $limit; $i++){
    if($sf == $i){ echo "$i"; }
    else {echo "<a href='index.php?sf=$i' align='center'>$i</a>"; }
    } echo "</tr></table>";
    ?>
    </body></html>
    Arkadaşlar bu koda sağlı sollu veri sıralama kodunu entegre edemedim.
    Tam nerelere ekliyeceğimi bulamadım yardımcı olursanız çok sevinirim.:S
  • 18-09-2009, 04:55:13
    #2
    Mantığı aşağıdaki şekildedir. Bunu kendinize göre değiştirebilirsiniz.
    <table border="5" align="center">
    <?php
    $a = explode(' ','a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a');
    foreach($a as $i => $b){
    echo $i % 2 == '0' ? '<tr><td>'.$a[$i].'</td>' : '<td>'.$a[$i].'</td></tr>'."\n";
    }
    ?>
    </table>
  • 18-09-2009, 05:21:40
    #3
    bunu nasıl entegre ederim acaba o kodlara?

    if ($r % 4 == 0 )
    {
    echo "</tr><tr>";
    $r=0;
    }
  • 19-09-2009, 19:01:34
    #4
    Güncel arkadaşlar.
  • 19-09-2009, 20:15:14
    #5
    Üyeliği durduruldu
    dostum while döngüsünün dışına en son tr tagından sonra ekle tablo koduna
    if ($r % 4 == 0 ) 
    { 
    echo "</tr><tr>"; 
    $r=0; 
    }