comment about extranamespaces values that should not be >255
[lhc/web/wiklou.git] / includes / SpecialShortpages.php
index c3eafc4..3faf483 100644 (file)
@@ -1,11 +1,21 @@
 <?php
-#
-# SpecialShortpages extends QueryPage. It is used to return the shortest
-# pages in the database.
-#
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
 
+/**
+ *
+ */
 require_once("QueryPage.php");
 
+/**
+ * SpecialShortpages extends QueryPage. It is used to return the shortest
+ * pages in the database.
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
 class ShortPagesPage extends QueryPage {
 
        function getName() {
@@ -15,14 +25,19 @@ class ShortPagesPage extends QueryPage {
        function isExpensive() {
                return true;
        }
+       function isSyndicated() { return false; }
 
        function getSQL() {
+               $dbr =& wfGetDB( DB_SLAVE );
+               $cur = $dbr->tableName( 'cur' );
+               $name = $dbr->addQuotes( $this->getName() );
+               
                return
-                       "SELECT 'Shortpages' as type,
+                       "SELECT $name as type,
                                        cur_namespace as namespace,
                                cur_title as title,
                                LENGTH(cur_text) AS value
-                       FROM cur
+                       FROM $cur
                        WHERE cur_namespace=0 AND cur_is_redirect=0";
        }
        
@@ -31,13 +46,16 @@ class ShortPagesPage extends QueryPage {
        }
 
        function formatResult( $skin, $result ) {
-               global $wgLang;
+               global $wgLang, $wgContLang;
                $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->value ) );
-               $link = $skin->makeKnownLink( $result->title, "" );
+               $link = $skin->makeKnownLink( $result->title, $wgContLang->convert( $result->title ) );
                return "{$link} ({$nb})";
        }
 }
 
+/**
+ * constructor
+ */
 function wfSpecialShortpages() {
        list( $limit, $offset ) = wfCheckLimits();