From f69f1b498a09d0ee43baa6c8790c8bb6e63c644e Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Thu, 27 Apr 2006 02:34:16 +0000 Subject: [PATCH] trying to fix bug 5266 --- blog/tags.html | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/blog/tags.html b/blog/tags.html index a4c60cc186..99d1b9eb51 100755 --- a/blog/tags.html +++ b/blog/tags.html @@ -44,14 +44,22 @@ print_heading(get_string('tagmanagement')); $ptags1 = get_records_sql('SELECT * from '.$CFG->prefix.'tags WHERE type=\'personal\' AND userid = '.$USER->id.' ORDER by text ASC'); $ptags2 = get_records_sql('SELECT * from '.$CFG->prefix.'tags WHERE type=\'personal\' AND userid <> '.$USER->id.' ORDER by text ASC'); - if (!empty($ptags1)) { - $ptags = array_merge($ptags1, $ptags2); - } else { + $ptags = array(); + + if (!empty($ptags1)) { // user's own tag exists + if (!empty($ptags2)) { // user's own tags, and other users tags exist, we merge + $ptags = array_merge($ptags1, $ptags2); + } else { // user's own tags exist, no other personal tags, just use that + $ptags = $ptags1; + } + } else if (!empty($ptags2)) { $ptags = $ptags2; - } + } - foreach ($ptags as $ptag) { - echo ''; + if (!empty($ptags)) { + foreach ($ptags as $ptag) { + echo ''; + } } ?> -- 2.39.5