Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-9995

Unnecessary coding in display_forums() in functions_display.php

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.0.10-RC1
    • 3.0.8
    • Viewing forums
    • 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

            bantu Andreas Fischer [X] (Inactive)
            updown updown [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: