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

@ -3,4 +3,4 @@
2d53efc945c7747be1755d0b66557a86bdc12cbd
602137b65129b817811b80975a369ebde3270c6d
4eb26ae37e1f4c82a45961517ffeb54c20200408
1073f190135f2098b75293a62608e2c45762d5cf
e59adce848a9e10ee5775254045cbbd915236b8b

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;
}