3 include_once ( "QueryPage.php" ) ;
5 class WantedPagesPage
extends QueryPage
{
11 function isExpensive() {
15 function getSQL( $offset, $limit ) {
16 return "SELECT bl_to, COUNT( DISTINCT bl_from ) as nlinks " .
17 "FROM brokenlinks GROUP BY bl_to HAVING nlinks > 1 " .
18 "ORDER BY nlinks DESC LIMIT {$offset}, {$limit}";
21 function formatResult( $skin, $result ) {
24 $nt = Title
::newFromDBkey( $result->bl_to
);
26 $plink = $skin->makeBrokenLink( $nt->getPrefixedText(), "" );
27 $nl = wfMsg( "nlinks", $result->nlinks
);
28 $nlink = $skin->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ), $nl,
29 "target=" . $nt->getPrefixedURL() );
31 return "{$plink} ({$nlink})";
35 function wfSpecialWantedpages()
37 list( $limit, $offset ) = wfCheckLimits();
39 $wpp = new WantedPagesPage();
41 $wpp->doQuery( $offset, $limit );