Skip to content
Permalink
Browse files

Merged changes from stable

  • Loading branch information...
moodler
moodler committed Nov 23, 2004
1 parent 7b07a93 commit f7abd64afb0ca7268e0be41c93579298fc959913
Showing with 14 additions and 10 deletions.
  1. +14 −10 mod/forum/post.php
@@ -13,12 +13,16 @@
require_login(0, false); // Script is useless unless they're logged in
if ($post = data_submitted()) {
if (!empty($post->course)) {
if ($course = get_record('course', 'id', $post->course)) {
if (!empty($course->lang)) {
$CFG->courselang = $course->lang;
}
}
if (empty($post->course)) {
error('No course was defined!');
}
if (!$course = get_record('course', 'id', $post->course)) {
error('Could not find specified course!');
}
if (!empty($course->lang)) { // Override current language
$CFG->courselang = $course->lang;
}
if (empty($SESSION->fromurl)) {
@@ -33,7 +37,7 @@
$post->attachment = isset($_FILES['attachment']) ? $_FILES['attachment'] : NULL;
if (!$cm = get_coursemodule_from_instance("forum", $post->forum, $post->course)) { // For the logs
if (!$cm = get_coursemodule_from_instance("forum", $post->forum, $course->id)) { // For the logs
$cm->id = 0;
}
@@ -45,7 +49,7 @@
$message = '';
if (forum_update_post($post,$message)) {
add_to_log($post->course, "forum", "update post",
add_to_log($course->id, "forum", "update post",
"discuss.php?d=$post->discussion&parent=$post->id", "$post->id", $cm->id);
$timemessage = 2;
@@ -68,7 +72,7 @@
$message = '';
if ($post->id = forum_add_new_post($post,$message)) {
add_to_log($post->course, "forum", "add post",
add_to_log($course->id, "forum", "add post",
"discuss.php?d=$post->discussion&parent=$post->id", "$post->id", $cm->id);
$timemessage = 2;
@@ -95,7 +99,7 @@
$message = '';
if ($discussion->id = forum_add_discussion($discussion,$message)) {
add_to_log($post->course, "forum", "add discussion",
add_to_log($course->id, "forum", "add discussion",
"discuss.php?d=$discussion->id", "$discussion->id", $cm->id);
$timemessage = 2;

0 comments on commit f7abd64

Please sign in to comment.
You can’t perform that action at this time.