mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
fix: Displaying Network news
and Latest news
for guests when foums are private (#1879)
This commit is contained in:
parent
eeb391da6a
commit
9f96090cc4
4 changed files with 17 additions and 1 deletions
|
@ -123,6 +123,7 @@ if ($submit) {
|
|||
}
|
||||
|
||||
$datastore->update('cat_forums');
|
||||
CACHE('bb_cache')->rm();
|
||||
bb_die($lang['FORUM_AUTH_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '<a href="' . 'admin_forumauth.php' . '">', '</a>'));
|
||||
}
|
||||
|
||||
|
|
|
@ -153,6 +153,7 @@ if ($submit) {
|
|||
}
|
||||
|
||||
$datastore->update('cat_forums');
|
||||
CACHE('bb_cache')->rm();
|
||||
bb_die($lang['FORUM_AUTH_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '<a href="admin_forumauth_list.php">', '</a>'));
|
||||
} // End of submit
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ if (!$topic_id) {
|
|||
bb_die($lang['INVALID_TOPIC_ID'], 404);
|
||||
}
|
||||
|
||||
$sql = 'SELECT t.attach_id, t.info_hash, t.info_hash_v2, t.size, ad.physical_filename
|
||||
$sql = 'SELECT t.forum_id, t.attach_id, t.info_hash, t.info_hash_v2, t.size, ad.physical_filename
|
||||
FROM ' . BB_BT_TORRENTS . ' t
|
||||
LEFT JOIN ' . BB_ATTACHMENTS_DESC . ' ad
|
||||
ON t.attach_id = ad.attach_id
|
||||
|
@ -34,6 +34,12 @@ if (!$row = DB()->fetch_row($sql)) {
|
|||
bb_die($lang['INVALID_TOPIC_ID_DB'], 404);
|
||||
}
|
||||
|
||||
// Check rights
|
||||
$is_auth = auth(AUTH_ALL, $row['forum_id'], $userdata);
|
||||
if (!$is_auth['auth_view']) {
|
||||
bb_die($lang['SORRY_AUTH_VIEW_ATTACH'], 403);
|
||||
}
|
||||
|
||||
// Protocol meta
|
||||
$meta_v1 = !empty($row['info_hash']);
|
||||
$meta_v2 = !empty($row['info_hash_v2']);
|
||||
|
|
|
@ -329,6 +329,10 @@ 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'))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$template->assign_block_vars('news', [
|
||||
'NEWS_TOPIC_ID' => $news['topic_id'],
|
||||
'NEWS_TITLE' => str_short($wordCensor->censorString($news['topic_title']), $bb_cfg['max_news_title']),
|
||||
|
@ -348,6 +352,10 @@ 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'))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$template->assign_block_vars('net', [
|
||||
'NEWS_TOPIC_ID' => $net['topic_id'],
|
||||
'NEWS_TITLE' => str_short($wordCensor->censorString($net['topic_title']), $bb_cfg['max_net_title']),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue