diff --git a/blog/header.php b/blog/header.php
index 9de0bb6f819..aab76ac9e8a 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());