5 * @subpackage SpecialPage
11 require_once('QueryPage.php');
16 * @subpackage SpecialPage
18 class BrokenRedirectsPage
extends PageQueryPage
{
21 return 'brokenredirects';
24 function isExpensive( ) { return true; }
26 function getPageHeader( ) {
27 #FIXME : probably need to add a backlink to the maintenance page.
28 return '<p>'.wfMsg('brokenredirectstext')."</p><br />\n";
32 $dbr =& wfGetDB( DB_SLAVE
);
33 extract( $dbr->tableNames( 'cur', 'brokenlinks' ) );
35 $sql = "SELECT bl_to,cur_title FROM $brokenlinks,$cur " .
36 "WHERE cur_is_redirect=1 AND cur_namespace=0 AND bl_from=cur_id ";
44 function formatResult( $skin, $result ) {
47 $ns = $wgContLang->getNamespaces() ; /* not used, why bother? */
48 $from = $skin->makeKnownLink( $result->cur_title
,'', 'redirect=no' );
49 $edit = $skin->makeBrokenLink( $result->cur_title
, "(".wfMsg("qbedit").")" , 'redirect=no');
50 $to = $skin->makeBrokenLink( $result->bl_to
);
52 return "$from $edit => $to";
59 function wfSpecialBrokenRedirects() {
60 list( $limit, $offset ) = wfCheckLimits();
62 $sbr = new BrokenRedirectsPage();
64 return $sbr->doQuery( $offset, $limit );