Forum: nothing important, just formatting

This commit is contained in:
slawkens
2023-07-07 17:43:28 +02:00
parent 6d1b3235d2
commit a61cd43c3c
8 changed files with 141 additions and 115 deletions

View File

@@ -12,19 +12,16 @@ defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
if(Forum::isModerator())
{
if(Forum::isModerator()) {
$id = (int) $_REQUEST['id'];
$post = $db->query("SELECT `id`, `first_post`, `section` FROM `" . FORUM_TABLE_PREFIX . "forum` WHERE `id` = ".$id." LIMIT 1")->fetch();
if($post['id'] == $id && Forum::hasAccess($post['section']))
{
if($post['id'] == $post['first_post'])
{
if($post['id'] == $id && Forum::hasAccess($post['section'])) {
if($post['id'] == $post['first_post']) {
$db->query("DELETE FROM `" . FORUM_TABLE_PREFIX . "forum` WHERE `first_post` = ".$post['id']);
header('Location: ' . getForumBoardLink($post['section']));
}
else
{
else {
$post_page = $db->query("SELECT COUNT(`" . FORUM_TABLE_PREFIX . "forum`.`id`) AS posts_count FROM `players`, `" . FORUM_TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . FORUM_TABLE_PREFIX . "forum`.`author_guid` AND `" . FORUM_TABLE_PREFIX . "forum`.`id` < ".$id." AND `" . FORUM_TABLE_PREFIX . "forum`.`first_post` = ".(int) $post['first_post'])->fetch();
$_page = (int) ceil($post_page['posts_count'] / $config['forum_threads_per_page']) - 1;
$db->query("DELETE FROM `" . FORUM_TABLE_PREFIX . "forum` WHERE `id` = ".$post['id']);
@@ -38,5 +35,5 @@ if(Forum::isModerator())
}
else {
$errors[] = 'You are not logged in or you are not moderator.';
displayErrorBoxWithBackButton($errors, getLink('forum'));
displayErrorBoxWithBackButton($errors, getLink('forum'));
}