misc: Minor improvements (#1880)

* misc: Minor improvements

* Update index.php
This commit is contained in:
Roman Kelesidis 2025-04-17 23:18:29 +07:00 committed by GitHub
commit de8f1925ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -80,6 +80,7 @@ $forum_name_html = $forums['forum_name_html'];
$anon = GUEST_UID;
$excluded_forums_csv = $user->get_excluded_forums(AUTH_VIEW);
$excluded_forums_array = $excluded_forums_csv ? explode(',', $excluded_forums_csv) : [];
$only_new = $user->opt_js['only_new'];
// Validate requested category id
@ -329,7 +330,7 @@ if ($bb_cfg['show_latest_news']) {
$template->assign_vars(['SHOW_LATEST_NEWS' => true]);
foreach ($latest_news as $news) {
if (in_array($news['forum_id'], $user->get_excluded_forums(AUTH_VIEW, 'array'))) {
if (in_array($news['forum_id'], $excluded_forums_array)) {
continue;
}
@ -352,7 +353,7 @@ if ($bb_cfg['show_network_news']) {
$template->assign_vars(['SHOW_NETWORK_NEWS' => true]);
foreach ($network_news as $net) {
if (in_array($net['forum_id'], $user->get_excluded_forums(AUTH_VIEW, 'array'))) {
if (in_array($net['forum_id'], $excluded_forums_array)) {
continue;
}