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.
34 $agrvalue=$dbr->aggregateValue('COUNT(DISTINCT bl_from)');
36 "SELECT 'Wantedpages' as type,
39 COUNT(DISTINCT bl_from) as value
44 ($this->sortDescending() ?
'DESC' : '');
51 function formatResult( $skin, $result ) {
54 $nt = Title
::newFromDBkey( $result->title
);
55 if( is_null( $nt ) ) {
56 return "<!-- Bad title '" . htmlspecialchars( $result->title
) . "' -->";
58 $plink = $skin->makeBrokenLink( $nt->getPrefixedText(), "" );
59 $nl = wfMsg( "nlinks", $result->value
);
60 $nlink = $skin->makeKnownLink( $wgContLang->specialPage( "Whatlinkshere" ), $nl,
61 "target=" . $nt->getPrefixedURL() );
63 return "{$plink} ({$nlink})";
70 function wfSpecialWantedpages() {
71 list( $limit, $offset ) = wfCheckLimits();
73 $wpp = new WantedPagesPage();
75 $wpp->doQuery( $offset, $limit );