8 if( !defined( 'MEDIAWIKI' ) )
12 * Special handling for image description pages
14 class ImagePage
extends Article
{
16 /* private */ var $img; // Image object this page is shown for
17 var $mExtraDescription = false;
20 * Handler for action=render
21 * Include body text only; none of the image extras
25 $wgOut->setArticleBodyOnly( true );
26 $wgOut->addSecondaryWikitext( $this->getContent() );
30 global $wgOut, $wgShowEXIF, $wgRequest, $wgUser;
32 $this->img
= new Image( $this->mTitle
);
34 $diff = $wgRequest->getVal( 'diff' );
35 $diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );
37 if ( $this->mTitle
->getNamespace() != NS_IMAGE ||
( isset( $diff ) && $diffOnly ) )
38 return Article
::view();
40 if ($wgShowEXIF && $this->img
->exists()) {
41 $exif = $this->img
->getExifData();
42 $showmeta = count($exif) ?
true : false;
48 if ($this->img
->exists())
49 $wgOut->addHTML($this->showTOC($showmeta));
51 $this->openShowImage();
53 # No need to display noarticletext, we use our own message, output in openShowImage()
54 if ( $this->getID() ) {
57 # Just need to set the right headers
58 $wgOut->setArticleFlag( true );
59 $wgOut->setRobotpolicy( 'index,follow' );
60 $wgOut->setPageTitle( $this->mTitle
->getPrefixedText() );
64 # Show shared description, if needed
65 if ( $this->mExtraDescription
) {
66 $fol = wfMsg( 'shareddescriptionfollows' );
68 $wgOut->addWikiText( $fol );
70 $wgOut->addHTML( '<div id="shared-image-desc">' . $this->mExtraDescription
. '</div>' );
73 $this->closeShowImage();
74 $this->imageHistory();
78 global $wgStylePath, $wgStyleVersion;
79 $expand = htmlspecialchars( wfEscapeJsString( wfMsg( 'metadata-expand' ) ) );
80 $collapse = htmlspecialchars( wfEscapeJsString( wfMsg( 'metadata-collapse' ) ) );
81 $wgOut->addHTML( Xml
::element( 'h2', array( 'id' => 'metadata' ), wfMsg( 'metadata' ) ). "\n" );
82 $wgOut->addWikiText( $this->makeMetadataTable( $exif ) );
84 "<script type=\"text/javascript\" src=\"$wgStylePath/common/metadata.js?$wgStyleVersion\"></script>\n" .
85 "<script type=\"text/javascript\">attachMetadataToggle('mw_metadata', '$expand', '$collapse');</script>\n" );
94 * @param bool $metadata Whether or not to show the metadata link
97 function showTOC( $metadata ) {
99 $r = '<ul id="filetoc">
100 <li><a href="#file">' . $wgLang->getNsText( NS_IMAGE
) . '</a></li>
101 <li><a href="#filehistory">' . wfMsgHtml( 'imghistory' ) . '</a></li>
102 <li><a href="#filelinks">' . wfMsgHtml( 'imagelinks' ) . '</a></li>' .
103 ($metadata ?
'<li><a href="#metadata">' . wfMsgHtml( 'metadata' ) . '</a></li>' : '') . '
109 * Make a table with metadata to be shown in the output page.
113 * @param array $exif The array containing the EXIF data
116 function makeMetadataTable( $exif ) {
117 $r = wfMsg( 'metadata-help' ) . "\n\n";
118 $r .= "{| id=mw_metadata class=mw_metadata\n";
119 $visibleFields = $this->visibleMetadataFields();
120 foreach( $exif as $k => $v ) {
121 $tag = strtolower( $k );
122 $msg = wfMsg( "exif-$tag" );
123 $class = "exif-$tag";
124 if( !in_array( $tag, $visibleFields ) ) {
125 $class .= ' collapsable';
127 $r .= "|- class=\"$class\"\n";
136 * Get a list of EXIF metadata items which should be displayed when
137 * the metadata table is collapsed.
139 * @return array of strings
142 function visibleMetadataFields() {
144 $lines = explode( "\n", wfMsgForContent( 'metadata-fields' ) );
145 foreach( $lines as $line ) {
147 if( preg_match( '/^\\*\s*(.*?)\s*$/', $line, $matches ) ) {
148 $fields[] = $matches[1];
155 * Overloading Article's getContent method.
157 * Omit noarticletext if sharedupload; text will be fetched from the
158 * shared upload server if possible.
160 function getContent() {
161 if( $this->img
&& $this->img
->fromSharedDirectory
&& 0 == $this->getID() ) {
164 return Article
::getContent();
167 function openShowImage() {
168 global $wgOut, $wgUser, $wgImageLimits, $wgRequest, $wgLang;
169 global $wgUseImageResize, $wgGenerateThumbnailOnParse;
171 $full_url = $this->img
->getURL();
174 $sizeSel = intval( $wgUser->getOption( 'imagesize') );
176 if( !isset( $wgImageLimits[$sizeSel] ) ) {
177 $sizeSel = User
::getDefaultOption( 'imagesize' );
179 $max = $wgImageLimits[$sizeSel];
181 $maxHeight = $max[1];
182 $sk = $wgUser->getSkin();
184 if ( $this->img
->exists() ) {
186 $page = $wgRequest->getIntOrNull( 'page' );
187 if ( ! is_null( $page ) ) {
188 $this->img
->selectPage( $page );
192 $width = $this->img
->getWidth();
193 $height = $this->img
->getHeight();
196 if ( $this->img
->allowInlineDisplay() and $width and $height) {
199 # "Download high res version" link below the image
200 $msg = wfMsgHtml('showbigimage', $width, $height, intval( $this->img
->getSize()/1024 ) );
202 # We'll show a thumbnail of this image
203 if ( $width > $maxWidth ||
$height > $maxHeight ) {
204 # Calculate the thumbnail size.
205 # First case, the limiting factor is the width, not the height.
206 if ( $width / $height >= $maxWidth / $maxHeight ) {
207 $height = round( $height * $maxWidth / $width);
209 # Note that $height <= $maxHeight now.
211 $newwidth = floor( $width * $maxHeight / $height);
212 $height = round( $height * $newwidth / $width );
214 # Note that $height <= $maxHeight now, but might not be identical
215 # because of rounding.
218 if( $wgUseImageResize ) {
219 $thumbnail = $this->img
->getThumbnail( $width, -1, $wgGenerateThumbnailOnParse );
220 if ( $thumbnail == null ) {
221 $url = $this->img
->getViewURL();
223 $url = $thumbnail->getURL();
226 # No resize ability? Show the full image, but scale
227 # it down in the browser so it fits on the page.
228 $url = $this->img
->getViewURL();
230 $anchoropen = "<a href=\"{$full_url}\">";
231 $anchorclose = "</a><br />";
232 if( $this->img
->mustRender() ) {
235 $anchorclose .= "\n$anchoropen{$msg}</a>";
238 $url = $this->img
->getViewURL();
242 if ( $this->img
->isMultipage() ) {
243 $wgOut->addHTML( '<table class="multipageimage"><tr><td>' );
246 $wgOut->addHTML( '<div class="fullImageLink" id="file">' . $anchoropen .
247 "<img border=\"0\" src=\"{$url}\" width=\"{$width}\" height=\"{$height}\" alt=\"" .
248 htmlspecialchars( $this->img
->getTitle()->getPrefixedText() ).'" />' . $anchorclose . '</div>' );
250 if ( $this->img
->isMultipage() ) {
251 $count = $this->img
->pageCount();
254 $label = $wgOut->parse( wfMsg( 'imgmultipageprev' ), false );
255 $link = $sk->makeLinkObj( $this->mTitle
, $label, 'page='. ($page-1) );
256 $this->img
->selectPage( $page - 1 );
257 $thumb1 = $sk->makeThumbLinkObj( $this->img
, $link, $label, 'none' );
262 if ( $page < $count ) {
263 $label = wfMsg( 'imgmultipagenext' );
264 $this->img
->selectPage( $page +
1 );
265 $link = $sk->makeLinkObj( $this->mTitle
, $label, 'page='. ($page+
1) );
266 $thumb2 = $sk->makeThumbLinkObj( $this->img
, $link, $label, 'none' );
272 $select = '<form name="pageselector" action="' .
273 htmlspecialchars( $wgScript ) .
274 '" method="get" onchange="document.pageselector.submit();">' .
275 Xml
::hidden( 'title', $this->getTitle()->getPrefixedDbKey() );
276 $select .= $wgOut->parse( wfMsg( 'imgmultigotopre' ), false ) .
277 ' <select id="pageselector" name="page">';
278 for ( $i=1; $i <= $count; $i++
) {
279 $select .= Xml
::option( $wgLang->formatNum( $i ), $i,
282 $select .= '</select>' . $wgOut->parse( wfMsg( 'imgmultigotopost' ), false ) .
283 '<input type="submit" value="' .
284 htmlspecialchars( wfMsg( 'imgmultigo' ) ) . '"></form>';
286 $wgOut->addHTML( '</td><td><div class="multipageimagenavbox">' .
287 "$select<hr />$thumb1\n$thumb2<br clear=\"all\" /></div></td></tr></table>" );
290 #if direct link is allowed but it's not a renderable image, show an icon.
291 if ($this->img
->isSafeFile()) {
292 $icon= $this->img
->iconThumb();
294 $wgOut->addHTML( '<div class="fullImageLink" id="file"><a href="' . $full_url . '">' .
304 $filename = wfEscapeWikiText( $this->img
->getName() );
305 // Hacky workaround: for some reason we use the incorrect MIME type
306 // image/svg for SVG. This should be fixed internally, but at least
307 // make the displayed type right.
308 $mime = $this->img
->getMimeType();
309 if ($mime == 'image/svg') $mime = 'image/svg+xml';
311 $info = wfMsg( 'fileinfo',
312 ceil($this->img
->getSize()/1024.0),
316 $dirmark = $wgContLang->getDirMark();
317 if (!$this->img
->isSafeFile()) {
318 $warning = wfMsg( 'mediawarning' );
319 $wgOut->addWikiText( <<<END
320 <div class="fullMedia">
321 <span class="dangerousLink">[[Media:$filename|$filename]]</span>$dirmark
322 <span class="fileInfo"> ($info)</span>
325 <div class="mediaWarning">$warning</div>
329 $wgOut->addWikiText( <<<END
330 <div class="fullMedia">
331 [[Media:$filename|$filename]]$dirmark <span class="fileInfo"> ($info)</span>
338 if($this->img
->fromSharedDirectory
) {
339 $this->printSharedImageText();
342 # Image does not exist
344 $title = SpecialPage
::getTitleFor( 'Upload' );
345 $link = $sk->makeKnownLinkObj($title, wfMsgHtml('noimage-linktext'),
346 'wpDestFile=' . urlencode( $this->img
->getName() ) );
347 $wgOut->addHTML( wfMsgWikiHtml( 'noimage', $link ) );
351 function printSharedImageText() {
352 global $wgRepositoryBaseUrl, $wgFetchCommonsDescriptions, $wgOut, $wgUser;
354 $url = $wgRepositoryBaseUrl . urlencode($this->mTitle
->getDBkey());
355 $sharedtext = "<div class='sharedUploadNotice'>" . wfMsgWikiHtml("sharedupload");
356 if ($wgRepositoryBaseUrl && !$wgFetchCommonsDescriptions) {
358 $sk = $wgUser->getSkin();
359 $title = SpecialPage
::getTitleFor( 'Upload' );
360 $link = $sk->makeKnownLinkObj($title, wfMsgHtml('shareduploadwiki-linktext'),
361 array( 'wpDestFile' => urlencode( $this->img
->getName() )));
362 $sharedtext .= " " . wfMsgWikiHtml('shareduploadwiki', $link);
364 $sharedtext .= "</div>";
365 $wgOut->addHTML($sharedtext);
367 if ($wgRepositoryBaseUrl && $wgFetchCommonsDescriptions) {
368 $text = Http
::get($url . '?action=render');
370 $this->mExtraDescription
= $text;
374 function getUploadUrl() {
376 $uploadTitle = SpecialPage
::getTitleFor( 'Upload' );
377 return $wgServer . $uploadTitle->getLocalUrl( 'wpDestFile=' . urlencode( $this->img
->getName() ) );
381 * Print out the various links at the bottom of the image page, e.g. reupload,
382 * external editing (and instructions link) etc.
384 function uploadLinksBox() {
385 global $wgUser, $wgOut;
387 if( $this->img
->fromSharedDirectory
)
390 $sk = $wgUser->getSkin();
392 $wgOut->addHtml( '<br /><ul>' );
394 # "Upload a new version of this file" link
395 if( $wgUser->isAllowed( 'reupload' ) ) {
396 $ulink = $sk->makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion-linktext' ) );
397 $wgOut->addHtml( "<li><div>{$ulink}</div></li>" );
400 # External editing link
401 $elink = $sk->makeKnownLinkObj( $this->mTitle
, wfMsgHtml( 'edit-externally' ), 'action=edit&externaledit=true&mode=file' );
402 $wgOut->addHtml( '<li>' . $elink . '<div>' . wfMsgWikiHtml( 'edit-externally-help' ) . '</div></li>' );
404 $wgOut->addHtml( '</ul>' );
407 function closeShowImage()
414 * If the page we've just displayed is in the "Image" namespace,
415 * we follow it with an upload history of the image and its usage.
417 function imageHistory()
419 global $wgUser, $wgOut, $wgUseExternalEditor;
421 $sk = $wgUser->getSkin();
423 $line = $this->img
->nextHistoryLine();
426 $list = new ImageHistoryList( $sk );
427 $s = $list->beginImageHistoryList() .
428 $list->imageHistoryLine( true, wfTimestamp(TS_MW
, $line->img_timestamp
),
429 $this->mTitle
->getDBkey(), $line->img_user
,
430 $line->img_user_text
, $line->img_size
, $line->img_description
,
431 $line->img_width
, $line->img_height
434 while ( $line = $this->img
->nextHistoryLine() ) {
435 $s .= $list->imageHistoryLine( false, $line->img_timestamp
,
436 $line->oi_archive_name
, $line->img_user
,
437 $line->img_user_text
, $line->img_size
, $line->img_description
,
438 $line->img_width
, $line->img_height
441 $s .= $list->endImageHistoryList();
443 $wgOut->addHTML( $s );
445 # Exist check because we don't want to show this on pages where an image
446 # doesn't exist along with the noimage message, that would suck. -ævar
447 if( $wgUseExternalEditor && $this->img
->exists() ) {
448 $this->uploadLinksBox();
453 function imageLinks()
455 global $wgUser, $wgOut;
457 $wgOut->addHTML( Xml
::element( 'h2', array( 'id' => 'filelinks' ), wfMsg( 'imagelinks' ) ) . "\n" );
459 $dbr = wfGetDB( DB_SLAVE
);
460 $page = $dbr->tableName( 'page' );
461 $imagelinks = $dbr->tableName( 'imagelinks' );
463 $sql = "SELECT page_namespace,page_title FROM $imagelinks,$page WHERE il_to=" .
464 $dbr->addQuotes( $this->mTitle
->getDBkey() ) . " AND il_from=page_id";
465 $sql = $dbr->limitResult($sql, 500, 0);
466 $res = $dbr->query( $sql, "ImagePage::imageLinks" );
468 if ( 0 == $dbr->numRows( $res ) ) {
469 $wgOut->addHtml( '<p>' . wfMsg( "nolinkstoimage" ) . "</p>\n" );
472 $wgOut->addHTML( '<p>' . wfMsg( 'linkstoimage' ) . "</p>\n<ul>" );
474 $sk = $wgUser->getSkin();
475 while ( $s = $dbr->fetchObject( $res ) ) {
476 $name = Title
::MakeTitle( $s->page_namespace
, $s->page_title
);
477 $link = $sk->makeKnownLinkObj( $name, "" );
478 $wgOut->addHTML( "<li>{$link}</li>\n" );
480 $wgOut->addHTML( "</ul>\n" );
485 global $wgUser, $wgOut, $wgRequest;
487 $confirm = $wgRequest->wasPosted();
488 $reason = $wgRequest->getVal( 'wpReason' );
489 $image = $wgRequest->getVal( 'image' );
490 $oldimage = $wgRequest->getVal( 'oldimage' );
492 # Only sysops can delete images. Previously ordinary users could delete
493 # old revisions, but this is no longer the case.
494 if ( !$wgUser->isAllowed('delete') ) {
495 $wgOut->permissionRequired( 'delete' );
498 if ( $wgUser->isBlocked() ) {
499 return $this->blockedIPpage();
501 if ( wfReadOnly() ) {
502 $wgOut->readOnlyPage();
506 # Better double-check that it hasn't been deleted yet!
507 $wgOut->setPagetitle( wfMsg( 'confirmdelete' ) );
508 if ( ( !is_null( $image ) )
509 && ( '' == trim( $image ) ) ) {
510 $wgOut->showFatalError( wfMsg( 'cannotdelete' ) );
514 $this->img
= new Image( $this->mTitle
);
516 # Deleting old images doesn't require confirmation
517 if ( !is_null( $oldimage ) ||
$confirm ) {
518 if( $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) {
519 $this->doDelete( $reason );
521 $wgOut->showFatalError( wfMsg( 'sessionfailure' ) );
526 if ( !is_null( $image ) ) {
527 $q = '&image=' . urlencode( $image );
528 } else if ( !is_null( $oldimage ) ) {
529 $q = '&oldimage=' . urlencode( $oldimage );
533 return $this->confirmDelete( $q, $wgRequest->getText( 'wpReason' ) );
538 * @param $reason User provided reason for deletion.
540 function doDelete( $reason ) {
541 global $wgOut, $wgRequest;
543 $oldimage = $wgRequest->getVal( 'oldimage' );
545 if ( !is_null( $oldimage ) ) {
546 if ( strlen( $oldimage ) < 16 ) {
547 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
550 if ( strstr( $oldimage, "/" ) ||
strstr( $oldimage, "\\" ) ) {
551 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
554 if ( !$this->doDeleteOldImage( $oldimage ) ) {
557 $deleted = $oldimage;
559 $ok = $this->img
->delete( $reason );
561 # If the deletion operation actually failed, bug out:
562 $wgOut->showFileDeleteError( $this->img
->getName() );
566 # Image itself is now gone, and database is cleaned.
567 # Now we remove the image description page.
569 $article = new Article( $this->mTitle
);
570 $article->doDeleteArticle( $reason ); # ignore errors
572 $deleted = $this->img
->getName();
575 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
576 $wgOut->setRobotpolicy( 'noindex,nofollow' );
578 $loglink = '[[Special:Log/delete|' . wfMsg( 'deletionlog' ) . ']]';
579 $text = wfMsg( 'deletedtext', $deleted, $loglink );
581 $wgOut->addWikiText( $text );
583 $wgOut->returnToMain( false, $this->mTitle
->getPrefixedText() );
589 function doDeleteOldImage( $oldimage )
593 $ok = $this->img
->deleteOld( $oldimage, '' );
595 # If we actually have a file and can't delete it, throw an error.
596 # Something went awry...
597 $wgOut->showFileDeleteError( "$oldimage" );
600 $log = new LogPage( 'delete' );
601 $log->addEntry( 'delete', $this->mTitle
, wfMsg('deletedrevision',$oldimage) );
607 global $wgOut, $wgRequest, $wgUser;
609 $oldimage = $wgRequest->getText( 'oldimage' );
610 if ( strlen( $oldimage ) < 16 ) {
611 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
614 if ( strstr( $oldimage, "/" ) ||
strstr( $oldimage, "\\" ) ) {
615 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
619 if ( wfReadOnly() ) {
620 $wgOut->readOnlyPage();
623 if( $wgUser->isAnon() ) {
624 $wgOut->showErrorPage( 'uploadnologin', 'uploadnologintext' );
627 if ( ! $this->mTitle
->userCan( 'edit' ) ) {
628 $wgOut->readOnlyPage( $this->getContent(), true );
631 if ( $wgUser->isBlocked() ) {
632 return $this->blockedIPpage();
634 if( !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) {
635 $wgOut->showErrorPage( 'internalerror', 'sessionfailure' );
638 $name = substr( $oldimage, 15 );
640 $dest = wfImageDir( $name );
641 $archive = wfImageArchiveDir( $name );
642 $curfile = "{$dest}/{$name}";
644 if ( !is_dir( $dest ) ) wfMkdirParents( $dest );
645 if ( !is_dir( $archive ) ) wfMkdirParents( $archive );
647 if ( ! is_file( $curfile ) ) {
648 $wgOut->showFileNotFoundError( htmlspecialchars( $curfile ) );
651 $oldver = wfTimestampNow() . "!{$name}";
653 if ( ! rename( $curfile, "${archive}/{$oldver}" ) ) {
654 $wgOut->showFileRenameError( $curfile, "${archive}/{$oldver}" );
657 if ( ! copy( "{$archive}/{$oldimage}", $curfile ) ) {
658 $wgOut->showFileCopyError( "${archive}/{$oldimage}", $curfile );
662 # Record upload and update metadata cache
663 $img = Image
::newFromName( $name );
664 $img->recordUpload( $oldver, wfMsg( "reverted" ) );
666 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
667 $wgOut->setRobotpolicy( 'noindex,nofollow' );
668 $wgOut->addHTML( wfMsg( 'imagereverted' ) );
670 $descTitle = $img->getTitle();
671 $wgOut->returnToMain( false, $descTitle->getPrefixedText() );
674 function blockedIPpage() {
675 $edit = new EditPage( $this );
676 return $edit->blockedIPpage();
680 * Override handling of action=purge
683 $this->img
= new Image( $this->mTitle
);
684 if( $this->img
->exists() ) {
685 wfDebug( "ImagePage::doPurge purging " . $this->img
->getName() . "\n" );
686 $update = new HTMLCacheUpdate( $this->mTitle
, 'imagelinks' );
688 $this->img
->purgeCache();
690 wfDebug( "ImagePage::doPurge no image\n" );
700 class ImageHistoryList
{
701 function ImageHistoryList( &$skin ) {
702 $this->skin
=& $skin;
705 function beginImageHistoryList() {
707 Xml
::element( 'h2', array( 'id' => 'filehistory' ), wfMsg( 'imghistory' ) ) .
708 "\n<p>" . wfMsg( 'imghistlegend' ) . "</p>\n".'<ul class="special">';
712 function endImageHistoryList() {
717 function imageHistoryLine( $iscur, $timestamp, $img, $user, $usertext, $size, $description, $width, $height ) {
718 global $wgUser, $wgLang, $wgTitle, $wgContLang;
720 $datetime = $wgLang->timeanddate( $timestamp, true );
721 $del = wfMsgHtml( 'deleteimg' );
722 $delall = wfMsgHtml( 'deleteimgcompletely' );
723 $cur = wfMsgHtml( 'cur' );
726 $url = Image
::imageUrl( $img );
728 if ( $wgUser->isAllowed('delete') ) {
729 $link = $wgTitle->escapeLocalURL( 'image=' . $wgTitle->getPartialURL() .
731 $style = $this->skin
->getInternalLinkAttributes( $link, $delall );
733 $dlink = '<a href="'.$link.'"'.$style.'>'.$delall.'</a>';
738 $url = htmlspecialchars( wfImageArchiveUrl( $img ) );
739 if( $wgUser->getID() != 0 && $wgTitle->userCan( 'edit' ) ) {
740 $token = urlencode( $wgUser->editToken( $img ) );
741 $rlink = $this->skin
->makeKnownLinkObj( $wgTitle,
742 wfMsgHtml( 'revertimg' ), 'action=revert&oldimage=' .
743 urlencode( $img ) . "&wpEditToken=$token" );
744 $dlink = $this->skin
->makeKnownLinkObj( $wgTitle,
745 $del, 'action=delete&oldimage=' . urlencode( $img ) .
746 "&wpEditToken=$token" );
748 # Having live active links for non-logged in users
749 # means that bots and spiders crawling our site can
750 # inadvertently change content. Baaaad idea.
751 $rlink = wfMsgHtml( 'revertimg' );
756 $userlink = $this->skin
->userLink( $user, $usertext ) . $this->skin
->userToolLinks( $user, $usertext );
757 $nbytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
758 $wgLang->formatNum( $size ) );
759 $widthheight = wfMsgHtml( 'widthheight', $width, $height );
760 $style = $this->skin
->getInternalLinkAttributes( $url, $datetime );
762 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$datetime}</a> . . {$userlink} . . {$widthheight} ({$nbytes})";
764 $s .= $this->skin
->commentBlock( $description, $wgTitle );