* Remove useless whitespace from Special:Brokenredirects header
* Treat "allmessagesnotsupporteddb" as wikitext when echoing; change default
text
-* (bug 5497) regeression in HTML normalization in 1.6 (unclosed <li>,<dd>,<dt>)
+* (bug 5497) Regression in HTML normalization in 1.6 (unclosed <li>,<dd>,<dt>)
* (bug 5709) Allow customisation of separator for categories
* (bug 5684) Introduce Special:Randomredirect
* (bug 5611) Add a name attribute to the text box containing source text in
* Silently ignore errors on profiling table update.
* (bug 5801) Correct handling of underscores in Special:Listusers
* Clean up Special:Listusers; add an "(all)" label to the group selection box
+* (bug 5812) Use appropriate link colour in Special:Mostlinked
== Compatibility ==
<?php
+
/**
* A special page to show pages ordered by the number of pages linking to them
*
* @subpackage SpecialPage
*
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
+ * @author Rob Church <robchur@gmail.com>
* @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
+ * @copyright © 2006 Rob Church
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
*/
HAVING COUNT(*) > 1";
}
- function formatResult( $skin, $result ) {
- global $wgContLang;
-
- $nt = Title::makeTitle( $result->namespace, $result->title );
- $text = $wgContLang->convert( $nt->getPrefixedText() );
-
- if ( $this->isCached() )
- $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text );
- else {
- $plink = is_null( $result->page_namespace )
- ? $skin->makeBrokenLink( $nt->getPrefixedText(), $text )
- : $skin->makeKnownLink( $nt->getPrefixedText(), $text );
+ /**
+ * Pre-fill the link cache
+ */
+ function preprocessResults( &$dbr, $res ) {
+ if( $dbr->numRows( $res ) > 0 ) {
+ $linkBatch = new LinkBatch();
+ while( $row = $dbr->fetchObject( $res ) )
+ $linkBatch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) );
+ $dbr->dataSeek( $res, 0 );
+ $linkBatch->execute();
}
+ }
- $nl = wfMsg( 'nlinks', $result->value );
- $nlink = $skin->makeKnownLink( $wgContLang->specialPage( 'Whatlinkshere' ), $nl, 'target=' . $nt->getPrefixedURL() );
+ /**
+ * Make a link to "what links here" for the specified title
+ *
+ * @param $title Title being queried
+ * @param $skin Skin to use
+ * @return string
+ */
+ function makeWlhLink( &$title, $caption, &$skin ) {
+ $wlh = Title::makeTitle( NS_SPECIAL, 'Whatlinkshere' );
+ return $skin->makeKnownLinkObj( $wlh, $caption, 'target=' . $title->getPrefixedUrl() );
+ }
- return wfSpecialList($plink, $nlink);
+ /**
+ * Make links to the page corresponding to the item, and the "what links here" page for it
+ *
+ * @param $skin Skin to be used
+ * @param $result Result row
+ * @return string
+ */
+ function formatResult( $skin, $result ) {
+ $title = Title::makeTitleSafe( $result->namespace, $result->title );
+ $link = $skin->makeLinkObj( $title );
+ $wlh = $this->makeWlhLink( $title, wfMsgHtml( 'nlinks', $result->value ), $skin );
+ return wfSpecialList( $link, $wlh );
}
}