-
Improvement
-
Resolution: Fixed
-
Minor
-
3.0.8
-
None
The function display_forums() in includes/function_display.php has some inefficiencies and unnecessary codings when marking as read:
When marking there is no reason to continue only if the forum is listable, you can continue anyway:
Line 122:
// Mark forums read?
|
|
if ($mark_read == 'forums' || $mark_read == 'all')
|
{
|
if ($auth->acl_get('f_list', $forum_id))
|
{
|
$forum_ids[] = $forum_id;
|
}
|
continue; // move continue here!
|
}
|
Line 155 ( $forum_ids[] = $forum_id; ) can be deleted since this point is never reached when marking, and $forum_ids[] is only used for this purpose:
if (!$auth->acl_get('f_list', $forum_id))
|
{
|
// if the user does not have permissions to list this forum, skip everything until next branch
|
$right_id = $row['right_id'];
|
continue;
|
}
|
|
$forum_ids[] = $forum_id; // can be deleted!
|
Additionally in general: If $mark_read='all', you don't need to do the whole SQL-stuff, could be bypassed in any way