Skip to content

Commit

Permalink
fixed an issue where when the user has no personal tags defined, he/s…
Browse files Browse the repository at this point in the history
…he sees an empty line in tags page
  • Loading branch information
toyomoyo committed Apr 21, 2006
1 parent a80722b commit 1d27654
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions blog/tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,14 @@
<select name="tags[]" multiple="multiple" size="8">
<?php
$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');;
$ptags = array_merge($ptags1, $ptags2);
$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 = $ptags2;
}

foreach ($ptags as $ptag) {
echo '<option value="'.$ptag->id.'">'.$ptag->text.'</option>';
}
Expand Down
2 changes: 1 addition & 1 deletion blog/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

// you can only delete your own tags, or you have to be an admin
if (!isadmin() and $USER->id != $blogtag->userid) {
notify('no right to delete');
notify(get_string('norighttodeletetag','blog', $blogtag->text));
continue;
}

Expand Down

0 comments on commit 1d27654

Please sign in to comment.