9 if( !defined( 'MEDIAWIKI' ) )
12 require_once( 'Image.php' );
15 * Special handling for image description pages
18 class ImagePage
extends Article
{
20 /* private */ var $img; // Image object this page is shown for
21 var $mExtraDescription = false;
24 * Handler for action=render
25 * Include body text only; none of the image extras
29 $wgOut->setArticleBodyOnly( true );
30 $wgOut->addSecondaryWikitext( $this->getContent() );
34 global $wgOut, $wgShowEXIF;
36 $this->img
= new Image( $this->mTitle
);
38 if( $this->mTitle
->getNamespace() == NS_IMAGE
) {
39 if ($wgShowEXIF && $this->img
->exists()) {
40 $exif = $this->img
->getExifData();
41 $showmeta = count($exif) ?
true : false;
47 if ($this->img
->exists())
48 $wgOut->addHTML($this->showTOC($showmeta));
50 $this->openShowImage();
52 # No need to display noarticletext, we use our own message, output in openShowImage()
53 if( $this->getID() ) {
56 # Just need to set the right headers
57 $wgOut->setArticleFlag( true );
58 $wgOut->setRobotpolicy( 'index,follow' );
59 $wgOut->setPageTitle( $this->mTitle
->getPrefixedText() );
63 # Show shared description, if needed
64 if( $this->mExtraDescription
) {
65 $fol = wfMsg( 'shareddescriptionfollows' );
67 $wgOut->addWikiText( $fol );
69 $wgOut->addHTML( '<div id="shared-image-desc">' . $this->mExtraDescription
. '</div>' );
72 $this->closeShowImage();
73 $this->imageHistory();
77 $expand = htmlspecialchars( wfEscapeJsString( wfMsg( 'metadata-expand' ) ) );
78 $collapse = htmlspecialchars( wfEscapeJsString( wfMsg( 'metadata-collapse' ) ) );
79 $wgOut->addHTML( "<h2 id=\"metadata\">" . wfMsgHtml( 'metadata' ) . "</h2>\n" );
80 $wgOut->addWikiText( $this->makeMetadataTable( $exif ) );
82 "<script type=\"text/javascript\" src=\"$wgStylePath/common/metadata.js\"></script>\n" .
83 "<script type=\"text/javascript\">attachMetadataToggle('mw_metadata', '$expand', '$collapse');</script>\n" );
95 * @param bool $metadata Whether or not to show the metadata link
98 function showTOC( $metadata ) {
100 $r = '<ul id="filetoc">
101 <li><a href="#file">' . $wgLang->getNsText( NS_IMAGE
) . '</a></li>
102 <li><a href="#filehistory">' . wfMsgHtml( 'imghistory' ) . '</a></li>
103 <li><a href="#filelinks">' . wfMsgHtml( 'imagelinks' ) . '</a></li>' .
104 ($metadata ?
'<li><a href="#metadata">' . wfMsgHtml( 'metadata' ) . '</a></li>' : '') . '
110 * Make a table with metadata to be shown in the output page.
114 * @param array $exif The array containing the EXIF data
117 function makeMetadataTable( $exif ) {
118 $r = wfMsg( 'metadata-help' ) . "\n\n";
119 $r .= "{| id=mw_metadata class=mw_metadata\n";
120 $visibleFields = $this->visibleMetadataFields();
121 foreach( $exif as $k => $v ) {
122 $tag = strtolower( $k );
123 $msg = wfMsg( "exif-$tag" );
124 $class = "exif-$tag";
125 if( !in_array( $tag, $visibleFields ) ) {
126 $class .= ' collapsable';
128 $r .= "|- class=\"$class\"\n";
137 * Get a list of EXIF metadata items which should be displayed when
138 * the metadata table is collapsed.
140 * @return array of strings
143 function visibleMetadataFields() {
145 $lines = explode( "\n", wfMsgForContent( 'metadata-fields' ) );
146 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;
169 global $wgUseImageResize, $wgGenerateThumbnailOnParse;
171 $full_url = $this->img
->getURL();
175 if( $wgUser->getOption( 'imagesize' ) == '' ) {
176 $sizeSel = User
::getDefaultOption( 'imagesize' );
178 $sizeSel = intval( $wgUser->getOption( 'imagesize' ) );
180 if( !isset( $wgImageLimits[$sizeSel] ) ) {
181 $sizeSel = User
::getDefaultOption( 'imagesize' );
183 $max = $wgImageLimits[$sizeSel];
185 $maxHeight = $max[1];
186 $sk = $wgUser->getSkin();
188 if ( $this->img
->exists() ) {
190 $page = $wgRequest->getIntOrNull( 'page' );
191 if ( ! is_null( $page ) ) {
192 $this->img
->selectPage( $page );
196 $width = $this->img
->getWidth();
197 $height = $this->img
->getHeight();
200 if ( $this->img
->allowInlineDisplay() and $width and $height) {
203 # "Download high res version" link below the image
204 $msg = wfMsgHtml('showbigimage', $width, $height, intval( $this->img
->getSize()/1024 ) );
206 # We'll show a thumbnail of this image
207 if ( $width > $maxWidth ||
$height > $maxHeight ) {
208 # Calculate the thumbnail size.
209 # First case, the limiting factor is the width, not the height.
210 if ( $width / $height >= $maxWidth / $maxHeight ) {
211 $height = round( $height * $maxWidth / $width);
213 # Note that $height <= $maxHeight now.
215 $newwidth = floor( $width * $maxHeight / $height);
216 $height = round( $height * $newwidth / $width );
218 # Note that $height <= $maxHeight now, but might not be identical
219 # because of rounding.
222 if( $wgUseImageResize ) {
223 $thumbnail = $this->img
->getThumbnail( $width, -1, $wgGenerateThumbnailOnParse );
224 if ( $thumbnail == null ) {
225 $url = $this->img
->getViewURL();
227 $url = $thumbnail->getURL();
230 # No resize ability? Show the full image, but scale
231 # it down in the browser so it fits on the page.
232 $url = $this->img
->getViewURL();
234 $anchoropen = "<a href=\"{$full_url}\">";
235 $anchorclose = "</a><br />";
236 if( $this->img
->mustRender() ) {
239 $anchorclose .= "\n$anchoropen{$msg}</a>";
242 $url = $this->img
->getViewURL();
246 if ( $this->img
->isMultipage() ) {
247 $wgOut->addHTML( '<table class="multipageimage"><tr><td>' );
250 $wgOut->addHTML( '<div class="fullImageLink" id="file">' . $anchoropen .
251 "<img border=\"0\" src=\"{$url}\" width=\"{$width}\" height=\"{$height}\" alt=\"" .
252 htmlspecialchars( $wgRequest->getVal( 'image' ) ).'" />' . $anchorclose . '</div>' );
254 if ( $this->img
->isMultipage() ) {
255 $count = $this->img
->pageCount();
258 $label = $wgOut->parse( wfMsg( 'imgmultipageprev' ), false );
259 $link = $sk->makeLinkObj( $this->mTitle
, $label, 'page='. ($page-1) );
260 $this->img
->selectPage( $page - 1 );
261 $thumb1 = $sk->makeThumbLinkObj( $this->img
, $link, $label, 'none' );
266 if ( $page < $count ) {
267 $label = wfMsg( 'imgmultipagenext' );
268 $this->img
->selectPage( $page +
1 );
269 $link = $sk->makeLinkObj( $this->mTitle
, $label, 'page='. ($page+
1) );
270 $thumb2 = $sk->makeThumbLinkObj( $this->img
, $link, $label, 'none' );
275 $select = '<form name="pageselector" action="' . $this->img
->getEscapeLocalUrl( '' ) . '" method="GET" onchange="document.pageselector.submit();">' ;
276 $select .= $wgOut->parse( wfMsg( 'imgmultigotopre' ), false ) .
277 ' <select id="pageselector" name="page">';
278 for ( $i=1; $i <= $count; $i++
) {
280 $select .= "<option value=\"$i\" selected=\"selected\">$i</option>";
282 $select .= "<option value=\"$i\" >$i</option>\n";
285 $select .= '</select>' . $wgOut->parse( wfMsg( 'imgmultigotopost' ), false ) .
286 '<input type="submit" value="' .
287 htmlspecialchars( wfMsg( 'imgmultigo' ) ) . '"></form>';
289 $wgOut->addHTML( '</td><td><div class="multipageimagenavbox">' .
290 "$select<hr />$thumb1\n$thumb2<br clear=\"all\" /></div></td></tr></table>" );
293 #if direct link is allowed but it's not a renderable image, show an icon.
294 if ($this->img
->isSafeFile()) {
295 $icon= $this->img
->iconThumb();
297 $wgOut->addHTML( '<div class="fullImageLink" id="file"><a href="' . $full_url . '">' .
307 $filename = wfEscapeWikiText( $this->img
->getName() );
308 $info = wfMsg( 'fileinfo',
309 ceil($this->img
->getSize()/1024.0),
310 $this->img
->getMimeType() );
313 $dirmark = $wgContLang->getDirMark();
314 if (!$this->img
->isSafeFile()) {
315 $warning = wfMsg( 'mediawarning' );
316 $wgOut->addWikiText( <<<END
317 <div class="fullMedia">
318 <span class="dangerousLink">[[Media:$filename|$filename]]</span>$dirmark
319 <span class="fileInfo"> ($info)</span>
322 <div class="mediaWarning">$warning</div>
326 $wgOut->addWikiText( <<<END
327 <div class="fullMedia">
328 [[Media:$filename|$filename]]$dirmark <span class="fileInfo"> ($info)</span>
335 if($this->img
->fromSharedDirectory
) {
336 $this->printSharedImageText();
339 # Image does not exist
341 $title = Title
::makeTitle( NS_SPECIAL
, 'Upload' );
342 $link = $sk->makeKnownLinkObj($title, wfMsgHtml('noimage-linktext'),
343 'wpDestFile=' . urlencode( $this->img
->getName() ) );
344 $wgOut->addHTML( wfMsgWikiHtml( 'noimage', $link ) );
348 function printSharedImageText() {
349 global $wgRepositoryBaseUrl, $wgFetchCommonsDescriptions, $wgOut, $wgUser;
351 $url = $wgRepositoryBaseUrl . urlencode($this->mTitle
->getDBkey());
352 $sharedtext = "<div class='sharedUploadNotice'>" . wfMsgWikiHtml("sharedupload");
353 if ($wgRepositoryBaseUrl && !$wgFetchCommonsDescriptions) {
355 $sk = $wgUser->getSkin();
356 $title = Title
::makeTitle( NS_SPECIAL
, 'Upload' );
357 $link = $sk->makeKnownLinkObj($title, wfMsgHtml('shareduploadwiki-linktext'),
358 array( 'wpDestFile' => urlencode( $this->img
->getName() )));
359 $sharedtext .= " " . wfMsgWikiHtml('shareduploadwiki', $link);
361 $sharedtext .= "</div>";
362 $wgOut->addHTML($sharedtext);
364 if ($wgRepositoryBaseUrl && $wgFetchCommonsDescriptions) {
365 require_once("HttpFunctions.php");
366 $ur = ini_set('allow_url_fopen', true);
367 $text = wfGetHTTP($url . '?action=render');
368 ini_set('allow_url_fopen', $ur);
370 $this->mExtraDescription
= $text;
374 function getUploadUrl() {
376 $uploadTitle = Title
::makeTitle( NS_SPECIAL
, '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
, wfMsg( '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( '<h2 id="filelinks">' . wfMsg( 'imagelinks' ) . "</h2>\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, $wgUseSquid;
542 global $wgPostCommitUpdateList;
544 $fname = 'ImagePage::doDelete';
546 $oldimage = $wgRequest->getVal( 'oldimage' );
548 $dbw =& wfGetDB( DB_MASTER
);
550 if ( !is_null( $oldimage ) ) {
551 if ( strlen( $oldimage ) < 16 ) {
552 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
555 if ( strstr( $oldimage, "/" ) ||
strstr( $oldimage, "\\" ) ) {
556 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
559 if ( !$this->doDeleteOldImage( $oldimage ) ) {
562 $deleted = $oldimage;
564 $ok = $this->img
->delete( $reason );
566 # If the deletion operation actually failed, bug out:
567 $wgOut->showFileDeleteError( $this->img
->getName() );
571 # Image itself is now gone, and database is cleaned.
572 # Now we remove the image description page.
574 $article = new Article( $this->mTitle
);
575 $article->doDeleteArticle( $reason ); # ignore errors
577 $deleted = $this->img
->getName();
580 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
581 $wgOut->setRobotpolicy( 'noindex,nofollow' );
583 $loglink = '[[Special:Log/delete|' . wfMsg( 'deletionlog' ) . ']]';
584 $text = wfMsg( 'deletedtext', $deleted, $loglink );
586 $wgOut->addWikiText( $text );
588 $wgOut->returnToMain( false, $this->mTitle
->getPrefixedText() );
594 function doDeleteOldImage( $oldimage )
598 $ok = $this->img
->deleteOld( $oldimage, '' );
600 # If we actually have a file and can't delete it, throw an error.
601 # Something went awry...
602 $wgOut->showFileDeleteError( "$oldimage" );
605 $log = new LogPage( 'delete' );
606 $log->addEntry( 'delete', $this->mTitle
, wfMsg('deletedrevision',$oldimage) );
612 global $wgOut, $wgRequest, $wgUser;
614 $oldimage = $wgRequest->getText( 'oldimage' );
615 if ( strlen( $oldimage ) < 16 ) {
616 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
619 if ( strstr( $oldimage, "/" ) ||
strstr( $oldimage, "\\" ) ) {
620 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
624 if ( wfReadOnly() ) {
625 $wgOut->readOnlyPage();
628 if( $wgUser->isAnon() ) {
629 $wgOut->showErrorPage( 'uploadnologin', 'uploadnologintext' );
632 if ( ! $this->mTitle
->userCanEdit() ) {
633 $wgOut->readOnlyPage( $this->getContent(), true );
636 if ( $wgUser->isBlocked() ) {
637 return $this->blockedIPpage();
639 if( !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) {
640 $wgOut->showErrorPage( 'internalerror', 'sessionfailure' );
643 $name = substr( $oldimage, 15 );
645 $dest = wfImageDir( $name );
646 $archive = wfImageArchiveDir( $name );
647 $curfile = "{$dest}/{$name}";
649 if ( !is_dir( $dest ) ) wfMkdirParents( $dest );
650 if ( !is_dir( $archive ) ) wfMkdirParents( $archive );
652 if ( ! is_file( $curfile ) ) {
653 $wgOut->showFileNotFoundError( htmlspecialchars( $curfile ) );
656 $oldver = wfTimestampNow() . "!{$name}";
658 $dbr =& wfGetDB( DB_SLAVE
);
659 $size = $dbr->selectField( 'oldimage', 'oi_size', array( 'oi_archive_name' => $oldimage ) );
661 if ( ! rename( $curfile, "${archive}/{$oldver}" ) ) {
662 $wgOut->showFileRenameError( $curfile, "${archive}/{$oldver}" );
665 if ( ! copy( "{$archive}/{$oldimage}", $curfile ) ) {
666 $wgOut->showFileCopyError( "${archive}/{$oldimage}", $curfile );
670 # Record upload and update metadata cache
671 $img = Image
::newFromName( $name );
672 $img->recordUpload( $oldver, wfMsg( "reverted" ) );
674 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
675 $wgOut->setRobotpolicy( 'noindex,nofollow' );
676 $wgOut->addHTML( wfMsg( 'imagereverted' ) );
678 $descTitle = $img->getTitle();
679 $wgOut->returnToMain( false, $descTitle->getPrefixedText() );
682 function blockedIPpage() {
683 $edit = new EditPage( $this );
684 return $edit->blockedIPpage();
688 * Override handling of action=purge
691 $this->img
= new Image( $this->mTitle
);
692 if( $this->img
->exists() ) {
693 wfDebug( "ImagePage::doPurge purging " . $this->img
->getName() . "\n" );
694 $update = new HTMLCacheUpdate( $this->mTitle
, 'imagelinks' );
696 $this->img
->purgeCache();
698 wfDebug( "ImagePage::doPurge no image\n" );
709 class ImageHistoryList
{
710 function ImageHistoryList( &$skin ) {
711 $this->skin
=& $skin;
714 function beginImageHistoryList() {
715 $s = "\n<h2 id=\"filehistory\">" . wfMsg( 'imghistory' ) . "</h2>\n" .
716 "<p>" . wfMsg( 'imghistlegend' ) . "</p>\n".'<ul class="special">';
720 function endImageHistoryList() {
725 function imageHistoryLine( $iscur, $timestamp, $img, $user, $usertext, $size, $description, $width, $height ) {
726 global $wgUser, $wgLang, $wgTitle, $wgContLang;
728 $datetime = $wgLang->timeanddate( $timestamp, true );
729 $del = wfMsg( 'deleteimg' );
730 $delall = wfMsg( 'deleteimgcompletely' );
731 $cur = wfMsg( 'cur' );
734 $url = Image
::imageUrl( $img );
736 if ( $wgUser->isAllowed('delete') ) {
737 $link = $wgTitle->escapeLocalURL( 'image=' . $wgTitle->getPartialURL() .
739 $style = $this->skin
->getInternalLinkAttributes( $link, $delall );
741 $dlink = '<a href="'.$link.'"'.$style.'>'.$delall.'</a>';
746 $url = htmlspecialchars( wfImageArchiveUrl( $img ) );
747 if( $wgUser->getID() != 0 && $wgTitle->userCanEdit() ) {
748 $token = urlencode( $wgUser->editToken( $img ) );
749 $rlink = $this->skin
->makeKnownLinkObj( $wgTitle,
750 wfMsg( 'revertimg' ), 'action=revert&oldimage=' .
751 urlencode( $img ) . "&wpEditToken=$token" );
752 $dlink = $this->skin
->makeKnownLinkObj( $wgTitle,
753 $del, 'action=delete&oldimage=' . urlencode( $img ) .
754 "&wpEditToken=$token" );
756 # Having live active links for non-logged in users
757 # means that bots and spiders crawling our site can
758 # inadvertently change content. Baaaad idea.
759 $rlink = wfMsg( 'revertimg' );
764 $userlink = $this->skin
->userLink( $user, $usertext ) . $this->skin
->userToolLinks( $user, $usertext );
765 $nbytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
766 $wgLang->formatNum( $size ) );
767 $widthheight = wfMsg( 'widthheight', $width, $height );
768 $style = $this->skin
->getInternalLinkAttributes( $url, $datetime );
770 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$datetime}</a> . . {$userlink} . . {$widthheight} ({$nbytes})";
772 $s .= $this->skin
->commentBlock( $description, $wgTitle );