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->fatalError( 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->fatalError( 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->unexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
498 if ( strstr( $oldimage, "/" ) ||
strstr( $oldimage, "\\" ) ) {
499 $wgOut->unexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
503 # Invalidate description page cache
504 $this->mTitle
->invalidateCache();
509 wfImageArchiveUrl( $oldimage ),
510 $this->mTitle
->getInternalURL()
512 wfPurgeSquidServers($urlArr);
514 $this->doDeleteOldImage( $oldimage );
515 $dbw->delete( 'oldimage', array( 'oi_archive_name' => $oldimage ) );
516 $deleted = $oldimage;
518 $image = $this->mTitle
->getDBkey();
519 $dest = wfImageDir( $image );
520 $archive = wfImageDir( $image );
522 # Delete the image file if it exists; due to sync problems
523 # or manual trimming sometimes the file will be missing.
524 $targetFile = "{$dest}/{$image}";
525 if( file_exists( $targetFile ) && ! @unlink
( $targetFile ) ) {
526 # If the deletion operation actually failed, bug out:
527 $wgOut->fileDeleteError( $targetFile );
530 $dbw->delete( 'image', array( 'img_name' => $image ) );
532 if ( $dbw->affectedRows() ) {
534 $site_stats = $dbw->tableName( 'site_stats' );
535 $dbw->query( "UPDATE $site_stats SET ss_images=ss_images-1", $fname );
539 $res = $dbw->select( 'oldimage', array( 'oi_archive_name' ), array( 'oi_name' => $image ) );
541 # Purge archive URLs from the squid
543 while ( $s = $dbw->fetchObject( $res ) ) {
544 $this->doDeleteOldImage( $s->oi_archive_name
);
545 $urlArr[] = wfImageArchiveUrl( $s->oi_archive_name
);
548 # And also the HTML of all pages using this image
549 $linksTo = $this->img
->getLinksTo();
551 $u = SquidUpdate
::newFromTitles( $linksTo, $urlArr );
552 array_push( $wgPostCommitUpdateList, $u );
555 $dbw->delete( 'oldimage', array( 'oi_name' => $image ) );
557 # Image itself is now gone, and database is cleaned.
558 # Now we remove the image description page.
560 $article = new Article( $this->mTitle
);
561 $article->doDeleteArticle( $reason ); # ignore errors
563 # Invalidate parser cache and client cache for pages using this image
564 # This is left until relatively late to reduce lock time
565 Title
::touchArray( $linksTo );
567 /* Delete thumbnails and refresh image metadata cache */
568 $this->img
->purgeCache();
573 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
574 $wgOut->setRobotpolicy( 'noindex,nofollow' );
576 $loglink = '[[Special:Log/delete|' . wfMsg( 'deletionlog' ) . ']]';
577 $text = wfMsg( 'deletedtext', $deleted, $loglink );
579 $wgOut->addWikiText( $text );
581 $wgOut->returnToMain( false, $this->mTitle
->getPrefixedText() );
584 function doDeleteOldImage( $oldimage )
588 $name = substr( $oldimage, 15 );
589 $archive = wfImageArchiveDir( $name );
591 # Delete the image if it exists. Sometimes the file will be missing
592 # due to manual intervention or weird sync problems; treat that
593 # condition gracefully and continue to delete the database entry.
594 # Also some records may end up with an empty oi_archive_name field
595 # if the original file was missing when a new upload was made;
596 # don't try to delete the directory then!
598 $targetFile = "{$archive}/{$oldimage}";
599 if( $oldimage != '' && file_exists( $targetFile ) && !@unlink
( $targetFile ) ) {
600 # If we actually have a file and can't delete it, throw an error.
601 $wgOut->fileDeleteError( "{$archive}/{$oldimage}" );
604 $log = new LogPage( 'delete' );
605 $log->addEntry( 'delete', $this->mTitle
, wfMsg('deletedrevision',$oldimage) );
610 global $wgOut, $wgRequest, $wgUser;
612 $oldimage = $wgRequest->getText( 'oldimage' );
613 if ( strlen( $oldimage ) < 16 ) {
614 $wgOut->unexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
617 if ( strstr( $oldimage, "/" ) ||
strstr( $oldimage, "\\" ) ) {
618 $wgOut->unexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
622 if ( wfReadOnly() ) {
623 $wgOut->readOnlyPage();
626 if( $wgUser->isAnon() ) {
627 $wgOut->errorpage( 'uploadnologin', 'uploadnologintext' );
630 if ( ! $this->mTitle
->userCanEdit() ) {
631 $wgOut->sysopRequired();
634 if ( $wgUser->isBlocked() ) {
635 return $this->blockedIPpage();
637 if( !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) {
638 $wgOut->errorpage( 'internalerror', 'sessionfailure' );
641 $name = substr( $oldimage, 15 );
643 $dest = wfImageDir( $name );
644 $archive = wfImageArchiveDir( $name );
645 $curfile = "{$dest}/{$name}";
647 if ( ! is_file( $curfile ) ) {
648 $wgOut->fileNotFoundError( htmlspecialchars( $curfile ) );
651 $oldver = wfTimestampNow() . "!{$name}";
653 $dbr =& wfGetDB( DB_SLAVE
);
654 $size = $dbr->selectField( 'oldimage', 'oi_size', array( 'oi_archive_name' => $oldimage ) );
656 if ( ! rename( $curfile, "${archive}/{$oldver}" ) ) {
657 $wgOut->fileRenameError( $curfile, "${archive}/{$oldver}" );
660 if ( ! copy( "{$archive}/{$oldimage}", $curfile ) ) {
661 $wgOut->fileCopyError( "${archive}/{$oldimage}", $curfile );
664 # Record upload and update metadata cache
665 $img = Image
::newFromName( $name );
666 $img->recordUpload( $oldver, wfMsg( "reverted" ) );
668 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
669 $wgOut->setRobotpolicy( 'noindex,nofollow' );
670 $wgOut->addHTML( wfMsg( 'imagereverted' ) );
672 $descTitle = $img->getTitle();
673 $wgOut->returnToMain( false, $descTitle->getPrefixedText() );
676 function blockedIPpage() {
677 require_once( 'EditPage.php' );
678 $edit = new EditPage( $this );
679 return $edit->blockedIPpage();
683 * Override handling of action=purge
686 $this->img
= new Image( $this->mTitle
);
687 if( $this->img
->exists() ) {
688 wfDebug( "ImagePage::doPurge purging " . $this->img
->getName() . "\n" );
689 $linksTo = $this->img
->getLinksTo();
690 Title
::touchArray( $linksTo );
691 $this->img
->purgeCache();
693 wfDebug( "ImagePage::doPurge no image\n" );
704 class ImageHistoryList
{
705 function ImageHistoryList( &$skin ) {
706 $this->skin
=& $skin;
709 function beginImageHistoryList() {
710 $s = "\n<h2 id=\"filehistory\">" . wfMsg( 'imghistory' ) . "</h2>\n" .
711 "<p>" . wfMsg( 'imghistlegend' ) . "</p>\n".'<ul class="special">';
715 function endImageHistoryList() {
720 function imageHistoryLine( $iscur, $timestamp, $img, $user, $usertext, $size, $description, $width, $height ) {
721 global $wgUser, $wgLang, $wgTitle, $wgContLang;
723 $datetime = $wgLang->timeanddate( $timestamp, true );
724 $del = wfMsg( 'deleteimg' );
725 $delall = wfMsg( 'deleteimgcompletely' );
726 $cur = wfMsg( 'cur' );
729 $url = Image
::imageUrl( $img );
731 if ( $wgUser->isAllowed('delete') ) {
732 $link = $wgTitle->escapeLocalURL( 'image=' . $wgTitle->getPartialURL() .
734 $style = $this->skin
->getInternalLinkAttributes( $link, $delall );
736 $dlink = '<a href="'.$link.'"'.$style.'>'.$delall.'</a>';
741 $url = htmlspecialchars( wfImageArchiveUrl( $img ) );
742 if( $wgUser->getID() != 0 && $wgTitle->userCanEdit() ) {
743 $token = urlencode( $wgUser->editToken( $img ) );
744 $rlink = $this->skin
->makeKnownLinkObj( $wgTitle,
745 wfMsg( 'revertimg' ), 'action=revert&oldimage=' .
746 urlencode( $img ) . "&wpEditToken=$token" );
747 $dlink = $this->skin
->makeKnownLinkObj( $wgTitle,
748 $del, 'action=delete&oldimage=' . urlencode( $img ) .
749 "&wpEditToken=$token" );
751 # Having live active links for non-logged in users
752 # means that bots and spiders crawling our site can
753 # inadvertently change content. Baaaad idea.
754 $rlink = wfMsg( 'revertimg' );
759 $userlink = $usertext;
761 $userlink = $this->skin
->makeLinkObj( Title
::makeTitle( NS_USER
, $usertext ), $usertext );
762 $usertalk = $this->skin
->makeLinkObj( Title
::makeTitle( NS_USER_TALK
, $usertext), $wgContLang->getNsText( NS_TALK
) );
763 $userdata = $userlink . ' (' . $usertalk . ')';
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> . . {$userdata} . . {$widthheight} ({$nbytes})";
772 $s .= $this->skin
->commentBlock( $description, $wgTitle );