mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
feat(atom): Hide topics from private forums (#1889)
This commit is contained in:
parent
071fc04b48
commit
75e9d5e4a8
1 changed files with 11 additions and 1 deletions
|
@ -25,10 +25,17 @@ class Atom
|
||||||
*/
|
*/
|
||||||
public static function update_forum_feed($forum_id, $forum_data)
|
public static function update_forum_feed($forum_id, $forum_data)
|
||||||
{
|
{
|
||||||
global $bb_cfg, $lang;
|
global $bb_cfg, $lang, $datastore;
|
||||||
$sql = null;
|
$sql = null;
|
||||||
$file_path = $bb_cfg['atom']['path'] . '/f/' . $forum_id . '.atom';
|
$file_path = $bb_cfg['atom']['path'] . '/f/' . $forum_id . '.atom';
|
||||||
$select_tor_sql = $join_tor_sql = '';
|
$select_tor_sql = $join_tor_sql = '';
|
||||||
|
|
||||||
|
if (!$forums = $datastore->get('cat_forums')) {
|
||||||
|
$datastore->update('cat_forums');
|
||||||
|
$forums = $datastore->get('cat_forums');
|
||||||
|
}
|
||||||
|
$not_forums_id = $forums['not_auth_forums']['guest_view'];
|
||||||
|
|
||||||
if ($forum_id == 0) {
|
if ($forum_id == 0) {
|
||||||
$forum_data['forum_name'] = $lang['ATOM_GLOBAL_FEED'] ?? $bb_cfg['server_name'];
|
$forum_data['forum_name'] = $lang['ATOM_GLOBAL_FEED'] ?? $bb_cfg['server_name'];
|
||||||
}
|
}
|
||||||
|
@ -77,6 +84,9 @@ class Atom
|
||||||
$topics_tmp = DB()->fetch_rowset($sql);
|
$topics_tmp = DB()->fetch_rowset($sql);
|
||||||
$topics = [];
|
$topics = [];
|
||||||
foreach ($topics_tmp as $topic) {
|
foreach ($topics_tmp as $topic) {
|
||||||
|
if (in_array($topic['topic_id'], explode(',', $not_forums_id))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (isset($topic['topic_status'])) {
|
if (isset($topic['topic_status'])) {
|
||||||
if ($topic['topic_status'] == TOPIC_MOVED) {
|
if ($topic['topic_status'] == TOPIC_MOVED) {
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue