en - Whenever I post a news on lastnews.php nothing happens, and if I try to post on forum.php it returns me a page written just that, "Thread with this ID does not exits."
pt - Sempre que vou posta uma news no lastnews.php nada acontece, e se eu tento postar pelo forum.php me retorna uma pagina escrito apenas isso, "Thread with this ID does not exits."
en - I've tried to clean the database, remove and create another one, change the scripts in forum.php, enabled "DEBUG_DATABASE" in index.php, I also didn't find any error return. In the old aassa it worked normally.
pt - Já tentei limpar a database, remover e criar outra, trocar os scripts do forum.php, habilitei "DEBUG_DATABASE" no index.php, também não encontrei retorno de nenhum erro. No gesior antigo ela funcionava normalmente.
en - Add_news script in forum.php
pt - Script do add_news no forum.php
en - Full script of forum.php
pt - Script completo do forum.php
[PHP] <?php if(!defined('INITIALIZED')) exit; // CONFIG $level_limit = 8; // m - Pastebin.com (https://pastebin.com/98qRK9gB)
pt - Sempre que vou posta uma news no lastnews.php nada acontece, e se eu tento postar pelo forum.php me retorna uma pagina escrito apenas isso, "Thread with this ID does not exits."
en - I've tried to clean the database, remove and create another one, change the scripts in forum.php, enabled "DEBUG_DATABASE" in index.php, I also didn't find any error return. In the old aassa it worked normally.
pt - Já tentei limpar a database, remover e criar outra, trocar os scripts do forum.php, habilitei "DEBUG_DATABASE" no index.php, também não encontrei retorno de nenhum erro. No gesior antigo ela funcionava normalmente.
en - Add_news script in forum.php
pt - Script do add_news no forum.php
PHP:
if($action == 'show_thread')
{
$thread_id = (int) $_REQUEST['id'];
$page = (int) $_REQUEST['page'];
$thread_name = filter_var($thread_name, FILTER_SANITIZE_STRING);
$thread_name = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_topic') . " FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = ".(int) $thread_id." AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " AND " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " LIMIT 1")->fetch();
if(!empty($thread_name['name']))
{
$posts_count = filter_var($posts_count, FILTER_SANITIZE_STRING);
$posts_count = $SQL->query("SELECT COUNT(" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . ") AS posts_count FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = ".(int) $thread_id)->fetch();
for($i = 0; $i < $posts_count['posts_count'] / $threads_per_page; $i++)
{
if($i != $page)
$links_to_pages .= '<a href="?subtopic=forum&action=show_thread&id='.$thread_id.'&page='.$i.'">'.($i + 1).'</a> ';
else
$links_to_pages .= '<b>'.($i + 1).' </b>';
}
$threads = $SQL->query("SELECT
" . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ",
" . $SQL->tableName('players') . "." . $SQL->fieldName('group_id') . ",
" . $SQL->tableName('players') . "." . $SQL->fieldName('town_id') . ",
" . $SQL->tableName('players') . "." . $SQL->fieldName('account_id') . ",
" . $SQL->tableName('players') . "." . $SQL->fieldName('vocation') . ",
" . $SQL->tableName('players') . "." . $SQL->fieldName('level') . ",
" . $SQL->tableName('players') . "." . $SQL->fieldName('signature') . ",
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . ",
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . ",
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('section') . ",
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('icon_id') . ",
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_text') . ",
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_topic') . ",
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . ",
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_smile') . ",
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_aid') . ",
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . ",
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('last_edit_aid') . ",
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('edit_date') . "
FROM
" . $SQL->tableName('players') . ",
" . $SQL->tableName('z_forum') . "
WHERE
" . $SQL->tableName('players') . "." . $SQL->fieldName('id') . "
=
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . "
AND
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . "
=
".(int) $thread_id."
ORDER BY
" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . "
LIMIT
".$posts_per_page."
OFFSET
".($page * $posts_per_page))->fetchAll();
if(isset($threads[0]['name']))
$SQL->query("UPDATE " . $SQL->tableName('z_forum') . " SET " . $SQL->fieldName('views') . "=" . $SQL->fieldName('views') . "+1 WHERE " . $SQL->fieldName('id') . " = ".(int) $thread_id);
$main_content .= '
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR>
<TD><IMG SRC="'.$layout_name.'/images/global/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD>
<TD WIDTH=100% ALIGN=right>
<a href="?subtopic=forum" >Community Boards</a> |
<a href="?subtopic=forum&action=show_board&id='.$threads[0]['section'].'">'.$sections[$threads[0]['section']].'</a> | <b>'.htmlspecialchars($thread_name['post_topic']).'</b>
</TD>
<TD><IMG SRC="'.$layout_name.'/images/global/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD>
</TR>
</TABLE>
<br />';
if(!$logged)
$main_content .= '
<br>
You are <b>not</b> logged in. <a href="?subtopic=accountmanagement" >Log in</a> to post on the forum.<br>
<br>';
$main_content .= '
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr>
<td class="ff_std" colspan=4 align="left" ></td>
</tr>
<tr>
<td bgcolor="#F1E0C6" class="ff_large" colspan=2 align="left" width=800 >
<div class="PostReplyLink">
<a href="?subtopic=forum&action=new_post&thread_id='.$thread_id.'">
<img src="images/forum/post.gif" name="" width="92" height="20" border="0" >
</a>
</div>
<div class="Text" ><b>'.$sections[$threads[0]['section']].': '.htmlspecialchars($thread_name['post_topic']).'</b></div></td>
</tr>
</table>';
$main_content .= '
<table border=0 cellpadding=5 cellspacing=1 width=100%>
<tr>
<td bgcolor="'.$config['site']['vdarkborder'].'" class="ff_white" colspan=2 align="left" NOWRAP >
<div class="ForumPost" style="position:relative;height:26px;left:0px;">
<div style="float:left;width:175;padding: 5 5 0 5;" ><b>Author</b></div>
<div style="float:right;width:600px;padding: 5 5 0 5;" >
<table border=0 cellpadding=2 cellspacing=0 width=100%>
<tr>
<td bgcolor="'.$config['site']['vdarkborder'].'" class="ff_white" colspan=1 align="left" NOWRAP ><b>Thread #'.$threads[0]['id'].'</b></td>
<td bgcolor="'.$config['site']['vdarkborder'].'" class="ff_white" colspan=1 align="right" NOWRAP ><b>Pages: '.$links_to_pages.'</b>
</td>
</tr>
</table>
</div>
<div class="PostSeparatorV" ></div>
</div>
</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>
<td colspan="2" class="CipPost" >
<div class="ForumPost" style="background-color:'.$bgcolor.';" >';
if($thread['group_id'] >= 3)
$main_content .= '
<div class="CipBorderTop" >
<div class="CipBorder" >
<div class="CipBorderCornerL" style="background-image: url('.$layout_name.'/images/global/forum/cip_post_border_lu.jpg)" ></div>
<div class="CipBorderH" style="background-image: url('.$layout_name.'/images/global/forum/cip_post_border_h.jpg)" ></div>
<div class="CipBorderCornerR" style="background-image: url('.$layout_name.'/images/global/forum/cip_post_border_ru.jpg)" ></div>
</div>
</div>
<div class="CipBorderLeft" >
<div class="CipBorderV" style="background-image: url('.$layout_name.'/images/global/forum/cip_post_border_v.jpg)" ></div>
</div>
<div class="CipBorderRight" >
<div class="CipBorderV" style="background-image: url('.$layout_name.'/images/global/forum/cip_post_border_v.jpg)" ></div>
</div>';
$main_content .= '
<div class="PostSeparatorV" ></div>
<div class="PostUpper">
<div class="PostCharacterText" >
<b><a href="?subtopic=characters&name='.urlencode($thread['name']).'">'.htmlspecialchars($thread['name']).'</a></b><br>';
if($thread['group_id'] >= 3)
$main_content .= '
<font class="ff_smallinfo">Community Manager<br/>';
if($thread['group_id'] >= 3)
$main_content .= '
<img class="CipPostIcon" src="'.$layout_name.'/images/global/forum/cip_post_icon.gif" /><br>';
$main_content .= '
</font><br>
<font class="ff_infotext">Inhabitant of ' . $config['server']['serverName'] . '<br>
Vocation: '.htmlspecialchars(Website::getVocationName($thread['vocation'], $thread['promotion'])).'<br>
Level: '.$thread['level'].'<br>
<br>';
$rank = new GuildRank($thread['rank_id']);
if($rank->isLoaded())
{
$guild = $rank->getGuild();
if($guild->isLoaded())
$main_content .= '
<font class="ff_smallinfo">'.htmlspecialchars($rank->getName()).' of the <a href="?subtopic=guilds&action=show&guild='.$guild->getId().'" >'.htmlspecialchars($guild->getName()).'</a> (Larissa)</font><br>';
}
$posts = filter_var($posts, FILTER_SANITIZE_STRING);
$posts = $SQL->query("SELECT COUNT(" . $SQL->fieldName('id') . ") AS 'posts' FROM " . $SQL->tableName('z_forum') . " WHERE " . $SQL->fieldName('author_aid') . "=".(int) $thread['account_id'])->fetch();
$main_content .= '
<br />Posts: '.(int) $posts['posts'].'<br /></font></div>
<div class="PostText" >';
if($thread['icon_id'] != 0)
$main_content .= '
<img src="'.$layout_name.'/images/global/forum/icons/'.$thread['icon_id'].'.gif">
';
$main_content .= '
'.showPost(htmlspecialchars($thread['post_topic']), $thread['post_text'], $thread['post_smile']);
if(!empty($thread['signature'])){
$main_content .= '
<br />________________<br />'.$thread['signature'];
$main_content .= '
<br /><br /><br /><br />
';
}
$main_content .= '
</div>
<div class="PostLower" >
<div class="PostDetailsHelper" >
<div class="PostDetails" ><img src="'.$layout_name.'/images/global/forum/logo_oldpost.gif" border=0 width=14 height=11>'.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 />Edited by moderator';
else
$main_content .= '<br />Edited by '.htmlspecialchars($thread['name']);
$main_content .= '<br />on '.date('d/m/y H:i:s', $thread['edit_date']);
}
$main_content .= '</div></div>';
$main_content .= '
<div class="PostActions" >
<div class="AdditionalBox" >Post #'.$thread['id'].'</div>';
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 '.htmlspecialchars($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 > '.htmlspecialchars($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))
$main_content .= '
<br/><a href="?subtopic=forum&action=edit_post&id='.$thread['id'].'">Edit Post</a>';
if($logged)
$main_content .= '
<br/><a href="?subtopic=forum&action=new_post&thread_id='.$thread_id.'"e='.$thread['id'].'">Quote</a>';
$main_content .= '
</div>';
if($thread['group_id'] >= 3)
$main_content .= '
<div class="CipBorderBottom">
<div class="CipBorder">
<div class="CipBorderCornerL" style="background-image: url('.$layout_name.'/images/global/forum/cip_post_border_ll.jpg)" ></div>
<div class="CipBorderH" style="background-image: url('.$layout_name.'/images/global/forum/cip_post_border_h.jpg)" ></div>
<div class="CipBorderCornerR" style="background-image: url('.$layout_name.'/images/global/forum/cip_post_border_rl.jpg)" ></div>
</div>
</div>';
else
$main_content .= '
</div>';
$main_content .= '
</td>
</tr>';
}
$main_content .= '
<table border=0 cellpadding=6 cellspacing=0 width=100%>
<tr>
<td bgcolor="#505050" class="ff_white" colspan=1 align="left" NOWRAP ><b>All times are CEST. Pages: '.$links_to_pages.'</b></td>
</tr>
</table>
<table border=0 cellpadding=6 cellspacing=0 width=100%>
<tr>
<td class="ff_pagetext" colspan=1 align="left" ></td>
<td class="ff_large" colspan=1 align="right" >
<a href="?subtopic=forum&action=new_post&thread_id='.$thread_id.'" >
<img src="images/forum/post.gif" name="" width="92" height="20" border="0" >
</a>
</td>
</tr>
<tr>
<td class="ff_std" colspan=1 align="left" ></td>
</tr>
<tr>
<td class="ff_std" colspan=4 align="left" ></td>
</tr>
</table>
<br>
<b>Board Rights:<br>
</b>View threads.<br>
<br>
Replace code is ON. Smileys are ON. Images are OFF. Links are OFF. "Thank You!" option is OFF. <br>
Account muting option is ON. <br>';
}
else
$main_content .= 'Thread with this ID does not exits.';
}
en - Full script of forum.php
pt - Script completo do forum.php
[PHP] <?php if(!defined('INITIALIZED')) exit; // CONFIG $level_limit = 8; // m - Pastebin.com (https://pastebin.com/98qRK9gB)