2018-08-26 01:46:33 +00:00
|
|
|
<?php
|
2018-10-04 20:30:55 +00:00
|
|
|
require_once '../../misuzu.php';
|
2018-08-26 01:46:33 +00:00
|
|
|
|
|
|
|
switch ($_GET['v'] ?? null) {
|
|
|
|
case 'listing':
|
2018-10-06 23:30:48 +00:00
|
|
|
$forums = db_query('SELECT * FROM `msz_forum_categories`');
|
2018-12-29 03:14:07 +00:00
|
|
|
$rawPerms = forum_perms_create();
|
|
|
|
$perms = manage_forum_perms_list($rawPerms);
|
2018-08-26 01:46:33 +00:00
|
|
|
|
2018-12-29 03:14:07 +00:00
|
|
|
if (!empty($_POST['perms']) && is_array($_POST['perms'])) {
|
|
|
|
$finalPerms = manage_perms_apply($perms, $_POST['perms'], $rawPerms);
|
|
|
|
$perms = manage_forum_perms_list($finalPerms);
|
|
|
|
tpl_var('calculated_perms', $finalPerms);
|
|
|
|
}
|
|
|
|
|
|
|
|
echo tpl_render('manage.forum.listing', compact('forums', 'perms'));
|
2018-08-26 01:46:33 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'forum':
|
2018-10-06 23:30:48 +00:00
|
|
|
$getForum = db_prepare('
|
2018-08-26 01:46:33 +00:00
|
|
|
SELECT *
|
|
|
|
FROM `msz_forum_categories`
|
|
|
|
WHERE `forum_id` = :forum_id
|
|
|
|
');
|
|
|
|
$getForum->bindValue('forum_id', (int)($_GET['f'] ?? 0));
|
2019-01-09 19:06:02 +00:00
|
|
|
$forum = db_fetch($getForum);
|
2018-08-26 01:46:33 +00:00
|
|
|
|
|
|
|
if (!$forum) {
|
|
|
|
echo render_error(404);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2018-12-29 03:14:07 +00:00
|
|
|
echo tpl_render('manage.forum.forum', compact('forum'));
|
2018-08-26 01:46:33 +00:00
|
|
|
break;
|
|
|
|
}
|