3 require_once ( "QueryPage.php" ) ;
5 class WantedPagesPage
extends QueryPage
{
11 function isExpensive() {
16 $dbr =& wfGetDB( DB_SLAVE
);
17 $brokenlinks = $dbr->tableName( 'brokenlinks' );
19 # We cheat and return the full-text from bl_to in the title.
20 # In the future, a pre-parsed name will be available.
22 "SELECT 'Wantedpages' as type,
25 COUNT(DISTINCT bl_from) as value
31 function formatResult( $skin, $result ) {
34 $nt = Title
::newFromDBkey( $result->title
);
35 if( is_null( $nt ) ) {
36 return "<!-- Bad title '" . htmlspecialchars( $result->title
) . "' -->";
38 $plink = $skin->makeBrokenLink( $nt->getPrefixedText(), "" );
39 $nl = wfMsg( "nlinks", $result->value
);
40 $nlink = $skin->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ), $nl,
41 "target=" . $nt->getPrefixedURL() );
43 return "{$plink} ({$nlink})";
47 function wfSpecialWantedpages()
49 list( $limit, $offset ) = wfCheckLimits();
51 $wpp = new WantedPagesPage();
53 $wpp->doQuery( $offset, $limit );