* Add exception hooks to output pretty messages
[lhc/web/wiklou.git] / includes / SpecialUncategorizedpages.php
old mode 100755 (executable)
new mode 100644 (file)
index 6c374d8..b26f6d9
@@ -1,8 +1,15 @@
 <?php
-
-require_once( "QueryPage.php" );
-
+/**
+ *
+ * @addtogroup SpecialPage
+ */
+
+/**
+ * A special page looking for page without any category.
+ * @addtogroup SpecialPage
+ */
 class UncategorizedPagesPage extends PageQueryPage {
+       var $requestedNamespace = NS_MAIN;
 
        function getName() {
                return "Uncategorizedpages";
@@ -15,17 +22,30 @@ class UncategorizedPagesPage extends PageQueryPage {
        function isExpensive() {
                return true;
        }
-       
-       function getSQL() {
-               $dbr =& wfGetDB( DB_SLAVE );
-               extract( $dbr->tableNames( 'cur', 'categorylinks' ) );
+       function isSyndicated() { return false; }
 
-               return "SELECT 'Uncategorizedpages' as type, cur_namespace AS namespace, cur_title AS title, cur_title AS value " .
-                       "FROM $cur LEFT JOIN $categorylinks ON cur_id=cl_to ".
-                       "WHERE cl_to IS NULL AND cur_namespace=0 AND cur_is_redirect=0";
+       function getSQL() {
+               $dbr = wfGetDB( DB_SLAVE );
+               list( $page, $categorylinks ) = $dbr->tableNamesN( 'page', 'categorylinks' );
+               $name = $dbr->addQuotes( $this->getName() );
+
+               return
+                       "
+                       SELECT
+                               $name as type,
+                               page_namespace AS namespace,
+                               page_title AS title,
+                               page_title AS value
+                       FROM $page
+                       LEFT JOIN $categorylinks ON page_id=cl_from
+                       WHERE cl_from IS NULL AND page_namespace={$this->requestedNamespace} AND page_is_redirect=0
+                       ";
        }
 }
 
+/**
+ * constructor
+ */
 function wfSpecialUncategorizedpages() {
        list( $limit, $offset ) = wfCheckLimits();
 
@@ -34,4 +54,4 @@ function wfSpecialUncategorizedpages() {
        return $lpp->doQuery( $offset, $limit );
 }
 
-?>
+