Code Duplication    Length = 8-8 lines in 2 locations

main/lp/learnpath.class.php 2 locations

@@ 12003-12010 (lines=8) @@
12000
                $myrow = Database::fetch_array($result);
12001
                $output = $myrow['forum_name'];
12002
                break;
12003
            case TOOL_THREAD:  //=topics
12004
                $tbl_post = Database::get_course_table(TABLE_FORUM_POST);
12005
                // Grabbing the title of the post.
12006
                $sql_title = "SELECT * FROM $tbl_post WHERE c_id = $course_id AND post_id=".$id;
12007
                $result_title = Database::query($sql_title);
12008
                $myrow_title = Database::fetch_array($result_title);
12009
                $output = $myrow_title['post_title'];
12010
                break;
12011
            case TOOL_POST:
12012
                $tbl_post = Database::get_course_table(TABLE_FORUM_POST);
12013
                //$tbl_post_text = Database::get_course_table(FORUM_POST_TEXT_TABLE);
@@ 12011-12018 (lines=8) @@
12008
                $myrow_title = Database::fetch_array($result_title);
12009
                $output = $myrow_title['post_title'];
12010
                break;
12011
            case TOOL_POST:
12012
                $tbl_post = Database::get_course_table(TABLE_FORUM_POST);
12013
                //$tbl_post_text = Database::get_course_table(FORUM_POST_TEXT_TABLE);
12014
                $sql = "SELECT * FROM $tbl_post p WHERE c_id = $course_id AND p.post_id = $id";
12015
                $result = Database::query($sql);
12016
                $post = Database::fetch_array($result);
12017
                $output = $post['post_title'];
12018
                break;
12019
            case 'dir':
12020
                $title = $row_item['title'];
12021
                if (!empty($title)) {