Fix Special:Import for new schema; make it create page records as needed and hook...
[lhc/web/wiklou.git] / includes / SpecialAncientpages.php
index 91bd543..253c917 100644 (file)
@@ -24,18 +24,22 @@ class AncientPagesPage extends QueryPage {
        function isExpensive() {
                return parent::isExpensive() ;
        }
+       
+       function isSyndicated() { return false; }
 
        function getSQL() {
                $db =& wfGetDB( DB_SLAVE );
-               $cur = $db->tableName( 'cur' );
-               $use_index = $db->useIndexClause( 'cur_timestamp' );
+               $page = $db->tableName( 'page' );
+               $revision = $db->tableName( 'revision' );
+               #$use_index = $db->useIndexClause( 'cur_timestamp' ); # FIXME! this is gone
                return
                        "SELECT 'Ancientpages' as type,
-                                       cur_namespace as namespace,
-                               cur_title as title,
-                               cur_timestamp as value
-                       FROM $cur $use_index
-                       WHERE cur_namespace=0 AND cur_is_redirect=0";
+                                       page_namespace as namespace,
+                               page_title as title,
+                               rev_timestamp as value
+                       FROM $page, $revision
+                       WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0
+                         AND page_latest=rev_id";
        }
        
        function sortDescending() {
@@ -43,10 +47,10 @@ class AncientPagesPage extends QueryPage {
        }
 
        function formatResult( $skin, $result ) {
-               global $wgLang;
+               global $wgLang, $wgContLang;
 
-               $d = $wgLang->timeanddate( wfTimestamp( $result->value ), true );
-               $link = $skin->makeKnownLink( $result->title, "" );
+               $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true );
+               $link = $skin->makeKnownLink( $result->title, $wgContLang->convert( $result->title) );
                return "{$link} ({$d})";
        }
 }