diff options
Diffstat (limited to 'includes/specials/SpecialUnusedimages.php')
-rw-r--r-- | includes/specials/SpecialUnusedimages.php | 12 |
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' ) ); } } |