sayfalama sorunsalı

meurglyse

New member
selam arkadaşlar. ne kdr pagination örnegi varsa hepsini inceledim fakat sonuç alamadım. en son yaptıgım sayfalamada sayfa numaraları çıkıyor fakat tüm mesajları gösteriyor.. 2 gündür harıl harıl inceliyorum forumları. sanırım henüz çok acemi oldugum için çözemedim.. altteki kodlara bakarak nerde hata yaptıgımı söylerseniz mut olurum.. şimdiden teşekkürler..

Kod:
<?
//session_start();
include("include/site_settings.php");
include("themes/".$site_settings['ifdate_theme']."/ifdate_header.php");
include_once ("include/frm.php");
include("include/site_replace.php");

mysql_query("UPDATE ifdate_forums_topics SET views=views+1 WHERE tid='".$_GET['tid']."'");
?>
<?
if ($_COOKIE['iFdate']=="Active"){
?>
<?php
if(!isset($_GET['page'])){
$page = 1; 
} else { 
$page = $_GET['page'];
}
			
$max_results = 10;
$from = (($page * $max_results) - $max_results);
					  
$get_guestbook = mysql_query("SELECT * FROM ifdate_forums_posts WHERE topic_id='".$_GET['tid']."' AND forum_id='".$_GET['fid']."' ORDER BY pid ASC LIMIT $from, $max_results");

if (mysql_num_rows($get_guestbook)==0){
} 

$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM ifdate_forums_posts WHERE topic_id='".$_GET['tid']."'"),0); 
$total_pages = ceil($total_results / $max_results); 
			
if($page > 1){ 
$prev = ($page - 1); 
echo " <a href=\"?fid=".$_GET['fid']."&tid=".$_GET['tid']."&page=$prev\" class=\"title_text\">önceki</a> "; 
} 
			
for($i = 1; $i <= $total_pages; $i++){ 
if(($page) == $i){ 
echo "$i "; 
} else { 
echo "<a href=\"?fid=".$_GET['fid']."&tid=".$_GET['tid']."&page=$i\" class=\"title_text\">$i</a> "; 
} 
} 
			
if($page < $total_pages){ 
$next = ($page + 1); 
echo "<a href=\"?fid=".$_GET['fid']."&tid=".$_GET['tid']."&page=$next\" class=\"title_text\">sonraki</a>"; 
} 
echo "</center>";
?>        <tr> 
    <td width="12" bgcolor="#FFFFFF"> </td>
    <td bgcolor="#FFFFFF">
<table width="100%" border="0" class="pages">
        <tr>
          <td height="62" colspan="4" align="center" class="main"><table width="100%" border="0" class="pages">
              <tr> 
                <td height="16"><hr noshade color="#f0f0f0"></td>
              </tr>
            </table>
            <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999" class="pages">
              <tr> 
                <td height="23" background="themes/<?=$site_settings['ifdate_theme'];?>/images/forums/001.gif"><table width="100%" border="0" class="pages">
                    <tr> 
                      <td height="22"><strong>nick: 
                        <?=$logged_in_;?>
                        <?=$logged_sig_;?>
                        </strong></td>
                    </tr>
                  </table></td>
              </tr>
            </table>
            <table width="100%" border="0" class="pages">
              <tr> 
                <td height="16"><hr noshade color="#f0f0f0"></td>
              </tr>
              <tr> 
                <td height="16"><a href="forums_index.php" class="pages">forum anasayfası</a> 
                  - <a href="forums_board.php?fid=<?=$_GET['fid'];?>" class="pages">
                  <?=$topic_name;?>
                  </a> -  
                  <?=$post_name;?></td>
              </tr>
              <tr> 
                <td height="30"><a href="forums_post.php?fid=<?=$_GET['fid'];?>"><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/forums/003.gif" width="80" height="20" border="0"></a></td>
              </tr>
            </table>
            <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" class="pages">
              <tr> 
                <td colspan="2" background="themes/<?=$site_settings['ifdate_theme'];?>/images/forums/001.gif"><table width="100%" border="0" class="pages">
                    <tr> 
                      <td width="30%" align="center"><strong>üye</strong></td>
                      <td width="70%" height="20" align="center"><strong>mesajlar</strong></td>
                    </tr>
                  </table></td>
              </tr>
              <?
		$v_p = mysql_query("SELECT * FROM ifdate_forums_posts WHERE topic_id='".$_GET['tid']."' AND forum_id='".$_GET['fid']."' ORDER BY pid ASC");
		while ($view_post = mysql_fetch_array($v_p)){
		//include_once("bbcode.php");
		$cleanPost = ifdate_code($view_post['post']);
		$post_info = getSqlRow("SELECT * FROM ifdate_users WHERE username='".$view_post['author_name']."' AND id='".$view_post['author_id']."'");
		?>
              <tr> 
                <td width="23%" valign="top" bgcolor="#F0F0F0"> <table width="100%" border="0" class="pages">
                    <tr> 
                      <td height="20"><B><a href="<?=$viewPost['author_name'];?>" class="pages"> 
                        <?=$view_post['author_name'];?>
                        </a></B></td>
                    </tr>
                    <tr> 
                      <td height="20"> 
                        <?
				//$post_info = getSqlRow("SELECT * FROM ifdate_users WHERE username='".$view_post['author_name']."' AND id='".$view_post['author_id']."'");
				$get_main_picture = getSqlRow("SELECT * FROM ifdate_pictures WHERE picture_username='".$view_post['author_name']."' AND picture_type='1' AND picture_status='1'");
				$get_picture = $get_main_picture['picture_path'];
				$get_username = $view_post['author_name'];
				if ($post_info['profile_picture']=="0"){
				echo "<img name=\"mainpic\" src=\"themes/ifdate_box/images/default_picture_80x80.gif\" border=\"1\" alt=\"$get_username\"  width=\"70\" height=\"70\">";
				} else {
				echo "<img name=\"mainpic\" src=\"".$get_picture."\" border=\"1\" alt=\"$get_username\" width=\"70\" height=\"70\">";
				}
				?>
                      </td>
                    </tr>
                    <tr> 
                      <td height="20">cevaplar: 
                        <?=$post_info['contact_msn'];?></td>
                    </tr>
                    <tr> 
                      <td height="20"><a href="<?=$viewPost['author_name'];?>"> 
                        </a>nerden:                        <?=$post_info['basic_country'];?></td>
                    </tr>
                </table></td>
                <td width="77%" height="176" valign="top" bgcolor="#F0F0F0"> <table width="100%" border="0" class="pages">
                    <tr> 
                      <td height="20">tarih : 
                        <?=$view_post['post_date'];?>
                        <hr noshade color="#CCCCCC"> </td>
                    </tr>
                    <tr> 
                      <td height="20">
                        <?=$cleanPost;?>
                      </td>
                    </tr>
                    <tr> 
                      <td height="20"><hr noshade color="#CCCCCC"> 
                        <?=$post_info['contact_icq'];?>
                      </td>
                    </tr>
                </table></td>
              </tr>
              <? } ?>
            </table>
            <table width="100%" border="0" class="pages">
              <tr> 
                <td height="30"><p><a href="forums_post.php?fid=<?=$_GET['fid'];?>"><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/forums/003.gif" width="80" height="20" border="0"></a></p>
                <p> </p></td>
              </tr>
			                <form name="reply" onsubmit="return validateForm()" action="forums_reply.php?fid=<?=$_GET['fid'];?>&tid=<?=$_GET['tid'];?>" method="post">
                <tr> 
                  <td colspan="2" background="themes/<?=$site_settings['ifdate_theme'];?>/images/forums/001.gif"><table width="100%" border="0" class="pages">
                      <tr> 
                        <td height="20"><strong>hızlı cevap </strong></td>
                      </tr>
                    </table></td>
                </tr>

                <tr> 
                  <td height="20" colspan="2" bgcolor="#F0F0F0"><table width="100%" border="0" class="pages">
                      <tr> 
                        <td></td>
                      </tr>
                    </table></td>
                </tr>
                <tr> 
                  <td width="16%" height="16" align="center"><table width="100%" border="0" class="pages">
                      <tr> 
                        <td><strong>başlık :</strong></td>
                      </tr>
                    </table></td>
                  <td width="84%"><table width="100%" border="0" class="pages">
                      <tr> 
                        <td><? echo getSqlField("SELECT title FROM ifdate_forums_topics WHERE tid='".$_GET['tid']."'",'title');?></td>
                      </tr>
                    </table></td>
                </tr>
                <tr> 
                  <td height="16" align="center" valign="top"> <table width="100%" border="0" class="pages">
                      <tr> 
                        <td><strong>mesaj :</strong></td>
                      </tr>
                    </table></td>
                  <td><table width="100%" border="0" class="pages">
                      <tr> 
                        <td width="61%"><input name="button" type="button" class="forum_buttons" style="cursor: pointer; cursor: hand;" onClick="document.getElementById('message').value+='[B][/B]'" value="B" alt="Bold"> 
                          <input name="button2" type="button" class="forum_buttons" style="cursor: pointer; cursor: hand;" onClick="document.getElementById('message').value+='[I][/I]'" value="I" alt="Italic"> 
                          <input name="button2" type="button" class="forum_buttons" style="cursor: pointer; cursor: hand;" onClick="document.getElementById('message').value+='[U][/U]'" value="U" alt="Underline"> 
                            <strong>yazı rengi:</strong>   
                          <select name="fontcolour" class="pages" onChange="document.getElementById('message').value+=this.value;">
                            <option style="color:black;" value="[COLOR=Black][/COLOR]" alt="Black">siyah</option>
                            <option style="color:red;" value="[COLOR=Red][/COLOR]" alt="Red">kırmızı</option>
                            <option style="color:blue;" value="[COLOR=Blue][/COLOR]" alt="Blue">mavi</option>
                            <option style="color:green;" value="[COLOR=Green][/COLOR]" alt="Green">yeşil</option>
                            <option style="color:CB4B90;" value="[COLOR=Pink][/COLOR]" alt="Pink">pembe</option>
                            <option style="color:purple;" value="[COLOR=Purple][/COLOR]" alt="Purple">mor</option>
                            <option style="color:yellow;" value="[COLOR=Yellow][/COLOR]" alt="Yellow">sarı</option>
                          </select></td>
                        <td width="39%"> </td>
                      </tr>
                      <tr> 
                        <td><textarea name="message" class="forum_box" value="<?=$_POST['description'];?>"></textarea></td>
                        <td><table width="100%" border="0" cellpadding="1" cellspacing="1" class="title_text">
                          <tr>
                            <td width="3%"><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/001.gif" onclick="document.getElementById('message').value+=':D'" style="cursor: pointer; cursor: hand;" /></td>
                            <td width="30%">:D</td>
                            <td width="4%"><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/006.gif" onclick="document.getElementById('message').value+=':|'" style="cursor: pointer; cursor: hand;" /></td>
                            <td width="30%">:|</td>
                            <td width="3%"><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/011.gif" onclick="document.getElementById('message').value+=':roll:'" style="cursor: pointer; cursor: hand;" /></td>
                            <td width="30%">:roll:</td>
                          </tr>
                          <tr>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/rty.gif" onclick="document.getElementById('message').value+=':rty'" style="cursor: pointer; cursor: hand;" /></td>
                            <td>:rty</td>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/yamyam.gif" onclick="document.getElementById('message').value+=':yam'" style="cursor: pointer; cursor: hand;" /></td>
                            <td>:yam</td>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/asa.gif" onclick="document.getElementById('message').value+=':asa'" style="cursor: pointer; cursor: hand;" /></td>
                            <td>:asa</td>
                          </tr>
                          <tr>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/002.gif" onclick="document.getElementById('message').value+=':)'" style="cursor: pointer; cursor: hand;" /></td>
                            <td>:)</td>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/007.gif" onclick="document.getElementById('message').value+=':S'" style="cursor: pointer; cursor: hand;" /></td>
                            <td>:S</td>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/012.gif" onclick="document.getElementById('message').value+=':oO:'" style="cursor: pointer; cursor: hand;" /></td>
                            <td>:oO:</td>
                          </tr>
                          <tr>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/003.gif" onclick="document.getElementById('message').value+=':A'" style="cursor: pointer; cursor: hand;" /></td>
                            <td>:A</td>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/008.gif" onclick="document.getElementById('message').value+=':('" style="cursor: pointer; cursor: hand;" /></td>
                            <td>:(</td>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/013.gif" onclick="document.getElementById('message').value+=':Y:'" style="cursor: pointer; cursor: hand;" /></td>
                            <td>:Y</td>
                          </tr>
                          <tr>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/004.gif" onclick="document.getElementById('message').value+=':P'" style="cursor: pointer; cursor: hand;" /></td>
                            <td>:P</td>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/009.gif" onclick="document.getElementById('message').value+=':huh:'" style="cursor: pointer; cursor: hand;" /></td>
                            <td>:huh:</td>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/014.gif" onclick="document.getElementById('message').value+=':W'" style="cursor: pointer; cursor: hand;" /></td>
                            <td>:W</td>
                          </tr>
                          <tr>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/005.gif" onclick="document.getElementById('message').value+=':cool:'" style="cursor: pointer; cursor: hand;" /></td>
                            <td>:cool:</td>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/010.gif" onclick="document.getElementById('message').value+=':oo'" style="cursor: pointer; cursor: hand;" /></td>
                            <td>:oo:</td>
                            <td><img src="themes/<?=$site_settings['ifdate_theme'];?>/images/smilies/015.gif" onclick="document.getElementById('message').value+=';)'" style="cursor: pointer; cursor: hand;" /></td>
                            <td>;)</td>
                          </tr>
                          
                        </table></td>
                      </tr>
                    </table></td>
                </tr>
                <tr> 
                  <td height="16" align="center"> </td>
                  <td><table width="100%" border="0" class="pages">
                      <tr> 
                        <td><input name="post_reply" type="submit" value="tamamdır"></td>
                      </tr>
                    </table></td>
                </tr>
              </form>

              <tr> 
                <td><hr noshade color="#f0f0f0"></td>
              </tr>
            </table></td>
        </tr>

		<?php }

else { ?>


        <tr> 
          <td height="15" colspan="2"> </td>
        </tr>        <tr> 
          <td height="15" colspan="2"> </td>
        </tr>        <tr> 
          <td height="15" colspan="2" align="center">bu sayfa size göre degil</td>
        </tr>
        <tr> 
          <td height="15" colspan="2"> </td>
        </tr> 
        <tr> 
          <td height="15" colspan="2"> </td>
        </tr> 
<?php } ?>
	  <?php include("themes/".$site_settings['ifdate_theme']."/ifdate_footer.php");?>
 

HTML

Üst