From 5a64ba85951ff49561c7e4c8178c96addd57cf80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 18 Oct 2005 13:28:21 +0000 Subject: [PATCH] * Don't display nlinks by default when being included but allow them to be displayed optionally --- includes/SpecialWantedpages.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/includes/SpecialWantedpages.php b/includes/SpecialWantedpages.php index 428e3e94b5..bccd6e41a4 100644 --- a/includes/SpecialWantedpages.php +++ b/includes/SpecialWantedpages.php @@ -16,8 +16,11 @@ require_once 'QueryPage.php'; * @subpackage SpecialPage */ class WantedPagesPage extends QueryPage { - function WantedPagesPage( $inc = false ) { + var $nlinks; + + function WantedPagesPage( $inc = false, $nlinks = true ) { $this->setListoutput( $inc ); + $this->nlinks = $nlinks; } function getName() { @@ -76,7 +79,7 @@ class WantedPagesPage extends QueryPage { $nl = wfMsg( 'nlinks', $result->value ); $nlink = $skin->makeKnownLink( $wgContLang->specialPage( 'Whatlinkshere' ), $nl, 'target=' . $nt->getPrefixedURL() ); - return "$plink ($nlink)"; + return $this->nlinks ? "$plink ($nlink)" : $plink; } } @@ -87,12 +90,16 @@ function wfSpecialWantedpages( $par = null, $specialPage ) { $inc = $specialPage->including(); if ( $inc ) { - $limit = (int)$par; + @list( $limit, $nlinks ) = explode( '/', $par, 2 ); + $limit = (int)$limit; + $nlinks = $nlinks === 'nlinks'; $offset = 0; - } else + } else { list( $limit, $offset ) = wfCheckLimits(); + $nlinks = true; + } - $wpp = new WantedPagesPage( $inc ); + $wpp = new WantedPagesPage( $inc, $nlinks ); $wpp->doQuery( $offset, $limit, !$inc ); } -- 2.20.1