Code Duplication    Length = 7-8 lines in 2 locations

main/forum/forumfunction.inc.php 2 locations

@@ 5129-5135 (lines=7) @@
5126
5127
    // Handling the thread count information.
5128
    $result2 = Database::query($sql2);
5129
    while ($row2 = Database::fetch_array($result2, 'ASSOC')) {
5130
        if (is_array($forum_list)) {
5131
            if (array_key_exists($row2['forum_id'], $forum_list)) {
5132
                $forum_list[$row2['forum_id']]['number_of_threads'] = $row2['number_of_threads'];
5133
            }
5134
        }
5135
    }
5136
5137
    // Handling the post count information.
5138
    $result3 = Database::query($sql3);
@@ 5139-5146 (lines=8) @@
5136
5137
    // Handling the post count information.
5138
    $result3 = Database::query($sql3);
5139
    while ($row3 = Database::fetch_array($result3, 'ASSOC')) {
5140
        if (is_array($forum_list)) {
5141
            if (array_key_exists($row3['forum_id'], $forum_list)) {
5142
                // This is needed because sql3 takes also the deleted forums into account.
5143
                $forum_list[$row3['forum_id']]['number_of_posts'] = $row3['number_of_posts'];
5144
            }
5145
        }
5146
    }
5147
5148
    // Finding the last post information (last_post_id, last_poster_id, last_post_date, last_poster_name, last_poster_lastname, last_poster_firstname).
5149
    if (!empty($forum_list)) {