All pastes #959275 Raw Edit

Stuff

public text v1 · immutable
#959275 ·published 2008-03-27 09:36 UTC
rendered paste body
function sayfala($lt) {
   global $deger;
   $sayfz	= intval($_GET['sayfa']);
   $goster  = "6";
	$sx = mysql_query("select count(resimID) as toplam from resimler where kategoriseo='$deger' and onay='1'");
	$sq = mysql_fetch_assoc($sx);
    $topx = $sq[toplam];
	$toplam	= ceil(($topx / $lt));
  // sayfa 1'i yazdir
  if($lt > $topx) {
  echo '<span style=\'font-family:Verdana; font-size:10px; font-weight:bold; color:#000000;\'>1</span>';
  } 
  else   {
  if($sayfz==1) {
  echo '<span style=\'font-family:Verdana; font-size:10px; font-weight:bold; color:#000000;\'>1</span> ';
  } else {
  echo '<span style=\'font-family:Verdana; font-size:10px; font-weight:bold; color:#000000;\'>1</span> ';
  // "..." veya direkt 2
  if($sayfz-$goster > 2) {
    echo "... ";
    $i = $sayfz-$goster ;
  } else {
    $i = 2;
  } 

  // +/- $x sayfalari yazdir
  for($i; $i<=$sayfz+$goster; $i++) {
    if($i==$sayfz) {
   echo '<span style=\'font-family:Verdana; font-size:10px; font-weight:bold; color:#000000;\'><b>'.$i.'</b></span> ';
	} else {
   echo '<a href="http://www.salgit.com/'.$deger.'/'.$i.'.htm" style=\'font-family:Verdana; font-size:10px; font-weight:bold; color:#000000;\'>'.$i.'</a> ';
   }
    if($i==$toplam) break;
  }
  // "..." veya son sayfa
  if($sayfz+$goster < $toplam-1) {
    echo "... ";
    echo '<a href="http://www.salgit.com/'.$deger.'/'.$toplam.'.htm" style=\'font-family:Verdana; font-size:10px; font-weight:bold; color:#000000;\'>'.$toplam.'</a> ';
  } elseif($sayfz+$goster == $toplam-1) {
    echo '<a href="http://www.salgit.com/'.$deger.'/'.$toplam.'.htm" style=\'font-family:Verdana; font-size:10px; font-weight:bold; color:#000000;\'>'.$toplam.'</a> ';
  }
  }
}
}