summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialUnusedimages.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
committerPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
commit72e90545454c0e014318fa3c81658e035aac58c1 (patch)
tree9212e3f46868989c4d57ae9a5c8a1a80e4dc0702 /includes/specials/SpecialUnusedimages.php
parent565a0ccc371ec1a2a0e9b39487cbac18e6f60e25 (diff)
applying patch to version 1.15.0
Diffstat (limited to 'includes/specials/SpecialUnusedimages.php')
-rw-r--r--includes/specials/SpecialUnusedimages.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/includes/specials/SpecialUnusedimages.php b/includes/specials/SpecialUnusedimages.php
index 4adf405d..fa66555d 100644
--- a/includes/specials/SpecialUnusedimages.php
+++ b/includes/specials/SpecialUnusedimages.php
@@ -22,13 +22,17 @@ class UnusedimagesPage extends ImageQueryPage {
function isSyndicated() { return false; }
function getSQL() {
- global $wgCountCategorizedImagesAsUsed;
+ global $wgCountCategorizedImagesAsUsed, $wgDBtype;
$dbr = wfGetDB( DB_SLAVE );
+ $epoch = $wgDBtype == 'mysql' ?
+ 'UNIX_TIMESTAMP(img_timestamp)' :
+ 'EXTRACT(epoch FROM img_timestamp)';
+
if ( $wgCountCategorizedImagesAsUsed ) {
list( $page, $image, $imagelinks, $categorylinks ) = $dbr->tableNamesN( 'page', 'image', 'imagelinks', 'categorylinks' );
- return "SELECT 'Unusedimages' as type, 6 as namespace, img_name as title, img_timestamp as value,
+ return "SELECT 'Unusedimages' as type, 6 as namespace, img_name as title, $epoch as value,
img_user, img_user_text, img_description
FROM ((($page AS I LEFT JOIN $categorylinks AS L ON I.page_id = L.cl_from)
LEFT JOIN $imagelinks AS P ON I.page_title = P.il_to)
@@ -37,14 +41,14 @@ class UnusedimagesPage extends ImageQueryPage {
} else {
list( $image, $imagelinks ) = $dbr->tableNamesN( 'image','imagelinks' );
- return "SELECT 'Unusedimages' as type, 6 as namespace, img_name as title, img_timestamp as value,
+ return "SELECT 'Unusedimages' as type, 6 as namespace, img_name as title, $epoch as value,
img_user, img_user_text, img_description
FROM $image LEFT JOIN $imagelinks ON img_name=il_to WHERE il_to IS NULL ";
}
}
function getPageHeader() {
- return wfMsgExt( 'unusedimagestext', array( 'parse') );
+ return wfMsgExt( 'unusedimagestext', array( 'parse' ) );
}
}