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, $wgUseImageResize;
170 $full_url = $this->img
->getURL();
174 if( $wgUser->getOption( 'imagesize' ) == '' ) {
175 $sizeSel = User
::getDefaultOption( 'imagesize' );
177 $sizeSel = intval( $wgUser->getOption( 'imagesize' ) );
179 if( !isset( $wgImageLimits[$sizeSel] ) ) {
180 $sizeSel = User
::getDefaultOption( 'imagesize' );
182 $max = $wgImageLimits[$sizeSel];
184 $maxHeight = $max[1];
185 $sk = $wgUser->getSkin();
187 if ( $this->img
->exists() ) {
189 $width = $this->img
->getWidth();
190 $height = $this->img
->getHeight();
193 if ( $this->img
->allowInlineDisplay() and $width and $height) {
196 # "Download high res version" link below the image
197 $msg = wfMsgHtml('showbigimage', $width, $height, intval( $this->img
->getSize()/1024 ) );
199 # We'll show a thumbnail of this image
200 if ( $width > $maxWidth ||
$height > $maxHeight ) {
201 # Calculate the thumbnail size.
202 # First case, the limiting factor is the width, not the height.
203 if ( $width / $height >= $maxWidth / $maxHeight ) {
204 $height = round( $height * $maxWidth / $width);
206 # Note that $height <= $maxHeight now.
208 $newwidth = floor( $width * $maxHeight / $height);
209 $height = round( $height * $newwidth / $width );
211 # Note that $height <= $maxHeight now, but might not be identical
212 # because of rounding.
215 if( $wgUseImageResize ) {
216 $thumbnail = $this->img
->getThumbnail( $width );
217 if ( $thumbnail == null ) {
218 $url = $this->img
->getViewURL();
220 $url = $thumbnail->getURL();
223 # No resize ability? Show the full image, but scale
224 # it down in the browser so it fits on the page.
225 $url = $this->img
->getViewURL();
227 $anchoropen = "<a href=\"{$full_url}\">";
228 $anchorclose = "</a><br />";
229 if( $this->img
->mustRender() ) {
232 $anchorclose .= "\n$anchoropen{$msg}</a>";
235 $url = $this->img
->getViewURL();
238 $wgOut->addHTML( '<div class="fullImageLink" id="file">' . $anchoropen .
239 "<img border=\"0\" src=\"{$url}\" width=\"{$width}\" height=\"{$height}\" alt=\"" .
240 htmlspecialchars( $wgRequest->getVal( 'image' ) ).'" />' . $anchorclose . '</div>' );
242 #if direct link is allowed but it's not a renderable image, show an icon.
243 if ($this->img
->isSafeFile()) {
244 $icon= $this->img
->iconThumb();
246 $wgOut->addHTML( '<div class="fullImageLink" id="file"><a href="' . $full_url . '">' .
256 $filename = wfEscapeWikiText( $this->img
->getName() );
257 $info = wfMsg( 'fileinfo',
258 ceil($this->img
->getSize()/1024.0),
259 $this->img
->getMimeType() );
261 if (!$this->img
->isSafeFile()) {
262 $warning = wfMsg( 'mediawarning' );
263 $wgOut->addWikiText( <<<END
264 <div class="fullMedia">
265 <span class="dangerousLink">[[Media:$filename|$filename]]</span>
266 <span class="fileInfo"> ($info)</span>
269 <div class="mediaWarning">$warning</div>
273 $wgOut->addWikiText( <<<END
274 <div class="fullMedia">
275 [[Media:$filename|$filename]] <span class="fileInfo"> ($info)</span>
282 if($this->img
->fromSharedDirectory
) {
283 $this->printSharedImageText();
286 # Image does not exist
288 $title = Title
::makeTitle( NS_SPECIAL
, 'Upload' );
289 $link = $sk->makeKnownLinkObj($title, wfMsgHtml('noimage-linktext'),
290 'wpDestFile=' . urlencode( $this->img
->getName() ) );
291 $wgOut->addHTML( wfMsgWikiHtml( 'noimage', $link ) );
295 function printSharedImageText() {
296 global $wgRepositoryBaseUrl, $wgFetchCommonsDescriptions, $wgOut, $wgUser;
298 $url = $wgRepositoryBaseUrl . urlencode($this->mTitle
->getDBkey());
299 $sharedtext = "<div class='sharedUploadNotice'>" . wfMsgWikiHtml("sharedupload");
300 if ($wgRepositoryBaseUrl && !$wgFetchCommonsDescriptions) {
302 $sk = $wgUser->getSkin();
303 $title = Title
::makeTitle( NS_SPECIAL
, 'Upload' );
304 $link = $sk->makeKnownLinkObj($title, wfMsgHtml('shareduploadwiki-linktext'),
305 array( 'wpDestFile' => urlencode( $this->img
->getName() )));
306 $sharedtext .= " " . wfMsgWikiHtml('shareduploadwiki', $link);
308 $sharedtext .= "</div>";
309 $wgOut->addHTML($sharedtext);
311 if ($wgRepositoryBaseUrl && $wgFetchCommonsDescriptions) {
312 require_once("HttpFunctions.php");
313 $ur = ini_set('allow_url_fopen', true);
314 $text = wfGetHTTP($url . '?action=render');
315 ini_set('allow_url_fopen', $ur);
317 $this->mExtraDescription
= $text;
321 function getUploadUrl() {
323 $uploadTitle = Title
::makeTitle( NS_SPECIAL
, 'Upload' );
324 return $wgServer . $uploadTitle->getLocalUrl( 'wpDestFile=' . urlencode( $this->img
->getName() ) );
328 * Print out the various links at the bottom of the image page, e.g. reupload,
329 * external editing (and instructions link) etc.
331 function uploadLinksBox() {
332 global $wgUser, $wgOut;
334 if( $this->img
->fromSharedDirectory
)
337 $sk = $wgUser->getSkin();
339 $wgOut->addHtml( '<br /><ul>' );
341 # "Upload a new version of this file" link
342 if( $wgUser->isAllowed( 'reupload' ) ) {
343 $ulink = $sk->makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion-linktext' ) );
344 $wgOut->addHtml( "<li><div>{$ulink}</div></li>" );
347 # External editing link
348 $elink = $sk->makeKnownLinkObj( $this->mTitle
, wfMsg( 'edit-externally' ), 'action=edit&externaledit=true&mode=file' );
349 $wgOut->addHtml( '<li>' . $elink . '<div>' . wfMsgWikiHtml( 'edit-externally-help' ) . '</div></li>' );
351 $wgOut->addHtml( '</ul>' );
354 function closeShowImage()
361 * If the page we've just displayed is in the "Image" namespace,
362 * we follow it with an upload history of the image and its usage.
364 function imageHistory()
366 global $wgUser, $wgOut, $wgUseExternalEditor;
368 $sk = $wgUser->getSkin();
370 $line = $this->img
->nextHistoryLine();
373 $list =& new ImageHistoryList( $sk );
374 $s = $list->beginImageHistoryList() .
375 $list->imageHistoryLine( true, wfTimestamp(TS_MW
, $line->img_timestamp
),
376 $this->mTitle
->getDBkey(), $line->img_user
,
377 $line->img_user_text
, $line->img_size
, $line->img_description
,
378 $line->img_width
, $line->img_height
381 while ( $line = $this->img
->nextHistoryLine() ) {
382 $s .= $list->imageHistoryLine( false, $line->img_timestamp
,
383 $line->oi_archive_name
, $line->img_user
,
384 $line->img_user_text
, $line->img_size
, $line->img_description
,
385 $line->img_width
, $line->img_height
388 $s .= $list->endImageHistoryList();
390 $wgOut->addHTML( $s );
392 # Exist check because we don't want to show this on pages where an image
393 # doesn't exist along with the noimage message, that would suck. -ævar
394 if( $wgUseExternalEditor && $this->img
->exists() ) {
395 $this->uploadLinksBox();
400 function imageLinks()
402 global $wgUser, $wgOut;
404 $wgOut->addHTML( '<h2 id="filelinks">' . wfMsg( 'imagelinks' ) . "</h2>\n" );
406 $dbr =& wfGetDB( DB_SLAVE
);
407 $page = $dbr->tableName( 'page' );
408 $imagelinks = $dbr->tableName( 'imagelinks' );
410 $sql = "SELECT page_namespace,page_title FROM $imagelinks,$page WHERE il_to=" .
411 $dbr->addQuotes( $this->mTitle
->getDBkey() ) . " AND il_from=page_id";
412 $sql = $dbr->limitResult($sql, 500, 0);
413 $res = $dbr->query( $sql, "ImagePage::imageLinks" );
415 if ( 0 == $dbr->numRows( $res ) ) {
416 $wgOut->addHtml( '<p>' . wfMsg( "nolinkstoimage" ) . "</p>\n" );
419 $wgOut->addHTML( '<p>' . wfMsg( 'linkstoimage' ) . "</p>\n<ul>" );
421 $sk = $wgUser->getSkin();
422 while ( $s = $dbr->fetchObject( $res ) ) {
423 $name = Title
::MakeTitle( $s->page_namespace
, $s->page_title
);
424 $link = $sk->makeKnownLinkObj( $name, "" );
425 $wgOut->addHTML( "<li>{$link}</li>\n" );
427 $wgOut->addHTML( "</ul>\n" );
432 global $wgUser, $wgOut, $wgRequest;
434 $confirm = $wgRequest->wasPosted();
435 $image = $wgRequest->getVal( 'image' );
436 $oldimage = $wgRequest->getVal( 'oldimage' );
438 # Only sysops can delete images. Previously ordinary users could delete
439 # old revisions, but this is no longer the case.
440 if ( !$wgUser->isAllowed('delete') ) {
441 $wgOut->sysopRequired();
444 if ( $wgUser->isBlocked() ) {
445 return $this->blockedIPpage();
447 if ( wfReadOnly() ) {
448 $wgOut->readOnlyPage();
452 # Better double-check that it hasn't been deleted yet!
453 $wgOut->setPagetitle( wfMsg( 'confirmdelete' ) );
454 if ( ( !is_null( $image ) )
455 && ( '' == trim( $image ) ) ) {
456 $wgOut->showFatalError( wfMsg( 'cannotdelete' ) );
460 $this->img
= new Image( $this->mTitle
);
462 # Deleting old images doesn't require confirmation
463 if ( !is_null( $oldimage ) ||
$confirm ) {
464 if( $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) {
467 $wgOut->showFatalError( wfMsg( 'sessionfailure' ) );
472 if ( !is_null( $image ) ) {
473 $q = '&image=' . urlencode( $image );
474 } else if ( !is_null( $oldimage ) ) {
475 $q = '&oldimage=' . urlencode( $oldimage );
479 return $this->confirmDelete( $q, $wgRequest->getText( 'wpReason' ) );
482 function doDelete() {
483 global $wgOut, $wgRequest, $wgUseSquid;
484 global $wgPostCommitUpdateList;
486 $fname = 'ImagePage::doDelete';
488 $reason = $wgRequest->getVal( 'wpReason' );
489 $oldimage = $wgRequest->getVal( 'oldimage' );
491 $dbw =& wfGetDB( DB_MASTER
);
493 if ( !is_null( $oldimage ) ) {
494 if ( strlen( $oldimage ) < 16 ) {
495 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
498 if ( strstr( $oldimage, "/" ) ||
strstr( $oldimage, "\\" ) ) {
499 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
503 # Invalidate description page cache
504 $this->mTitle
->invalidateCache();
509 wfImageArchiveUrl( $oldimage ),
510 $this->mTitle
->getInternalURL()
512 wfPurgeSquidServers($urlArr);
514 if ( !$this->doDeleteOldImage( $oldimage ) ) {
517 $dbw->delete( 'oldimage', array( 'oi_archive_name' => $oldimage ) );
518 $deleted = $oldimage;
520 $image = $this->mTitle
->getDBkey();
521 $dest = wfImageDir( $image );
522 $archive = wfImageDir( $image );
524 # Delete the image file if it exists; due to sync problems
525 # or manual trimming sometimes the file will be missing.
526 $targetFile = "{$dest}/{$image}";
527 if( file_exists( $targetFile ) && ! @unlink
( $targetFile ) ) {
528 # If the deletion operation actually failed, bug out:
529 $wgOut->showFileDeleteError( $targetFile );
532 $dbw->delete( 'image', array( 'img_name' => $image ) );
534 if ( $dbw->affectedRows() ) {
536 $site_stats = $dbw->tableName( 'site_stats' );
537 $dbw->query( "UPDATE $site_stats SET ss_images=ss_images-1", $fname );
541 $res = $dbw->select( 'oldimage', array( 'oi_archive_name' ), array( 'oi_name' => $image ) );
543 # Purge archive URLs from the squid
545 while ( $s = $dbw->fetchObject( $res ) ) {
546 if ( !$this->doDeleteOldImage( $s->oi_archive_name
) ) {
549 $urlArr[] = wfImageArchiveUrl( $s->oi_archive_name
);
552 # And also the HTML of all pages using this image
553 $linksTo = $this->img
->getLinksTo();
555 $u = SquidUpdate
::newFromTitles( $linksTo, $urlArr );
556 array_push( $wgPostCommitUpdateList, $u );
559 $dbw->delete( 'oldimage', array( 'oi_name' => $image ) );
561 # Image itself is now gone, and database is cleaned.
562 # Now we remove the image description page.
564 $article = new Article( $this->mTitle
);
565 $article->doDeleteArticle( $reason ); # ignore errors
567 # Invalidate parser cache and client cache for pages using this image
568 # This is left until relatively late to reduce lock time
569 Title
::touchArray( $linksTo );
571 /* Delete thumbnails and refresh image metadata cache */
572 $this->img
->purgeCache();
577 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
578 $wgOut->setRobotpolicy( 'noindex,nofollow' );
580 $loglink = '[[Special:Log/delete|' . wfMsg( 'deletionlog' ) . ']]';
581 $text = wfMsg( 'deletedtext', $deleted, $loglink );
583 $wgOut->addWikiText( $text );
585 $wgOut->returnToMain( false, $this->mTitle
->getPrefixedText() );
591 function doDeleteOldImage( $oldimage )
595 $name = substr( $oldimage, 15 );
596 $archive = wfImageArchiveDir( $name );
598 # Delete the image if it exists. Sometimes the file will be missing
599 # due to manual intervention or weird sync problems; treat that
600 # condition gracefully and continue to delete the database entry.
601 # Also some records may end up with an empty oi_archive_name field
602 # if the original file was missing when a new upload was made;
603 # don't try to delete the directory then!
605 $targetFile = "{$archive}/{$oldimage}";
606 if( $oldimage != '' && file_exists( $targetFile ) && !@unlink
( $targetFile ) ) {
607 # If we actually have a file and can't delete it, throw an error.
608 $wgOut->showFileDeleteError( "{$archive}/{$oldimage}" );
612 $log = new LogPage( 'delete' );
613 $log->addEntry( 'delete', $this->mTitle
, wfMsg('deletedrevision',$oldimage) );
619 global $wgOut, $wgRequest, $wgUser;
621 $oldimage = $wgRequest->getText( 'oldimage' );
622 if ( strlen( $oldimage ) < 16 ) {
623 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
626 if ( strstr( $oldimage, "/" ) ||
strstr( $oldimage, "\\" ) ) {
627 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
631 if ( wfReadOnly() ) {
632 $wgOut->readOnlyPage();
635 if( $wgUser->isAnon() ) {
636 $wgOut->showErrorPage( 'uploadnologin', 'uploadnologintext' );
639 if ( ! $this->mTitle
->userCanEdit() ) {
640 $wgOut->sysopRequired();
643 if ( $wgUser->isBlocked() ) {
644 return $this->blockedIPpage();
646 if( !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) {
647 $wgOut->showErrorPage( 'internalerror', 'sessionfailure' );
650 $name = substr( $oldimage, 15 );
652 $dest = wfImageDir( $name );
653 $archive = wfImageArchiveDir( $name );
654 $curfile = "{$dest}/{$name}";
656 if ( ! is_file( $curfile ) ) {
657 $wgOut->showFileNotFoundError( htmlspecialchars( $curfile ) );
660 $oldver = wfTimestampNow() . "!{$name}";
662 $dbr =& wfGetDB( DB_SLAVE
);
663 $size = $dbr->selectField( 'oldimage', 'oi_size', array( 'oi_archive_name' => $oldimage ) );
665 if ( ! rename( $curfile, "${archive}/{$oldver}" ) ) {
666 $wgOut->showFileRenameError( $curfile, "${archive}/{$oldver}" );
669 if ( ! copy( "{$archive}/{$oldimage}", $curfile ) ) {
670 $wgOut->showFileCopyError( "${archive}/{$oldimage}", $curfile );
674 # Record upload and update metadata cache
675 $img = Image
::newFromName( $name );
676 $img->recordUpload( $oldver, wfMsg( "reverted" ) );
678 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
679 $wgOut->setRobotpolicy( 'noindex,nofollow' );
680 $wgOut->addHTML( wfMsg( 'imagereverted' ) );
682 $descTitle = $img->getTitle();
683 $wgOut->returnToMain( false, $descTitle->getPrefixedText() );
686 function blockedIPpage() {
687 $edit = new EditPage( $this );
688 return $edit->blockedIPpage();
692 * Override handling of action=purge
695 $this->img
= new Image( $this->mTitle
);
696 if( $this->img
->exists() ) {
697 wfDebug( "ImagePage::doPurge purging " . $this->img
->getName() . "\n" );
698 $linksTo = $this->img
->getLinksTo();
699 Title
::touchArray( $linksTo );
700 $this->img
->purgeCache();
702 wfDebug( "ImagePage::doPurge no image\n" );
713 class ImageHistoryList
{
714 function ImageHistoryList( &$skin ) {
715 $this->skin
=& $skin;
718 function beginImageHistoryList() {
719 $s = "\n<h2 id=\"filehistory\">" . wfMsg( 'imghistory' ) . "</h2>\n" .
720 "<p>" . wfMsg( 'imghistlegend' ) . "</p>\n".'<ul class="special">';
724 function endImageHistoryList() {
729 function imageHistoryLine( $iscur, $timestamp, $img, $user, $usertext, $size, $description, $width, $height ) {
730 global $wgUser, $wgLang, $wgTitle, $wgContLang;
732 $datetime = $wgLang->timeanddate( $timestamp, true );
733 $del = wfMsg( 'deleteimg' );
734 $delall = wfMsg( 'deleteimgcompletely' );
735 $cur = wfMsg( 'cur' );
738 $url = Image
::imageUrl( $img );
740 if ( $wgUser->isAllowed('delete') ) {
741 $link = $wgTitle->escapeLocalURL( 'image=' . $wgTitle->getPartialURL() .
743 $style = $this->skin
->getInternalLinkAttributes( $link, $delall );
745 $dlink = '<a href="'.$link.'"'.$style.'>'.$delall.'</a>';
750 $url = htmlspecialchars( wfImageArchiveUrl( $img ) );
751 if( $wgUser->getID() != 0 && $wgTitle->userCanEdit() ) {
752 $token = urlencode( $wgUser->editToken( $img ) );
753 $rlink = $this->skin
->makeKnownLinkObj( $wgTitle,
754 wfMsg( 'revertimg' ), 'action=revert&oldimage=' .
755 urlencode( $img ) . "&wpEditToken=$token" );
756 $dlink = $this->skin
->makeKnownLinkObj( $wgTitle,
757 $del, 'action=delete&oldimage=' . urlencode( $img ) .
758 "&wpEditToken=$token" );
760 # Having live active links for non-logged in users
761 # means that bots and spiders crawling our site can
762 # inadvertently change content. Baaaad idea.
763 $rlink = wfMsg( 'revertimg' );
768 $userlink = $usertext;
770 $userlink = $this->skin
->makeLinkObj( Title
::makeTitle( NS_USER
, $usertext ), $usertext );
771 $usertalk = $this->skin
->makeLinkObj( Title
::makeTitle( NS_USER_TALK
, $usertext), $wgContLang->getNsText( NS_TALK
) );
772 $userdata = $userlink . ' (' . $usertalk . ')';
774 $nbytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
775 $wgLang->formatNum( $size ) );
776 $widthheight = wfMsg( 'widthheight', $width, $height );
777 $style = $this->skin
->getInternalLinkAttributes( $url, $datetime );
779 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$datetime}</a> . . {$userdata} . . {$widthheight} ({$nbytes})";
781 $s .= $this->skin
->commentBlock( $description, $wgTitle );