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

by Neil | 05.12.03 08:32 AM

Since Brad is the author of the plugin, you will probably need to contact him about this. I'm not a Perl coder. =)

by girlie | 05.12.03 06:01 PM

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

TrackBack: 0
(URL: http://www.thegirliematters.com/sf/mt-track.cgi/140)