Permalink
Browse files

Changes to make things work again :-)

  • Loading branch information...
1 parent 62cdef7 commit d26d7ed0c319ee1f14cecff5500eb041ba3d0ece moodler committed Dec 22, 2002
Showing with 14 additions and 2 deletions.
  1. +1 −1 course/lib.php
  2. +12 −0 lib/datalib.php
  3. +1 −1 mod/forum/lib.php
View
@@ -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");
}
View
@@ -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");
}
View
@@ -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);
}

0 comments on commit d26d7ed

Please sign in to comment.