<?
if ( $them['close'] == 1 )
msg('Тема закрыта для обсуждения');

err();
aut();

echo '
<div class="p_t">
Спасибо сказали:
</div>';


$q = mysql_query("
select *,
( select `nick` from `user` where `id`=`forum_thanks`.`uid` limit 1 ) `nick`
 from `forum_thanks` where `topic`='".$them['id']."';");

$users = array();
 
while ( $data = mysql_fetch_assoc($q) )
if ( !empty($data['nick']) ) $users[] = '<a href="/info.php?id='.$data['uid'].'">'.$data['nick'].'</a>';


echo '<div class="p_m">'.implode(', ', $users).'</div>';


echo '<br /><a href="/forum/'.$forum['id'].'/'.$razdel['id'].'/'.$them['id'].'/">Назад</a><br />';
if (isset($user) && ($ank2['level']<$user['level'] || $user['level']==4 || $ank2['id']==$user['id']) && isset($_GET['act']) && $_GET['act']=='post_delete'){}
elseif (isset($user) && ($them['close']==0 && isset($access['for_p_cr']) || $them['close']==1 && isset($access['for_p_cr2'])))
{

if ( mysql_fetch_assoc(mysql_query("select * from `forum_thanks` where `topic`='".$them['id']."' and `uid`='".$_SESSION['id_user']."' limit 1;")) == false && $ank2['id'] != $user['id'] )
echo '
<form action="/forum/'.$forum['id'].'/'.$razdel['id'].'/'.$them['id'].'/" method="post">
<input type="submit" name="thanks" value="Сказать Спасибо автору" />
</form>';
}
?>