From 40b6323cd08a1c06d67b6f22fc4b65d588bab8bb Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Thu, 16 Mar 2006 02:01:55 +0000 Subject: [PATCH] fixed a bug where using tag to search blogs, nav menu is not working --- blog/header.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/blog/header.php b/blog/header.php index 9de0bb6f81..aab76ac9e8 100755 --- a/blog/header.php +++ b/blog/header.php @@ -61,10 +61,15 @@ else { $PAGE->courseid = $courseid; $PAGE->init_full(); //init the BlogInfo object and the courserecord object -if (isset($tagid)) { +if (isset($tagid) && $tagid) { $taginstance = get_record('tags', 'id', $tagid); } else { $tagid = ''; + if (isset($tag) && $tag) { + $tagrec = get_record('tags', 'text', $tag); + $tagid = $tagrec->id; + $taginstance = get_record('tags', 'id', $tagid); + } } if (!isset($filtertype)) { $filtertype = 'user'; @@ -81,7 +86,7 @@ $tagstring = get_string('tag'); switch ($filtertype) { case 'site': - if ($tagid) { + if ($tagid || (isset($tag) && $tag)) { print_header("$site->shortname: $blogstring", "$site->fullname", ''. "$blogstring -> $tagstring: $taginstance->text",'','',true,$PAGE->get_extra_header_string()); } else { @@ -91,7 +96,7 @@ switch ($filtertype) { break; case 'course': - if ($tagid) { + if ($tagid || (isset($tag) && $tag)) { print_header("$course->shortname: $blogstring", "$course->fullname", ''.$course->shortname.' -> '. "$blogstring -> $tagstring: $taginstance->text",'','',true,$PAGE->get_extra_header_string()); @@ -106,7 +111,7 @@ switch ($filtertype) { $thisgroup = get_record('groups', 'id', $filterselect); - if ($tagid) { + if ($tagid || (isset($tag) && $tag)) { print_header("$course->shortname: $blogstring", "$course->fullname", ''.$course->shortname.' -> '.$thisgroup->name.' -> @@ -126,7 +131,7 @@ switch ($filtertype) { $participants = get_string('participants'); if (isset($course->id) && $course->id && $course->id != SITEID) { - if ($tagid) { + if ($tagid || (isset($tag) && $tag)) { print_header("$course->shortname: $blogstring", "$course->fullname", ''.$course->shortname.' -> '.$participants.' -> @@ -146,7 +151,7 @@ switch ($filtertype) { //in top view else { - if ($tagid) { + if ($tagid || (isset($tag) && $tag)) { print_header("$site->shortname: $blogstring", "$site->fullname", ''.fullname($user).' -> '. "$blogstring -> $tagstring: $taginstance->text",'','',true,$PAGE->get_extra_header_string()); -- 2.39.5