diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-07-28 11:52:48 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-07-28 11:52:48 +0200 |
commit | 222b01f5169f1c7e69762e0e8904c24f78f71882 (patch) | |
tree | 8e932e12546bb991357ec48eb1638d1770be7a35 /includes/specials/SpecialAncientpages.php | |
parent | 00ab76a6b686e98a914afc1975812d2b1aaa7016 (diff) |
update to MediaWiki 1.16.0
Diffstat (limited to 'includes/specials/SpecialAncientpages.php')
-rw-r--r-- | includes/specials/SpecialAncientpages.php | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/includes/specials/SpecialAncientpages.php b/includes/specials/SpecialAncientpages.php index 188ad914..92192435 100644 --- a/includes/specials/SpecialAncientpages.php +++ b/includes/specials/SpecialAncientpages.php @@ -25,8 +25,25 @@ class AncientPagesPage extends QueryPage { $db = wfGetDB( DB_SLAVE ); $page = $db->tableName( 'page' ); $revision = $db->tableName( 'revision' ); - $epoch = $wgDBtype == 'mysql' ? 'UNIX_TIMESTAMP(rev_timestamp)' : - 'EXTRACT(epoch FROM rev_timestamp)'; + + switch ($wgDBtype) { + case 'mysql': + $epoch = 'UNIX_TIMESTAMP(rev_timestamp)'; + break; + case 'ibm_db2': + // TODO implement proper conversion to a Unix epoch + $epoch = 'rev_timestamp'; + break; + case 'oracle': + $epoch = '((trunc(rev_timestamp) - to_date(\'19700101\',\'YYYYMMDD\')) * 86400)'; + break; + case 'sqlite': + $epoch = 'rev_timestamp'; + break; + default: + $epoch = 'EXTRACT(epoch FROM rev_timestamp)'; + } + return "SELECT 'Ancientpages' as type, page_namespace as namespace, @@ -46,8 +63,11 @@ class AncientPagesPage extends QueryPage { $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true ); $title = Title::makeTitle( $result->namespace, $result->title ); - $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); - return wfSpecialList($link, $d); + $link = $skin->linkKnown( + $title, + htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) + ); + return wfSpecialList($link, htmlspecialchars($d) ); } } |