Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function kategori(){
- if ($link = $_GET["url"]){
- // Kategoriyi bulalım
- $katbul = mysql_query("select * from kategoriler where kategori_sef_link='$link'");
- $katsay = mysql_num_rows($katbul);
- if ($katsay > 0){
- $katgoster = mysql_fetch_array($katbul);
- $katID = $katgoster["id"];
- $sayfa = $_GET["sayfa"];
- if ($sayfa=="" || !is_numeric($sayfa)){
- $sayfa = 1;
- $kacar = $GLOBALS["sayfa_limiti"];
- $ksayisi = mysql_num_rows(mysql_query("select id,kategori_id from konular where kategori_id ='$katID'"));
- $ssayisi = ceil($ksayisi/$kacar);
- $nereden = ($sayfa*$kacar)-$kacar ;
- if ($sayfa > $ssayisi){
- bilgi("Hata!","Böyle bir sayfa bulunamadı.");
- }else{
- $konubul = mysql_query("select * from konular where kategori_id ='$katID' order by id desc LIMIT $nereden,$kacar");
- while($konugoster = mysql_fetch_array($konubul)){
- extract($konugoster);
- $konu_basligi = stripslashes($konu_basligi);
- $konu_anasayfa = stripslashes($konu_anasayfa);
- $yazar2 = mysql_fetch_array(mysql_query("select id,kadi from uyeler where id='$ekleyen'"));
- $yazar = $yazar2["kadi"];
- // Konu Kategorisi Bul
- $kategori = $katgoster["kategori_adi"];
- // Konuya ait yorumları bul
- $yorumbul = mysql_query("select id,konuID from yorumlar where konuID='$id' && onay='1'");
- $yorumsayisi = mysql_num_rows($yorumbul);
- $link = $GLOBALS["site_adresi"].$konu_basligi_sef.".html";
- //$link = "index.php?git=konu&link=".$konu_basligi_sef;
- require ($GLOBALS["tema_adresi"]."/konu_anasayfa.php");
- } if ($ksayisi > $kacar){
- echo "<div class='sayfala'>";
- for($i = 1; $i <= $ssayisi; $i++){
- echo '<a href="/kategori/'.$katgoster["kategori_sef_link"].'/'.$i.'"';
- if ($sayfa == $i){
- echo "class='aktif'";
- }
- echo '>'.$i.'</a>';
- }
- echo "</div>";
- }
- }
- }
- }else{
- bilgi("Lütfen Dikkat!..","Böyle bir kategori mevcut değil ya da silinmiş olabilir.");
- header("Refresh:2; url=index.php");
- }
- }else{
- header("Location:index.php");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement