some small fixes, mostly for 5174

This commit is contained in:
toyomoyo 2006-04-24 03:36:02 +00:00
parent ea21c1f460
commit 9fad492eb5
6 changed files with 22 additions and 23 deletions

View File

@ -19,8 +19,9 @@ class block_blog_menu extends block_base {
$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;
}

View File

@ -44,8 +44,6 @@ if (isset($act) && ($act == 'del') && (empty($blogEntry))) {
}
$pageNavigation = 'edit';
include($CFG->dirroot .'/blog/header.php');
@ -290,23 +288,24 @@ function do_update($post) {
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

View File

@ -20,9 +20,10 @@ if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
</table>
<?php
if (isset($course)) {
if (isset($course) && ($course->id)) {
print_footer($course);
} else {
print_footer();
}
?>
?>

View File

@ -19,16 +19,14 @@ if (!$site = get_site()) {
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

View File

@ -19,7 +19,7 @@ $id = optional_param('id', 0, PARAM_INT);
$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);

View File

@ -182,7 +182,7 @@
/// 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);
@ -252,7 +252,7 @@
echo '</div>';
echo '</td></tr></table></div>'."\n\n";
echo '</td></tr></table>'."\n\n";
}