може ли да направите странициране на тези коментари
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1251">
<tr>
<td class=''>
<hr width='595' size='1' color='#dadada' >
<form action="" method="post">
Име:
<br />
<input type="text" name="name" id="name" maxlength="20" size="17"><br />
Коментар:<br>
<textarea name="comment" cols="45" rows="4" class='textarea' id="m"></textarea>
<br>
<br>
<input name="submitcomment" type="submit" value="Изпрати">
<input name="submit" type="reset" value="Изчисти">
<br>
<?php
include 'conf.php';
$idt = htmlspecialchars($_GET['id']);
$idt = htmlspecialchars($_GET['id']);
$sql_query = mysql_query("SELECT * FROM `news` WHERE id='$idt'") or die(mysqlerror());
$broi=mysql_num_rows($sql_query);
if ($broi=="0")
{
echo "Напиши първият коментар";
}
else
{
while ($row = mysql_fetch_array($sql_query))
{
$active = $row['active'];
if ($active == "0")
{
echo "Неможе да пишете коментари";
?>
<?php
}
else
if ($active == "1")
{
$id = $_GET['id'];
if ($_POST['submitcomment'])
{
if ($_POST[name] == null)
{
echo "Не сте написали автор на коментара.<br>";
}
else
{
if ($_POST[comment] == null)
{
echo "Не сте написали коментара.<br>";
}
else
{
$sel = mysql_query("SELECT * from comment ORDER by id desc limit 1");
$fetch = mysql_fetch_array($sel);
$kom = $fetch['comment'];
if ($kom == $_POST['comment'])
{
echo "Коментара е като предишния";
}
else
{
$date = date("d.m.y H:i");
$time = time();
$sql = mysql_query("INSERT INTO comment (id, news, nick, comment, comtoday, date) VALUES (NULL, '$id', '$_POST[name]', '$_POST[comment]', '$time', '$date')") or
die(mysql_error());
echo "Успешно добавен коментар";
}
}
}
}
}
else
{
$errmsg = mysql_error();
echo "$errmsg";
}
echo "<form><br>";
$query = mysql_query("SELECT * FROM `comment` WHERE `news`='$id' ORDER BY id DESC") or
die(mysql_error());
while ($raw = mysql_fetch_array($query))
{
$comment = $raw['comment'];
//Zabraneni Dumi
$comment = str_replace("pedal", "<b><font color='cc0000'>...</font></b>", "$comment");
$comment = str_replace("sex", "<b><font color='cc0000'>...</font></b>", "$comment");
$comment = str_replace("kopele", "<b><font color='cc0000'>...</font></b>", "$comment");
$comment = str_replace("umri", "<b><font color='cc0000'>...</font></b>", "$comment");
$comment = str_replace("duhai", "<b><font color='cc0000'>...</font></b>", "$comment");
//Do tuk
echo "<tr><td>
<div style='width: 402px; height: 27px; background: #eeeeee;'> ";
echo "От: <b>$raw[nick] </b> $raw[date] </div>";
// Simvoli na nov red
$comment = "$comment";
$comment = wordwrap($comment, 65, "<br />", true);
//
echo "<span class=\"style2\"></span>
<div style='width: 400px; border: 1px solid #cccccc;'>
$comment
<br /><br />
</div><br /></td>
</tr>";
}
}
}
?>