]> git.mjollnir.org Git - moodle.git/commitdiff
Little update to select the forum info (avoid duplicates).
authorstronk7 <stronk7>
Thu, 24 Apr 2003 17:35:34 +0000 (17:35 +0000)
committerstronk7 <stronk7>
Thu, 24 Apr 2003 17:35:34 +0000 (17:35 +0000)
mod/forum/index.php

index 090163d0f8d4ac0f13805576851ed4b27a39bab2..eb150e0551e2eed596f4fea2040140ba6dfc8605 100644 (file)
     //Obtains all the forum data and visible field
     if ($forums = get_records_sql("SELECT f.*,cm.visible as visible
                                    FROM {$CFG->prefix}course_modules cm,
-                                        {$CFG->prefix}forum f
+                                        {$CFG->prefix}forum f,
+                                        {$CFG->prefix}modules md
                                    WHERE cm.course = '$id' AND
                                          f.course = '$id' AND
+                                         md.name = 'forum' AND
+                                         md.id = cm.module AND
                                          f.id = cm.instance
-                                   ORDER BY name ASC"))
+                                   ORDER BY f.name"))
        {
         foreach ($forums as $forum) {
             switch ($forum->type) {