Permalink
Browse files

Merge branch 'MDL-27298_forum_rating_participants' of git://github.co…

…m/andyjdavis/moodle into MOODLE_20_STABLE
  • Loading branch information...
stronk7 committed Sep 19, 2011
2 parents f6b9535 + c841c10 commit c1beb0fa2d3c3d053fcc547fec3b2e096ce3d41d
Showing with 10 additions and 10 deletions.
  1. +10 −10 mod/forum/lib.php
View
@@ -1243,10 +1243,10 @@ function forum_print_overview($courses,&$htmlarray) {
if (count($trackingforums) > 0) {
$cutoffdate = isset($CFG->forum_oldpostdays) ? (time() - ($CFG->forum_oldpostdays*24*60*60)) : 0;
- $sql = 'SELECT d.forum,d.course,COUNT(p.id) AS count '.
- ' FROM {forum_posts} p '.
- ' JOIN {forum_discussions} d ON p.discussion = d.id '.
- ' LEFT JOIN {forum_read} r ON r.postid = p.id AND r.userid = ? WHERE (';
+ $sql = 'SELECT d.forum,d.course,COUNT(p.id) AS count
+ FROM {forum_posts} p
+ JOIN {forum_discussions} d ON p.discussion = d.id
+ LEFT JOIN {forum_read} r ON r.postid = p.id AND r.userid = ? WHERE (';
$params = array($USER->id);
foreach ($trackingforums as $track) {
@@ -1599,8 +1599,8 @@ function forum_get_participants($forumid) {
$st_subscriptions = $DB->get_records_sql("SELECT DISTINCT u.id, u.id
FROM {user} u,
{forum_subscriptions} s
- WHERE s.forum = ? AND
- u.id = s.userid", array($forumid));
+ WHERE s.forum = ? AND
+ u.id = s.userid", array($forumid));
//Get students from forum_posts
$st_posts = $DB->get_records_sql("SELECT DISTINCT u.id, u.id
FROM {user} u,
@@ -1616,10 +1616,10 @@ function forum_get_participants($forumid) {
{forum_discussions} d,
{forum_posts} p,
{ratings} r
- WHERE d.forum = ? AND
- p.discussion = d.id AND
- r.post = p.id AND
- u.id = r.userid", array($forumid));
+ WHERE d.forum = ? AND
+ p.discussion = d.id AND
+ r.itemid = p.id AND
+ u.id = r.userid", array($forumid));
//Add st_posts to st_subscriptions
if ($st_posts) {

0 comments on commit c1beb0f

Please sign in to comment.