PHP:
echo '<div class="phdr"><b>tên phdr</b></div> ';
$tong2 = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='t' AND `refid`='xxxx'" . ($rights >= 7 ? '' : " AND `close`!='1'")), 0);
$req = mysql_query("SELECT * FROM `forum` WHERE `type`='t'" . ($rights >= 7 ? '' : " AND `close`!='1'") . " AND `refid`='xxxx' ORDER BY `id` DESC LIMIT $start, $kmess");
while($row = mysql_fetch_assoc($req)){
$bv = mysql_result(mysql_query("select `text` from `forum` where `type` = 'm' && `id`-1 = '".$row['id']."' limit 5"),0);
echo '<div class="list1"> <a href="/' . $row['id'] . ($cpg > 1 && $set_forum['upfp'] && $set_forum['postclip'] ? '-clip-' : '') . ($set_forum['upfp'] && $cpg > 1 ? '-p' . $cpg : '/'.functions::tuoitrevn($row["text"]).'.html') . '">' . tags($row['text']) . '</a></div>';
}
if ($tong2 > $kmess){echo '<div class="topmenu" style="text-align:center;" >' . functions::display_pagination('index.php?', $start, $tong2, $kmess) . '</div>';}