5 * @subpackage SpecialPage
11 require_once ( 'QueryPage.php' ) ;
16 * @subpackage SpecialPage
18 class WantedPagesPage
extends QueryPage
{
24 function isExpensive() {
27 function isSyndicated() { return false; }
30 $dbr =& wfGetDB( DB_SLAVE
);
31 $brokenlinks = $dbr->tableName( 'brokenlinks' );
33 # We cheat and return the full-text from bl_to in the title.
34 # In the future, a pre-parsed name will be available.
35 $agrvalue=$dbr->aggregateValue('COUNT(DISTINCT bl_from)');
37 "SELECT 'Wantedpages' as type,
40 COUNT(DISTINCT bl_from) as value
45 ($this->sortDescending() ?
'DESC' : '');
52 function formatResult( $skin, $result ) {
55 $nt = Title
::newFromDBkey( $result->title
);
56 if( is_null( $nt ) ) {
57 return "<!-- Bad title '" . htmlspecialchars( $result->title
) . "' -->";
59 $plink = $skin->makeBrokenLink( $nt->getPrefixedText(), "" );
60 $nl = wfMsg( "nlinks", $result->value
);
61 $nlink = $skin->makeKnownLink( $wgContLang->specialPage( "Whatlinkshere" ), $nl,
62 "target=" . $nt->getPrefixedURL() );
64 return "{$plink} ({$nlink})";
71 function wfSpecialWantedpages() {
72 list( $limit, $offset ) = wfCheckLimits();
74 $wpp = new WantedPagesPage();
76 $wpp->doQuery( $offset, $limit );