Tags plugin for Thoth.
Tags
Thoth
Gets an Array of the most heavily-used tags. The first element of the array is a Tag object, the second element is the number of times it's used.
Tag
# File lib/thoth/plugin/thoth_tags.rb, line 50 def top_tags(limit = 10) cache = Ramaze::Cache.plugin if tags = cache["top_tags_#{limit}"] return tags end tags = [] tag_ids = TagsPostsMap.group_and_count(:tag_id).reverse_order(:count). limit(limit) tag_ids.all {|row| tags << [Tag[row[:tag_id]], row[:count]] } cache.store("top_tags_#{limit}", tags, :ttl => Config.tags['cache_ttl']) end