// If no post is given, displays all posts in a discussion
require_once("../../config.php");
- require_once("lib.php");
-
+
$d = required_param('d', PARAM_INT); // Discussion ID
$parent = optional_param('parent', 0, PARAM_INT); // If set, then display this post and all children.
$mode = optional_param('mode', 0, PARAM_INT); // If set, changes the layout of the thread
if (!$cm = get_coursemodule_from_instance('forum', $forum->id, $course->id)) {
error('Course Module ID was incorrect');
}
-
+ // move this down fix for MDL-6926
+ require_once("lib.php");
require_course_login($course, false, $cm);
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
}
-
/// Print the controls across the top
echo '<table width="100%"><tr><td width="33%">';
* @param $forumtype - optional
*/
function forum_print_mode_form($id, $mode, $forumtype='') {
- $FORUM_LAYOUT_MODES = array ( FORUM_MODE_FLATOLDEST => get_string('modeflatoldestfirst', 'forum'),
- FORUM_MODE_FLATNEWEST => get_string('modeflatnewestfirst', 'forum'),
- FORUM_MODE_THREADED => get_string('modethreaded', 'forum'),
- FORUM_MODE_NESTED => get_string('modenested', 'forum') );
+ global $FORUM_LAYOUT_MODES;
echo "<div align=\"center\">";
if ($forumtype == 'single') {