]> git.mjollnir.org Git - moodle.git/commitdiff
Changes to make things work again :-)
authormoodler <moodler>
Sun, 22 Dec 2002 06:15:44 +0000 (06:15 +0000)
committermoodler <moodler>
Sun, 22 Dec 2002 06:15:44 +0000 (06:15 +0000)
course/lib.php
lib/datalib.php
mod/forum/lib.php

index 01afff49c582635448ad34779ffeb841720474f1..6611986f5966554b9c10246a262b4af2a05d36b2 100644 (file)
@@ -444,7 +444,7 @@ function get_all_mods($courseid, &$mods, &$modnames, &$modnamesplural, &$modname
 
 function get_all_sections($courseid) {
     
-    return get_records("course_sections", "course", "$courseid", "sections", 
+    return get_records("course_sections", "course", "$courseid", "section", 
                        "section, id, course, summary, sequence");
 }
 
index 1fdea66b1d85717eb17ddc1aebb2f2ca781de20d..28e582447224072ae9fc17ac67de3d8cb0de72b2 100644 (file)
@@ -123,6 +123,10 @@ function count_records_select($table, $select="") {
 
     global $CFG;
 
+    if ($select) {
+        $select = "WHERE $select";
+    }
+
     return count_records_sql("SELECT COUNT(*) FROM $CFG->prefix$table $select");
 }
 
@@ -202,6 +206,10 @@ function get_records_select($table, $select="", $sort="", $fields="*") {
         $sortorder = "ORDER BY $sort";
     }
 
+    if ($select) {
+        $select = "WHERE $select";
+    }
+
     return get_records_sql("SELECT $fields FROM $CFG->prefix$table $select $sortorder");
 }
 
@@ -281,6 +289,10 @@ function get_records_select_menu($table, $select="", $sort="", $fields="*") {
         $sortorder = "ORDER BY $sort";
     }
 
+    if ($select) {
+        $select = "WHERE $select";
+    }
+
     return get_records_sql_menu("SELECT $fields FROM $CFG->prefix$table $select $sortorder");
 }
 
index 79443117680e6ff82519708b68ab635d34fdf8e8..78e29c672f907447f81d456bf8b0e586348ae7b0 100644 (file)
@@ -1234,7 +1234,7 @@ function forum_subscribe($userid, $forumid) {
 
 function forum_unsubscribe($userid, $forumid) {
 /// Removes user from the subscriber list
-    return delete_records("forum_subscriptions", "user", $userid, "forum", $forumid)
+    return delete_records("forum_subscriptions", "user", $userid, "forum", $forumid);
 }