$this->content->text = '';
return $this->content;
}
-
- if ($CFG->bloglevel < 5 && !isstudent($course->id) && !isteacher($course->id)) {
+
+ // don't display menu block if block is set at site level, and user is not logged in
+ if ($CFG->bloglevel < 5 && !(isloggedin() && !isguest())) {
$this->content->text = '';
return $this->content;
}
}
-
-
$pageNavigation = 'edit';
include($CFG->dirroot .'/blog/header.php');
if ( update_record('post',$blogEntry)) {
delete_records('blog_tag_instance', 'entryid', $blogEntry->id);
- $otags = optional_param('otags','', PARAM_INT);
- $ptags = optional_param('ptags','', PARAM_INT);
-
$tag = NULL;
$tag->entryid = $blogEntry->id;
$tag->userid = $USER->id;
$tag->timemodified = time();
/// Add tags information
- foreach ($otags as $otag) {
- $tag->tagid = $otag;
- insert_record('blog_tag_instance',$tag);
+ if ($otags = optional_param('otags','', PARAM_INT)) {
+ foreach ($otags as $otag) {
+ $tag->tagid = $otag;
+ insert_record('blog_tag_instance',$tag);
+ }
}
- foreach ($ptags as $ptag) {
- $tag->tagid = $ptag;
- insert_record('blog_tag_instance',$tag);
+ if ($ptags = optional_param('ptags','', PARAM_INT)) {
+ foreach ($ptags as $ptag) {
+ $tag->tagid = $ptag;
+ insert_record('blog_tag_instance',$tag);
+ }
}
// only do pings if the entry is published to the world
</table>
<?php
-if (isset($course)) {
+
+if (isset($course) && ($course->id)) {
print_footer($course);
} else {
print_footer();
}
-?>
\ No newline at end of file
+?>
redirect($CFG->wwwroot.'/index.php');
}
-if ($courseid == 0 ) {
- $courseid = SITEID;
-}
-
// now check that they are logged in and allowed into the course (if specified)
if ($courseid != SITEID) {
- if (! $course = get_record('course', 'id', $courseid)) {
+ if (!$course = get_record('course', 'id', $courseid)) {
error('The course number was incorrect ('. $courseid .')');
}
require_login($course->id);
+} else {
+ $course = get_site();
}
// Bounds for block widths within this page
$limit = optional_param('limit', 0, PARAM_INT);
$start = optional_param('formstart', 0, PARAM_INT);
$userid = optional_param('userid',0,PARAM_INT);
-$courseid = optional_param('courseid',0,PARAM_INT);
+$courseid = optional_param('courseid',SITEID,PARAM_INT);
$tag = s(urldecode(optional_param('tag', '', PARAM_NOTAGS)));
$tagid = optional_param('tagid', 0, PARAM_INT);
$postid = optional_param('postid',0,PARAM_INT);
/// Start printing of the blog
- echo '<div align="center"><table cellspacing="0" class="forumpost blogpost blog'.$template['publishstate'].'" width="100%">';
+ echo '<table cellspacing="0" class="forumpost blogpost blog'.$template['publishstate'].'" width="100%">';
echo '<tr class="header"><td class="picture left">';
print_user_picture($template['userid'], SITEID, $user->picture);
echo '</div>';
- echo '</td></tr></table></div>'."\n\n";
+ echo '</td></tr></table>'."\n\n";
}