X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMostlinked.php;h=66814cb93f47564e1ec38ceaa70bfced9ac6efc7;hb=08299be12d9ecb771e90d5cfc7236939edd9fe4f;hp=47e8fbfd0b6b28366d64107595a3871a632ae72c;hpb=dbb2b3e66442ca1daf23b0aebe86f88a1f5d1320;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialMostlinked.php b/includes/specials/SpecialMostlinked.php index 47e8fbfd0b..66814cb93f 100644 --- a/includes/specials/SpecialMostlinked.php +++ b/includes/specials/SpecialMostlinked.php @@ -36,15 +36,20 @@ class MostlinkedPage extends QueryPage { parent::__construct( $name ); } - function isExpensive() { return true; } - function isSyndicated() { return false; } + function isExpensive() { + return true; + } + + function isSyndicated() { + return false; + } function getQueryInfo() { return array ( 'tables' => array ( 'pagelinks', 'page' ), - 'fields' => array ( 'pl_namespace AS namespace', - 'pl_title AS title', - 'COUNT(*) AS value', + 'fields' => array ( 'namespace' => 'pl_namespace', + 'title' => 'pl_title', + 'value' => 'COUNT(*)', 'page_namespace' ), 'options' => array ( 'HAVING' => 'COUNT(*) > 1', 'GROUP BY' => array( 'pl_namespace', 'pl_title', @@ -62,12 +67,12 @@ class MostlinkedPage extends QueryPage { * @param $res */ function preprocessResults( $db, $res ) { - if( $db->numRows( $res ) > 0 ) { + if ( $res->numRows() > 0 ) { $linkBatch = new LinkBatch(); foreach ( $res as $row ) { $linkBatch->add( $row->namespace, $row->title ); } - $db->dataSeek( $res, 0 ); + $res->seek( 0 ); $linkBatch->execute(); } } @@ -94,7 +99,8 @@ class MostlinkedPage extends QueryPage { function formatResult( $skin, $result ) { $title = Title::makeTitleSafe( $result->namespace, $result->title ); if ( !$title ) { - return ''; + return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ), + Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) ); } $link = Linker::link( $title ); $wlh = $this->makeWlhLink( $title,