9 require_once('QueryPage.php');
14 class DoubleRedirectsPage
extends PageQueryPage
{
17 return 'doubleredirects';
20 function isExpensive( ) { return true; }
22 function getPageHeader( ) {
23 #FIXME : probably need to add a backlink to the maintenance page.
24 return '<p>'.wfMsg("doubleredirectstext")."</p><br>\n";
28 $dbr =& wfGetDB( DB_SLAVE
);
29 extract( $dbr->tableNames( 'cur', 'links' ) );
31 $sql = "SELECT ca.cur_namespace as ns_a, ca.cur_title as title_a," .
32 " cb.cur_namespace as ns_b, cb.cur_title as title_b," .
33 " cb.cur_text AS rt " .
34 "FROM $links,$cur AS ca,$cur AS cb ".
35 "WHERE ca.cur_is_redirect=1 AND cb.cur_is_redirect=1 AND l_to=cb.cur_id " .
36 " AND l_from=ca.cur_id " ;
44 function formatResult( $skin, $result ) {
46 $ns = $wgLang->getNamespaces() ;
47 $from = $skin->makeKnownLink( $ns[$result->ns_a
].':'.$result->title_a
,'', 'redirect=no' );
48 $edit = $skin->makeBrokenLink( $ns[$result->ns_a
].':'.$result->title_a
, "(".wfMsg("qbedit").")" , 'redirect=no');
49 $to = $skin->makeKnownLink( $ns[$result->ns_b
].':'.$result->title_b
,'');
50 $content = $result->rt
;
52 return "$from $edit => $to ($content)";
59 function wfSpecialDoubleRedirects() {
60 list( $limit, $offset ) = wfCheckLimits();
62 $sdr = new DoubleRedirectsPage();
64 return $sdr->doQuery( $offset, $limit );