Move forum config to settings

This commit is contained in:
slawkens
2023-07-20 16:36:59 +02:00
parent a7b8ccaee2
commit 55a5ccdd1e
15 changed files with 128 additions and 44 deletions

View File

@@ -10,7 +10,10 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
$ret = require __DIR__ . '/base.php';
if ($ret === false) {
return;
}
if(Forum::isModerator()) {
$id = (int) $_REQUEST['id'];
@@ -23,7 +26,7 @@ if(Forum::isModerator()) {
}
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;
$_page = (int) ceil($post_page['posts_count'] / setting('core.forum_threads_per_page')) - 1;
$db->query("DELETE FROM `" . FORUM_TABLE_PREFIX . "forum` WHERE `id` = ".$post['id']);
header('Location: ' . getForumThreadLink($post['first_post'], (int) $_page));
}