$this->closeShowImage();
$this->imageHistory();
$this->imageLinks();
+ if ( $this->img->isLocal() ) $this->imageRedirects();
if ( $showmeta ) {
global $wgStylePath, $wgStyleVersion;
}
$wgOut->addHTML( "</ul>\n" );
}
+
+ function imageRedirects()
+ {
+ global $wgUser, $wgOut;
+
+ $dbr = wfGetDB( DB_SLAVE );
+ $res = $dbr->select(
+ array( 'redirect', 'page' ),
+ array( 'page_title' ),
+ array(
+ 'rd_namespace' => NS_IMAGE,
+ 'rd_title' => $this->mTitle->getDBkey(),
+ 'page_namespace' => NS_IMAGE,
+ 'rd_from = page_id'
+ )
+ );
+
+
+ if ( 0 == $dbr->numRows( $res ) )
+ return;
+
+ $wgOut->addHTML( '<p>' . wfMsg( 'redirectstofile' ) . "</p>\n<ul>" );
+
+ $sk = $wgUser->getSkin();
+ while ( $row = $dbr->fetchObject( $res ) ) {
+ $name = Title::makeTitle( NS_IMAGE, $row->page_title );
+ $link = $sk->makeKnownLinkObj( $name, "" );
+ wfDebug("Image redirect: {$row->page_title}\n");
+ $wgOut->addHTML( "<li>{$link}</li>\n" );
+ }
+ $wgOut->addHTML( "</ul>\n" );
+
+ $res->free();
+ }
/**
* Delete the file, or an earlier version of it
'imagelinks' => 'Links',
'linkstoimage' => 'The following pages link to this file:',
'nolinkstoimage' => 'There are no pages that link to this file.',
+'redirectstofile' => 'The following files redirect to this file:',
'sharedupload' => 'This file is a shared upload and may be used by other projects.',
'shareduploadwiki' => 'Please see the $1 for further information.',
'shareduploadwiki-desc' => 'The description on its $1 there is shown below.',