Code Duplication    Length = 8-8 lines in 2 locations

main/lp/learnpath.class.php 2 locations

@@ 11952-11959 (lines=8) @@
11949
                $myrow = Database::fetch_array($result);
11950
                $output = $myrow['forum_name'];
11951
                break;
11952
            case TOOL_THREAD:  //=topics
11953
                $tbl_post = Database::get_course_table(TABLE_FORUM_POST);
11954
                // Grabbing the title of the post.
11955
                $sql_title = "SELECT * FROM $tbl_post WHERE c_id = $course_id AND post_id=".$id;
11956
                $result_title = Database::query($sql_title);
11957
                $myrow_title = Database::fetch_array($result_title);
11958
                $output = $myrow_title['post_title'];
11959
                break;
11960
            case TOOL_POST:
11961
                $tbl_post = Database::get_course_table(TABLE_FORUM_POST);
11962
                //$tbl_post_text = Database::get_course_table(FORUM_POST_TEXT_TABLE);
@@ 11960-11967 (lines=8) @@
11957
                $myrow_title = Database::fetch_array($result_title);
11958
                $output = $myrow_title['post_title'];
11959
                break;
11960
            case TOOL_POST:
11961
                $tbl_post = Database::get_course_table(TABLE_FORUM_POST);
11962
                //$tbl_post_text = Database::get_course_table(FORUM_POST_TEXT_TABLE);
11963
                $sql = "SELECT * FROM $tbl_post p WHERE c_id = $course_id AND p.post_id = $id";
11964
                $result = Database::query($sql);
11965
                $post = Database::fetch_array($result);
11966
                $output = $post['post_title'];
11967
                break;
11968
            case 'dir':
11969
                $title = $row_item['title'];
11970
                if (!empty($title)) {