continue;
}
-
-
if (! $discussion = get_record("forum_discussions", "id", "$post->discussion")) {
mtrace("Could not find discussion $post->discussion");
continue;
}
// make sure we're allowed to see it...
- if (!forum_user_can_see_post($forum,$discussion,$post,$userto)) {
+ if (!forum_user_can_see_post($forum, $discussion, $post, $userto)) {
continue;
}
static $formattedtextid; // The ID number of the post
- if (!$forumid = get_record('discussion', 'id', $post->discussion)) {
- error('Could not get the forum id for the discussion the post belongs to');
+ if (!$forum = get_record('forum', 'id', $post->discussion)) {
+ mtrace('Could not get the forum for the discussion the post belongs to');
}
- if (!$cm = get_coursemodule_from_instance('forum', $forumid)) {
- error('Course Module ID was incorrect');
+ if (!$cm = get_coursemodule_from_instance('forum', $forum->id)) {
+ mtrace('Course Module ID was incorrect');
}
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);