| $group_permissions = forum_permissions(); $permsql = ''; $onlyusfids = array();
foreach($group_permissions as $fid => $forum_permissions) { if(!empty($forum_permissions['canonlyviewownthreads'])) { $onlyusfids[] = $fid; } }
if($onlyusfids) { $permsql .= " OR (fid IN(".implode(',', $onlyusfids).") AND uid!={$mybb->user['uid']})"; } $unsearchforums = get_unsearchable_forums(); if($unsearchforums) { $permsql .= " OR fid IN ($unsearchforums)"; } $inactiveforums = get_inactive_forums(); if($inactiveforums) { $permsql .= " OR fid IN ($inactiveforums)"; }
|
// Check the thread records as well. If we don't have permissions, remove them from the listing.
|
// Check the thread records as well. If we don't have permissions, remove them from the listing.
|
$query = $db->simple_select("threads", "tid", "tid IN(".$db->escape_string(implode(',', $pids)).") AND ({$t_unapproved_where} OR closed LIKE 'moved|%')");
| $query = $db->simple_select("threads", "tid", "tid IN(".$db->escape_string(implode(',', $pids)).") AND ({$t_unapproved_where}{$permsql} OR closed LIKE 'moved|%')");
|
while($thread = $db->fetch_array($query)) { if(array_key_exists($thread['tid'], $tids) != false)
| while($thread = $db->fetch_array($query)) { if(array_key_exists($thread['tid'], $tids) != false)
|