Following query failed:
SELECT count(id) as count FROM 6_mesg WHERE top_id = 0 AND topic_queue != 'on' AND topic_hidden != 'on' ORDER BY topic_pin DESC, ASC