array ( 'page', 'categorylinks' ), 'fields' => array ( 'page_namespace AS namespace', 'page_title AS title', 'page_title AS value' ), 'conds' => array ( 'cl_from IS NULL', 'page_namespace' => NS_CATEGORY, 'page_is_redirect' => 0 ), 'join_conds' => array ( 'categorylinks' => array ( 'LEFT JOIN', 'cl_to = page_title' ) ) ); } /** * A should come before Z (bug 30907) */ function sortDescending() { return false; } function formatResult( $skin, $result ) { $title = Title::makeTitle( NS_CATEGORY, $result->title ); return $skin->link( $title, $title->getText() ); } }