Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions e107_plugins/forum/forum_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,7 @@ function forumGet($forum_id)
}


function forumGetAllowed($type='view')
function forumGetAllowed($type='view', $mode = null)
{
if(empty($this->permList[$type]))
{
Expand All @@ -2017,7 +2017,12 @@ function forumGetAllowed($type='view')

$sql = e107::getDb();
$forumList = implode(',', $this->permList[$type]);
$qry = "
$qry = $mode?"
SELECT f.forum_id, f.forum_name, f.forum_sef, pf.forum_name AS parent_name
FROM `#forum` AS f LEFT JOIN `#forum` AS pf
ON f.forum_parent = pf.forum_id
WHERE f.forum_id IN ({$forumList}) AND f.forum_parent != 0
ORDER BY pf.forum_id, f.forum_name":"
SELECT forum_id, forum_name, forum_sef FROM `#forum`
WHERE forum_id IN ({$forumList}) AND forum_parent != 0
";
Expand Down
4 changes: 2 additions & 2 deletions e107_plugins/forum/shortcodes/batch/view_shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -1266,13 +1266,13 @@ function sc_buttonsx()
$text .= '<li>' . $val . '</li>';
}

$jumpList = $this->forum->forumGetAllowed();
$jumpList = $this->forum->forumGetAllowed('view', 'true');

$text .= "<li class='divider'><hr class='dropdown-divider'></li>";

foreach($jumpList as $key => $val)
{
$text .= '<li><a class="dropdown-item" href ="' . e107::url('forum', 'forum', $val) . '">' . LAN_FORUM_1017 . " " . $val['forum_name'] . '</a></li>';
$text .= '<li><a class="dropdown-item" href ="' . e107::url('forum', 'forum', $val) . '">' . LAN_FORUM_1017 . " " .($val['parent_name']?$val['parent_name']." - ":"") . $val['forum_name'] . '</a></li>';
}

$text .= '
Expand Down
Loading