Skip to content
Snippets Groups Projects
Commit 1eaa8009 authored by Tomáš Valenta's avatar Tomáš Valenta
Browse files

provide forum info

parent 831c96a4
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@ window.addEventListener(
}
nextUrl.searchParams.append("token", window.TOKEN);
nextUrl.searchParams.append("allowed-forum-ids", window.ALLOWED_FORUM_IDS);
window.location = nextUrl;
}
......
......@@ -110,7 +110,8 @@ class Forums
WHERE
forum_id = ' . $forum_id . '
AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id) . '
ORDER BY topic_id DESC'
ORDER BY topic_id DESC
LIMIT 25'
);
$topics = array();
......@@ -139,6 +140,25 @@ class Forums
array_push($topics, $topic);
}
return new JsonResponse($topics, 200);
$forum_query = $db->sql_query(
'SELECT forum_name, forum_desc
FROM ' . FORUMS_TABLE . '
WHERE forum_id= ' . $forum_id
);
$forum = array();
while ($row => $db->sql_fetchrow($forum_query)) {
$forum["name"] = $row["forum_name"];
$forum["desc"] = $row["forum_desc"];
}
return new JsonResponse(
array(
"forum" => $forum,
"topics" => $topics
),
200
);
}
}
......@@ -111,6 +111,7 @@ $template->set_filenames(array(
));
$template->assign_vars(array(
'TOKEN' => $token,
'ALLOWED_FORUM_IDS' => implode(",", $allowed_forum_ids)
));
$request->disable_super_globals();
......
......@@ -25,6 +25,7 @@
<script>
window.TOKEN = "{TOKEN}";
window.ALLOWED_FORUM_IDS = "{ALLOWED_FORUM_IDS}";
</script>
<script src="./assets/javascript/nastenka_sync.js?v=1"></script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment