PHPDocumentor [http://en.wikipedia.org/wiki/PhpDocumentor] documentation tweaking...
[lhc/web/wiklou.git] / includes / SpecialAncientpages.php
index c847e1e..4b52b6a 100644 (file)
@@ -1,19 +1,12 @@
 <?php
 /**
  *
- * @package MediaWiki
- * @subpackage SpecialPage
+ * @addtogroup SpecialPage
  */
 
 /**
- *
- */
-require_once( 'QueryPage.php' );
-
-/**
- *
- * @package MediaWiki
- * @subpackage SpecialPage
+ * @todo document, briefly.
+ * @addtogroup SpecialPage
  */
 class AncientPagesPage extends QueryPage {
 
@@ -22,26 +15,29 @@ class AncientPagesPage extends QueryPage {
        }
 
        function isExpensive() {
-               return parent::isExpensive() ;
+               return true;
        }
-       
+
        function isSyndicated() { return false; }
 
        function getSQL() {
-               $db =& wfGetDB( DB_SLAVE );
+               global $wgDBtype;
+               $db = wfGetDB( DB_SLAVE );
                $page = $db->tableName( 'page' );
                $revision = $db->tableName( 'revision' );
                #$use_index = $db->useIndexClause( 'cur_timestamp' ); # FIXME! this is gone
+               $epoch = $wgDBtype == 'mysql' ? 'UNIX_TIMESTAMP(rev_timestamp)' :
+                       'EXTRACT(epoch FROM rev_timestamp)';
                return
                        "SELECT 'Ancientpages' as type,
                                        page_namespace as namespace,
                                page_title as title,
-                               rev_timestamp as value
+                               $epoch as value
                        FROM $page, $revision
-                       WHERE page_namespace=0 AND page_is_redirect=0
+                       WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0
                          AND page_latest=rev_id";
        }
-       
+
        function sortDescending() {
                return false;
        }
@@ -50,8 +46,9 @@ class AncientPagesPage extends QueryPage {
                global $wgLang, $wgContLang;
 
                $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true );
-               $link = $skin->makeKnownLink( $result->title, $wgContLang->convert( $result->title) );
-               return "{$link} ({$d})";
+               $title = Title::makeTitle( $result->namespace, $result->title );
+               $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
+               return wfSpecialList($link, $d);
        }
 }