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/SpecialUnusedimages.php | |
parent | 00ab76a6b686e98a914afc1975812d2b1aaa7016 (diff) |
update to MediaWiki 1.16.0
Diffstat (limited to 'includes/specials/SpecialUnusedimages.php')
-rw-r--r-- | includes/specials/SpecialUnusedimages.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/includes/specials/SpecialUnusedimages.php b/includes/specials/SpecialUnusedimages.php index fa66555d..9d9868f6 100644 --- a/includes/specials/SpecialUnusedimages.php +++ b/includes/specials/SpecialUnusedimages.php @@ -25,9 +25,19 @@ class UnusedimagesPage extends ImageQueryPage { global $wgCountCategorizedImagesAsUsed, $wgDBtype; $dbr = wfGetDB( DB_SLAVE ); - $epoch = $wgDBtype == 'mysql' ? - 'UNIX_TIMESTAMP(img_timestamp)' : - 'EXTRACT(epoch FROM img_timestamp)'; + switch ($wgDBtype) { + case 'mysql': + $epoch = 'UNIX_TIMESTAMP(img_timestamp)'; + break; + case 'oracle': + $epoch = '((trunc(img_timestamp) - to_date(\'19700101\',\'YYYYMMDD\')) * 86400)'; + break; + case 'sqlite': + $epoch = 'img_timestamp'; + break; + default: + $epoch = 'EXTRACT(epoch FROM img_timestamp)'; + } if ( $wgCountCategorizedImagesAsUsed ) { list( $page, $image, $imagelinks, $categorylinks ) = $dbr->tableNamesN( 'page', 'image', 'imagelinks', 'categorylinks' ); |