From: martin Date: Fri, 2 Aug 2002 17:35:40 +0000 (+0000) Subject: bugfixes and clean up X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9b9f9ab44986e1b4b68a72a11446693e63576eee;p=moodle.git bugfixes and clean up --- diff --git a/mod/forum/report.php b/mod/forum/report.php index 755bc19010..8f1b313579 100644 --- a/mod/forum/report.php +++ b/mod/forum/report.php @@ -12,10 +12,14 @@ } if (! $discussion = get_record("forum_discussions", "id", $post->discussion)) { + error("Discussion ID was incorrect"); + } + + if (! $forum = get_record("forum", "id", $discussion->forum)) { error("Forum ID was incorrect"); } - if ($USER->id <> $post->user) { + if ($USER->id != $post->user) { error("You can only look at results for posts you own"); } @@ -23,14 +27,14 @@ $sort = "r.time"; } - print_header("(Ratings for) $post->subject"); + print_header("Ratings for: $post->subject"); if (!$ratings = get_records_sql("SELECT u.*, r.rating, r.time FROM forum_ratings r, user u WHERE r.post='$post->id' AND r.user=u.id ORDER BY $sort")) { echo "No ratings for this post: \"$post->subject\""; die; } else { - echo ""; + echo "
"; echo ""; echo ""; echo "cellcontent\">"; } echo "
 id&sort=u.firstname>Name"; @@ -43,11 +47,7 @@ echo "
"; - if ($rating->picture) { - echo "wwwroot/user/pix.php/".$rating->picture."/f2.jpg\" ALIGN=left BORDER=0>"; - } else { - echo "wwwroot/user/pix.php/0/f2.jpg\" ALIGN=left BORDER=0>"; - } + print_user_picture($rating->id, $forum->course, $rating->picture); echo "

$rating->firstname $rating->lastname

"; echo "

".$FORUM_POST_RATINGS[$rating->rating]."

"; echo "

".userdate($rating->time)."

";