+ $wgOut->addHTML( "<div id='mw-imagepage-section-linkstoimage'>\n" );
+ $wgOut->addWikiMsg( 'linkstoimage', $count );
+ $wgOut->addHTML( "<ul class='mw-imagepage-linktoimage'>\n" );
+
+ $sk = $wgUser->getSkin();
+ $count = 0;
+ while ( $s = $res->fetchObject() ) {
+ $count++;
+ if ( $count <= $limit ) {
+ // We have not yet reached the extra one that tells us there is more to fetch
+ $name = Title::makeTitle( $s->page_namespace, $s->page_title );
+ $link = $sk->makeKnownLinkObj( $name, "" );
+ $wgOut->addHTML( "<li>{$link}</li>\n" );
+ }
+ }
+ $wgOut->addHTML( "</ul></div>\n" );
+ $res->free();
+
+ // Add a links to [[Special:Whatlinkshere]]
+ if ( $count > $limit )
+ $wgOut->addWikiMsg( 'morelinkstoimage', $this->mTitle->getPrefixedDBkey() );
+ }
+
+ function imageRedirects()
+ {
+ global $wgUser, $wgOut;
+
+ $redirects = $this->getTitle()->getRedirectsHere( NS_IMAGE );
+ if ( count( $redirects ) == 0 ) return;
+
+ $wgOut->addHTML( "<div id='mw-imagepage-section-redirectstofile'>\n" );
+ $wgOut->addWikiMsg( 'redirectstofile', count( $redirects ) );
+ $wgOut->addHTML( "<ul class='mw-imagepage-redirectstofile'>\n" );
+
+ $sk = $wgUser->getSkin();
+ foreach ( $redirects as $title ) {
+ $link = $sk->makeKnownLinkObj( $title, "", "redirect=no" );
+ $wgOut->addHTML( "<li>{$link}</li>\n" );
+ }
+ $wgOut->addHTML( "</ul></div>\n" );
+
+ }
+
+ function imageDupes() {
+ global $wgOut, $wgUser;
+
+ $this->loadFile();
+
+ $dupes = $this->getDuplicates();
+ if ( count( $dupes ) == 0 ) return;
+
+ $wgOut->addHTML( "<div id='mw-imagepage-section-duplicates'>\n" );
+ $wgOut->addWikiMsg( 'duplicatesoffile', count( $dupes ) );
+ $wgOut->addHTML( "<ul class='mw-imagepage-duplicates'>\n" );