mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 01:34:55 +02:00
Forum: nothing important, just formatting
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
|
Reference in New Issue
Block a user