Use this:
Code:
<?php
$getComments = dbquery("SELECT * FROM site_news_comments WHERE article='" . $news_article_id . "'");
$page = 0;
if(isset($_GET['page']))
$count = mysql_num_rows($getComments);
$page = abs((int) $_GET['page']);
$min_comments = $page * 5;
$max_comments = $min_comments + 7;
$getComments = dbquery("SELECT * FROM site_news_comments WHERE article = '" . $news_article_id . "' ORDER BY id ASC LIMIT $min_comments, $max_comments");
?>
<div class="habblet-container ">
<div class="cbb clearfix notitle ">
<div id="article-wrapper"><h2>Comments (<?php echo mysql_num_rows($getComments); ?>)</h2>
<div class="article-meta"></div>
<div class="article-body">
<?php
if ($page == 1)
{
echo "First ";
}
else
{
echo "<a href='http://habjo.in/articles?id=" . $news_article_id . "&page=" . 1 . "'>First</a> ";
}
for ($i = 1; $i <= $pages; $i++)
{
if (($page + 4) >= $i && ($page - 4) <= $i)
{
if ($i != $page)
{
echo'<a name="pages" href="http://habjo.in/articles?id=' . $news_article_id . '&page='.$i.'">'.$i.'</a> ';
}
else
{
echo "<b>" . $i . "</b> ";
}
}
}
if ($page == $pages)
{
echo "Last";
}
else
{
echo "<a href='http://habjo.in/article.php?id=" . $news_article_id . "&page=" . $pages . "'>Last</a>";
}
if(mysql_num_rows($getComments) == 0){
echo 'Sorry, er zijn nog geen Reacties geplaatst!';
}else{
echo '<table width="528px">';
while($Comments = mysql_fetch_array($getComments)){
$getUserInfo = mysql_query("SELECT * FROM users WHERE id = '".$Comments['userid']."'");
$userInfo = mysql_fetch_array($getUserInfo);
echo '
<tr>
<td width="90px" valign="top">
<div style="float:left"><img src="http://habbo.nl/habbo-imaging/avatarimage?figure='.$userInfo['look'].'&size=b&direction=2&head_direction=3&gesture=sml&size=s"></div>
';
if($userInfo['rank'] > 8){
echo '<div style="position: absolute; z-index:1"><img
src="http://127.0.0.1/swfs/c_images/album1584/AD1.gif"></div>';
}
echo '
</td>
<td width="427px" valign="top">
<strong>RE: %news_article_title%</strong><br /><br />'.$Comments['comment'].'
</td>
</tr>
<tr>
<td width="90px" valign="top">
</td>
<td width="427px" align="right">
<i>Posted by: <strong><a href="#">'.$userInfo['username'].'</a></strong> On '.$Comments
['posted_on'].'</i><br /><br />
</td>
</tr>';
}
echo '</table>';
}
?>