5 * @subpackage SpecialPage
11 require_once ( 'QueryPage.php' ) ;
16 * @subpackage SpecialPage
18 class WantedPagesPage
extends QueryPage
{
24 function isExpensive() {
29 $dbr =& wfGetDB( DB_SLAVE
);
30 $brokenlinks = $dbr->tableName( 'brokenlinks' );
32 # We cheat and return the full-text from bl_to in the title.
33 # In the future, a pre-parsed name will be available.
35 "SELECT 'Wantedpages' as type,
38 COUNT(DISTINCT bl_from) as value
44 function formatResult( $skin, $result ) {
47 $nt = Title
::newFromDBkey( $result->title
);
48 if( is_null( $nt ) ) {
49 return "<!-- Bad title '" . htmlspecialchars( $result->title
) . "' -->";
51 $plink = $skin->makeBrokenLink( $nt->getPrefixedText(), "" );
52 $nl = wfMsg( "nlinks", $result->value
);
53 $nlink = $skin->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ), $nl,
54 "target=" . $nt->getPrefixedURL() );
56 return "{$plink} ({$nlink})";
63 function wfSpecialWantedpages() {
64 list( $limit, $offset ) = wfCheckLimits();
66 $wpp = new WantedPagesPage();
68 $wpp->doQuery( $offset, $limit );