Reverting r16861; incompatible change to message texts, breaks a lot of toggle displa...
[lhc/web/wiklou.git] / includes / SpecialAncientpages.php
index a9a4231..39a3c8e 100644 (file)
@@ -5,11 +5,6 @@
  * @subpackage SpecialPage
  */
 
-/**
- *
- */
-require_once( 'QueryPage.php' );
-
 /**
  *
  * @package MediaWiki
@@ -24,24 +19,27 @@ class AncientPagesPage extends QueryPage {
        function isExpensive() {
                return true;
        }
-       
+
        function isSyndicated() { return false; }
 
        function getSQL() {
+               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,
-                               UNIX_TIMESTAMP(rev_timestamp) as value
+                               $epoch as value
                        FROM $page, $revision
                        WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0
                          AND page_latest=rev_id";
        }
-       
+
        function sortDescending() {
                return false;
        }
@@ -51,8 +49,8 @@ class AncientPagesPage extends QueryPage {
 
                $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true );
                $title = Title::makeTitle( $result->namespace, $result->title );
-               $link = $skin->makeKnownLinkObj( $title, $wgContLang->convert( $title->getPrefixedText() ) );
-               return "{$link} ({$d})";
+               $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
+               return wfSpecialList($link, $d);
        }
 }