diff --git a/lang/en_utf8/tag.php b/lang/en_utf8/tag.php index bb744c4d5342a..64561e5ac005a 100644 --- a/lang/en_utf8/tag.php +++ b/lang/en_utf8/tag.php @@ -12,6 +12,7 @@ $string['flagasinappropriate'] = 'Flag as inappropriate'; $string['helprelatedtags'] = 'Comma separated related tags'; $string['id'] = 'id'; +$string['lasttenblogs'] = 'Last 10 blogs'; $string['managetags'] = 'Manage tags'; $string['name'] = 'Tag name'; $string['namesalreadybeeingused'] = 'Tag names already being used'; diff --git a/tag/index.php b/tag/index.php index e4aed35909f94..041a9aac30f26 100644 --- a/tag/index.php +++ b/tag/index.php @@ -83,8 +83,24 @@ } -echo ''; +// print last 10 blogs +print_string('lasttenblogs', 'tag'); + +print_box_start(); + +// I was not able to use get_items_tagged_with() because it automatically +// tries to join on 'blog' table, since the itemtype is 'blog'. However blogs +// uses the post table so this would not really work. +if ($blogs = fetch_entries('', 10, 0, 'site', '', $tag->id)) { + + foreach ($blogs as $blog) { + blog_print_entry($blog); + } +} +print_box_end(); + +echo ''; //----------------- right column ----------------- diff --git a/tag/lib.php b/tag/lib.php index bb9ef7b5d2739..033d47138b081 100644 --- a/tag/lib.php +++ b/tag/lib.php @@ -1581,11 +1581,13 @@ function print_tag_management_list($perpage='100') { {$sort} "; - $totalcount = count_records('tag'); - $table->initialbars($totalcount > $perpage); - $table->pagesize($perpage, $totalcount); + $totalcount = count_records_sql("SELECT COUNT(DISTINCT(tg.id)) + FROM {$CFG->prefix}tag tg LEFT JOIN {$CFG->prefix}user u ON u.id = tg.userid + $where"); + $table->initialbars(true); // always initial bars + $table->pagesize($perpage, $totalcount); echo '