From 91b1c4cf39c0b9ac6d2a0134bfc771e46d42e3dc Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 26 Nov 2008 23:06:35 +0000 Subject: Skip the tags block if there're no tags --- modules/tag/helpers/tag_block.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'modules') 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) { -- cgit v1.2.3