<?php $checkthank = mysql_query('SELECT COUNT(*) FROM `soo_forum_thank` WHERE `userthank` = "' . $user_id . '" and `topic` = "' . $res['id'] . '" and `sid` = "' . $res['sid'] . '" and `user` = "' . $res['user_id'] . '"');
if ($user_id && $user_id != $res['user_id'] && (mysql_result($checkthank, 0) < 1)) {
echo'&nbsp;<a id="btn" href="../soo/?mod=forum&amp;sid='. $sid .'&amp;id=' . $id . '&amp;thanks=' . $res['id'] . '&amp;user=' . $res['user_id'] . '&amp;start=' . $start . '&amp;thank#thanksyou">Thank'; echo '</a>';
}
?>