mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-02 02:59:09 -04:00
Skip the tags block if there're no tags
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user