Limit squid purging
[lhc/web/wiklou.git] / includes / SpecialCategories.php
1 <?php
2
3 require_once("QueryPage.php");
4
5 class CategoriesPage extends QueryPage {
6
7 function getName() {
8 return "Categories";
9 }
10
11 function isExpensive() {
12 return false;
13 }
14
15 function getSQL() {
16 $NScat = NS_CATEGORY;
17 return "SELECT DISTINCT 'Categories' as type,
18 {$NScat} as namespace,
19 cl_to as title,
20 1 as value
21 FROM categorylinks";
22 }
23
24 function sortDescending() {
25 return false;
26 }
27
28 function formatResult( $skin, $result ) {
29 global $wgLang;
30 $title = Title::makeTitle( NS_CATEGORY, $result->title );
31 return $skin->makeLinkObj( $title, $title->getText() );
32 }
33 }
34
35 function wfSpecialCategories()
36 {
37 list( $limit, $offset ) = wfCheckLimits();
38
39 $cap = new CategoriesPage();
40
41 return $cap->doQuery( $offset, $limit );
42 }
43
44 ?>