* Reorganised the includes directory, creating subdirectories db, parser and specials
[lhc/web/wiklou.git] / includes / specials / Uncategorizedpages.php
1 <?php
2 /**
3 * @file
4 * @ingroup SpecialPage
5 */
6
7 /**
8 * A special page looking for page without any category.
9 * @ingroup SpecialPage
10 */
11 class UncategorizedPagesPage extends PageQueryPage {
12 var $requestedNamespace = NS_MAIN;
13
14 function getName() {
15 return "Uncategorizedpages";
16 }
17
18 function sortDescending() {
19 return false;
20 }
21
22 function isExpensive() {
23 return true;
24 }
25 function isSyndicated() { return false; }
26
27 function getSQL() {
28 $dbr = wfGetDB( DB_SLAVE );
29 list( $page, $categorylinks ) = $dbr->tableNamesN( 'page', 'categorylinks' );
30 $name = $dbr->addQuotes( $this->getName() );
31
32 return
33 "
34 SELECT
35 $name as type,
36 page_namespace AS namespace,
37 page_title AS title,
38 page_title AS value
39 FROM $page
40 LEFT JOIN $categorylinks ON page_id=cl_from
41 WHERE cl_from IS NULL AND page_namespace={$this->requestedNamespace} AND page_is_redirect=0
42 ";
43 }
44 }
45
46 /**
47 * constructor
48 */
49 function wfSpecialUncategorizedpages() {
50 list( $limit, $offset ) = wfCheckLimits();
51
52 $lpp = new UncategorizedPagesPage();
53
54 return $lpp->doQuery( $offset, $limit );
55 }