diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-11-26 23:06:35 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-26 23:06:35 +0000 |
commit | 91b1c4cf39c0b9ac6d2a0134bfc771e46d42e3dc (patch) | |
tree | a5b96ecdf749da367f3de7b445ae29b7a53d935d /modules | |
parent | 974f9f778891bbefeb083b2d97b3dae206c96452 (diff) |
Skip the tags block if there're no tags
Diffstat (limited to 'modules')
-rw-r--r-- | modules/tag/helpers/tag_block.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/tag/helpers/tag_block.php b/modules/tag/helpers/tag_block.php index 986584f0..1576ac08 100644 --- a/modules/tag/helpers/tag_block.php +++ b/modules/tag/helpers/tag_block.php @@ -26,12 +26,14 @@ class tag_block_Core { $block->content = new View("tag_block.html"); $tags = tag::popular_tags(30)->as_array(); - $block->content->max_count = $tags[0]->count; + if ($tags) { + $block->content->max_count = $tags[0]->count; - usort($tags, array("tag_block", "sort_by_name")); - $block->content->tags = $tags; + usort($tags, array("tag_block", "sort_by_name")); + $block->content->tags = $tags; - return $block; + return $block; + } } public static function sort_by_name($tag1, $tag2) { |