From e373706cc66ebb645eedcd29cd65369b6fc3832c Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 12 Jul 2009 05:37:12 +0000 Subject: [PATCH] Added $wgShowArchiveThumbnails, may be useful for file store backend load reduction. --- RELEASE-NOTES | 2 ++ includes/DefaultSettings.php | 5 +++++ includes/ImagePage.php | 11 +++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 374c17c281..18805ddfe2 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -122,6 +122,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Removed name attribute from . * Parser::setFunctionTagHook now can be used to add a new tag which is parsed at preprocesor level. +* Added $wgShowArchiveThumbnails, allowing sysadmins to disable thumbnail + display for old versions of images. === Bug fixes in 1.16 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 9ed3d5e900..5e9811f982 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2190,6 +2190,11 @@ $wgIgnoreImageErrors = false; */ $wgGenerateThumbnailOnParse = true; +/** + * Show thumbnails for old images on the image description page + */ +$wgShowArchiveThumbnails = true; + /** Whether or not to use image resizing */ $wgUseImageResize = true; diff --git a/includes/ImagePage.php b/includes/ImagePage.php index a02ba6ce6c..ccfd01d60d 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -780,15 +780,16 @@ EOT */ class ImageHistoryList { - protected $imagePage, $img, $skin, $title, $repo; + protected $imagePage, $img, $skin, $title, $repo, $showThumb; public function __construct( $imagePage ) { - global $wgUser; + global $wgUser, $wgShowArchiveThumbnails; $this->skin = $wgUser->getSkin(); $this->current = $imagePage->getFile(); $this->img = $imagePage->getDisplayedFile(); $this->title = $imagePage->getTitle(); $this->imagePage = $imagePage; + $this->showThumb = $wgShowArchiveThumbnails; } public function getImagePage() { @@ -813,7 +814,7 @@ class ImageHistoryList { . '' . ( $this->current->isLocal() && ($wgUser->isAllowed('delete') || $wgUser->isAllowed('deleterevision') ) ? '' : '' ) . '' . wfMsgHtml( 'filehist-datetime' ) . '' - . '' . wfMsgHtml( 'filehist-thumb' ) . '' + . ( $this->showThumb ? '' . wfMsgHtml( 'filehist-thumb' ) . '' : '' ) . '' . wfMsgHtml( 'filehist-dimensions' ) . '' . '' . wfMsgHtml( 'filehist-user' ) . '' . '' . wfMsgHtml( 'filehist-comment' ) . '' @@ -933,7 +934,9 @@ class ImageHistoryList { $row .= ""; // Thumbnail - $row .= '' . $this->getThumbForLine( $file ) . ''; + if ( $this->showThumb ) { + $row .= '' . $this->getThumbForLine( $file ) . ''; + } // Image dimensions + size $row .= ''; -- 2.20.1