9 || $tid > 0 && $fid > 0)
message($lang_common['Bad request']);
$result = $db->query('SELECT count(*) FROM '.$db->prefix.'accepted WHERE topic_id = '.$tid) or error('Doh', __FILE__, __LINE__, $db->error());
$count = $db->result($result);
if($count > 0)
{
echo '
';
} else {
$db->query('INSERT INTO '.$db->prefix.'accepted (topic_id, accepted_by, username, time) VALUES(
\''.$tid.'\',
\''.$pun_user['id'].'\',
\''.addslashes($pun_user['username']).'\',
\''.time().'\'
)') or error('Oh no...', __FILE__, __LINE__, $db->error());
}
?>