00001 <?php 00002 00003 require_once("QueryPage.php"); 00004 00005 class CategoriesPage extends QueryPage { 00006 00007 function getName() { 00008 return "Categories"; 00009 } 00010 00011 function isExpensive() { 00012 return false; 00013 } 00014 00015 function getSQL() { 00016 $NScat = NS_CATEGORY; 00017 return "SELECT DISTINCT 'Categories' as type, 00018 {$NScat} as namespace, 00019 cl_to as title, 00020 1 as value 00021 FROM categorylinks"; 00022 } 00023 00024 function sortDescending() { 00025 return false; 00026 } 00027 00028 function formatResult( $skin, $result ) { 00029 global $wgLang; 00030 $title = Title::makeTitle( NS_CATEGORY, $result->title ); 00031 return $skin->makeLinkObj( $title, $title->getText() ); 00032 } 00033 } 00034 00035 function wfSpecialCategories() 00036 { 00037 list( $limit, $offset ) = wfCheckLimits(); 00038 00039 $cap = new CategoriesPage(); 00040 00041 return $cap->doQuery( $offset, $limit ); 00042 } 00043 00044 ?>