5 * @subpackage SpecialPage
11 require_once('QueryPage.php');
16 * @subpackage SpecialPage
18 class BrokenRedirectsPage
extends PageQueryPage
{
21 return 'BrokenRedirects';
24 function isExpensive( ) { return true; }
25 function isSyndicated() { return false; }
27 function getPageHeader( ) {
28 #FIXME : probably need to add a backlink to the maintenance page.
29 return '<p>'.wfMsg('brokenredirectstext')."</p><br />\n";
33 $dbr =& wfGetDB( DB_SLAVE
);
34 extract( $dbr->tableNames( 'page', 'brokenlinks' ) );
36 $sql = "SELECT bl_to,page_title FROM $brokenlinks,$page " .
37 "WHERE page_is_redirect=1 AND page_namespace=0 AND bl_from=page_id ";
45 function formatResult( $skin, $result ) {
48 $ns = $wgContLang->getNamespaces() ; /* not used, why bother? */
49 $from = $skin->makeKnownLink( $result->page_title
,'', 'redirect=no' );
50 $edit = $skin->makeBrokenLink( $result->page_title
, "(".wfMsg("qbedit").")" , 'redirect=no');
51 $to = $skin->makeBrokenLink( $result->bl_to
);
53 return "$from $edit => $to";
60 function wfSpecialBrokenRedirects() {
61 list( $limit, $offset ) = wfCheckLimits();
63 $sbr = new BrokenRedirectsPage();
65 return $sbr->doQuery( $offset, $limit );