r6562 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r6561‎ | r6562 | r6563 >
Date:21:19, 7 December 2004
Author:jeluf
Status:old
Tags:
Comment:
(bug 1024) Fix link to high-res image version on Image: pages
Modified paths:
  • /trunk/phase3/includes/ImagePage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImagePage.php
@@ -43,7 +43,7 @@
4444 global $wgOut, $wgUser, $wgImageLimits, $wgRequest,
4545 $wgUseImageResize, $wgRepositoryBaseUrl;
4646 $this->img = Image::newFromTitle( $this->mTitle );
47 - $url = $this->img->getViewURL();
 47+ $full_url = $this->img->getViewURL();
4848 $anchoropen = '';
4949 $anchorclose = '';
5050 if ( $wgUseImageResize ) {
@@ -71,26 +71,25 @@
7272 $height = $this->img->getHeight();
7373 $msg = wfMsg('showbigimage', $width, $height, intval( $this->img->getSize()/1024 ) );
7474 if ( $width > $maxWidth && $wgUseImageResize ) {
75 - $anchoropen = "<a href=\"{$url}\">";
76 - $anchorclose = "<br>{$msg}</a>";
77 -
78 - $url = $this->img->createThumb( $maxWidth );
7975 $height = floor( $height * $maxWidth / $width );
8076 $width = $maxWidth;
8177 }
8278 if ( $height > $maxHeight && $wgUseImageResize ) {
83 - $anchoropen = "<a href=\"{$url}\">";
84 - $anchorclose = "<br>{$msg}</a>";
85 -
8679 $width = floor( $width * $maxHeight / $height );
8780 $height = $maxHeight;
 81+ }
 82+ if ( $width != $this->img->getWidth() || $height != $this->img->getHeight() ) {
8883 $url = $this->img->createThumb( $width );
 84+ $anchoropen = "<a href=\"{$full_url}\">";
 85+ $anchorclose = "<br>{$msg}</a>";
 86+ } else {
 87+ $url = $full_url;
8988 }
90 - $s = "<div class=\"fullImageLink\">" . $anchoropen .
 89+ $s = '<div class="fullImageLink">' . $anchoropen .
9190 "<img border=\"0\" src=\"{$url}\" width=\"{$width}\" height=\"{$height}\" alt=\"" .
92 - htmlspecialchars( $wgRequest->getVal( 'image' ) )."\" />" . $anchorclose . "</div>";
 91+ htmlspecialchars( $wgRequest->getVal( 'image' ) ).'" />' . $anchorclose . '</div>';
9392 } else {
94 - $s = "<div class=\"fullMedia\">".$sk->makeMediaLink($this->img->getName(),"")."</div>";
 93+ $s = "<div class=\"fullMedia\">" . $sk->makeMediaLink( $this->img->getName(),'' ) . '</div>';
9594 }
9695 $wgOut->addHTML( $s );
9796 if($this->img->fromSharedDirectory) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r6561(bug 1024) Fix link to high-res image version on Image: pagesjeluf21:09, 7 December 2004

Status & tagging log