9 require_once ( 'QueryPage.php' ) ;
14 class WantedPagesPage
extends QueryPage
{
20 function isExpensive() {
25 $dbr =& wfGetDB( DB_SLAVE
);
26 $brokenlinks = $dbr->tableName( 'brokenlinks' );
28 # We cheat and return the full-text from bl_to in the title.
29 # In the future, a pre-parsed name will be available.
31 "SELECT 'Wantedpages' as type,
34 COUNT(DISTINCT bl_from) as value
40 function formatResult( $skin, $result ) {
43 $nt = Title
::newFromDBkey( $result->title
);
44 if( is_null( $nt ) ) {
45 return "<!-- Bad title '" . htmlspecialchars( $result->title
) . "' -->";
47 $plink = $skin->makeBrokenLink( $nt->getPrefixedText(), "" );
48 $nl = wfMsg( "nlinks", $result->value
);
49 $nlink = $skin->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ), $nl,
50 "target=" . $nt->getPrefixedURL() );
52 return "{$plink} ({$nlink})";
59 function wfSpecialWantedpages() {
60 list( $limit, $offset ) = wfCheckLimits();
62 $wpp = new WantedPagesPage();
64 $wpp->doQuery( $offset, $limit );