<?
$aa = $db->query("SELECT COUNT(*) from `forum_thank` where `topic`='" . $res["id"] . "'")->fetchColumn();

$bb = $db->query("select * from `forum_thank` where `topic` = '" . $res['id'] . "'");

$thongke = $bb->fetch();
$idthongke=trim($_GET['idthongke']);

if($systemUser->isValid()){
if($aa > 0){
echo '<br/><table width="100%" cellpadding="0" cellspacing="0"><tr><td width="auto"></td><td width="auto" align="right">';
echo '<b>Thank :</b> ';
$cc = $db->query("select * from `forum_thank` where `topic` = '" . $res['id'] . "'");


while ($bb = $cc->fetch()){
{

$dentv= $db->query('SELECT * FROM `users` WHERE `id` = "'.$bb['userthank'].'"')->fetch();
echo '<a href="'.$config['homeurl'].'/profile/?user='.$bb['userthank'].'">'.$dentv['name'].'</a>, ';
}
++$f;
}
echo '</td></tr></table>';
}
}
echo '<br/>';
?>
