tips and tricks for movable type
forced category sort by number of entries
February 15, 2003
Yet another bit of Brenna-code using Brad Choate's MySQL plugin - this one gives you a list of your categories, sorted by number of entries in each category.
<MTSQLCategories query="SELECT category_id, COUNT(*) AS number FROM mt_category,mt_placement, mt_entry WHERE (category_blog_id=1) and (placement_entry_id=entry_id) and (entry_status=2) and (placement_category_id=category_id) GROUP BY category_label ORDER BY number DESC"><MTCategoryLabel> <MTSQLColumn column="number"> <br /></MTSQLCategories>
From this MT support forum thread.
Comments
I am trying to get the forced category sort by number of entries posted on February 15, 2003 but I am getting this rebuild error.
I have installed two plugins from Bradchoate, SQL Plugin and SQL Authors.
An error occurred:
Can't get DBI::st=HASH(0x83d5bd0)->{NAME_hash}: unrecognised attribute at
extlib/bradchoate/sql.pm line 339.
Thanks for your help
Neil
Since Brad is the author of the plugin, you will probably need to contact him about this. I'm not a Perl coder. =)