getValidSpecialPages() ; $log = new LogPage( $vsp["Wantedpages"] ); $log->mUpdateRecentChanges = false; $wgOut->setRobotpolicy( "noindex,nofollow" ); global $wgMiserMode; if ( $wgMiserMode ) { $log->showAsDisabledPage(); return; } list( $limit, $offset ) = wfCheckLimits(); $cache = "" ; # To be saved, eventually $sql = "SELECT bl_to, COUNT( DISTINCT bl_from ) as nlinks " . "FROM brokenlinks GROUP BY bl_to HAVING nlinks > 1 " . "ORDER BY nlinks DESC LIMIT {$offset}, {$limit}"; $res = wfQuery( $sql, DB_READ, $fname ); $sk = $wgUser->getSkin(); $top = wfShowingResults( $offset, $limit ); $wgOut->addHTML( "

{$top}\n" ); $sl = wfViewPrevNext( $offset, $limit, $wgLang->specialpage( "Wantedpages" ) ); $wgOut->addHTML( "
{$sl}\n" ); $s = "

    "; while ( $obj = wfFetchObject( $res ) ) { $nt = Title::newFromDBkey( $obj->bl_to ); $plink = $sk->makeBrokenLink( $nt->getPrefixedText(), "" ); $nl = wfMsg( "nlinks", $obj->nlinks ); $nlink = $sk->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ), $nl, "target=" . $nt->getPrefixedURL() ); $cache .= "* [[".$nt->getPrefixedText()."]] ({$nl})\n" ; $s .= "
  1. {$plink} ({$nlink})
  2. \n"; } wfFreeResult( $res ); $s .= "
"; $wgOut->addHTML( $s ); $wgOut->addHTML( "

{$sl}\n" ); # Saving cache if ( $offset > 0 OR $limit < 50 ) return ; #Not suitable $log->replaceContent( $s ); } ?>