//OPEN|CLOSE FUNCTION
if(isThreadOpen($thread_id)) {
$main_content .= '
<br />
<br />
<a href="?subtopic=forum&action=new_post&thread_id='.$thread_id.'">
<img src="images/post.gif" border="0" /></a>
<br />
<br />Página: '.$links_to_pages.'<br />
<table width="100%">
<tr bgcolor="'.$config['site']['lightborder'].'" width="100%">
<td colspan="2"><font size="4"><b>'.htmlspecialchars($thread_name['post_topic']).'</b></font><font size="1">
<br />por <a href="?subtopic=characters&name='.urlencode($thread_name['name']).'">'.$thread_name['name'].'</a></font></td>
</tr>
<tr bgcolor="'.$config['site']['vdarkborder'].'">
<td width="200"><font color="white" size="1"><b>Autor</b></font></td>
<td> </td>
</tr>';
}
else
$main_content .= '
<br />
<br />
<strong>Thread Closed!</strong>
<br />
<br />Página: '.$links_to_pages.'<br />
<table width="100%">
<tr bgcolor="'.$config['site']['lightborder'].'" width="100%">
<td colspan="2"><font size="4"><b>'.htmlspecialchars($thread_name['post_topic']).'</b></font><font size="1"><br />by <a href="?subtopic=characters&name='.urlencode($thread_name['name']).'">'.$thread_name['name'].'</a></font></td>
</tr>
<tr bgcolor="'.$config['site']['vdarkborder'].'">
<td width="200"><font color="white" size="1"><b>Author</b></font></td><td> </td>
</tr>';
foreach($threads as $thread)
{
if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '
<tr bgcolor="'.$bgcolor.'">
<td valign="top"><a href="?subtopic=characters&name='.urlencode($thread['name']).'">'.$thread['name'].'</a><br /><br /><font size="1">Vocação: '.$vocation_name[$thread['world_id']][$thread['promotion']][$thread['vocation']].'<br />Level: '.$thread['level'].'<br />';
$rank = new OTS_GuildRank();
$rank->load($thread['rank_id']);
if($rank->isLoaded())
{
$guild = $rank->getGuild();
if($guild->isLoaded())
$main_content .= $rank->getName().' of <a href="?subtopic=guilds&action=show&guild='.$guild->getId().'">'.$guild->getName().'</a><br />';
}
$posts = $SQL->query("SELECT COUNT(`id`) AS 'posts' FROM `z_forum` WHERE `author_aid`=".(int) $thread['account_id'])->fetch();
$main_content .= '<br />Postagens: '.(int) $posts['posts'].'<br /></font></td><td valign="top">'.showPost($thread['?'], $thread['post_text'], $thread['post_smile']).'</td></tr>
<tr bgcolor="'.$bgcolor.'"><td><font size="1">'.date('d.m.y H:i:s', $thread['post_date']);
if($thread['edit_date'] > 0)
{
if($thread['last_edit_aid'] != $thread['author_aid'])
$main_content .= '<br />Editado pelo moderador';
else
$main_content .= '<br />Editado por '.$thread['name'];
$main_content .= '<br />em '.date('d.m.y H:i:s', $thread['edit_date']);
}
$main_content .= '</font></td><td>';
if($logged && $group_id_of_acc_logged >= $group_not_blocked)
if($thread['first_post'] != $thread['id'])
$main_content .= '<a href="?subtopic=forum&action=remove_post&id='.$thread['id'].'" onclick="return confirm(\'Are you sure you want remove post of '.$thread['name'].'?\')"><font color="red">REMOVE POST</font></a>';
else
$main_content .= '<a href="?subtopic=forum&action=remove_post&id='.$thread['id'].'" onclick="return confirm(\'Are you sure you want remove thread > '.$thread['post_topic'].' <?\')"><font color="red">REMOVE THREAD</font></a>';
if($logged && ($thread['account_id'] == $account_logged->getId() || $group_id_of_acc_logged >= $group_not_blocked))
//OPEN|CLOSE FUNCTION
if(isThreadOpen($thread_id)) {
$main_content .= '<br/><a href="?subtopic=forum&action=edit_post&id='.$thread['id'].'">EDIT POST</a>';}
else
$main_content .= '';
if($logged)
if(isThreadOpen($thread_id)) {
$main_content .= '<br/><a href="?subtopic=forum&action=new_post&thread_id='.$thread_id.'"e='.$thread['id'].'">Quote</a>';}
else
$main_content .= '';
$main_content .= '</td></tr>';
}