Tell regexp parser to use extra analysis on external link regexp;
[lhc/web/wiklou.git] / includes / SpecialDoubleRedirects.php
1 <?php
2 /**
3 *
4 * @package MediaWiki
5 * @subpackage SpecialPage
6 */
7
8 /**
9 *
10 */
11 require_once('QueryPage.php');
12
13 /**
14 *
15 * @package MediaWiki
16 * @subpackage SpecialPage
17 */
18 class DoubleRedirectsPage extends PageQueryPage {
19
20 function getName() {
21 return 'doubleredirects';
22 }
23
24 function isExpensive( ) { return true; }
25 function isSyndicated() { return false; }
26
27 function getPageHeader( ) {
28 #FIXME : probably need to add a backlink to the maintenance page.
29 return '<p>'.wfMsg("doubleredirectstext")."</p><br>\n";
30 }
31
32 function getSQL() {
33 $dbr =& wfGetDB( DB_SLAVE );
34 extract( $dbr->tableNames( 'cur', 'links' ) );
35
36 $sql = "SELECT ca.cur_namespace as ns_a, ca.cur_title as title_a," .
37 " cb.cur_namespace as ns_b, cb.cur_title as title_b," .
38 " cb.cur_text AS rt " .
39 "FROM $links,$cur AS ca,$cur AS cb ".
40 "WHERE ca.cur_is_redirect=1 AND cb.cur_is_redirect=1 AND l_to=cb.cur_id " .
41 " AND l_from=ca.cur_id " ;
42 return $sql;
43 }
44
45 function getOrder() {
46 return '';
47 }
48
49 function formatResult( $skin, $result ) {
50 global $wgContLang ;
51 $ns = $wgContLang->getNamespaces() ;
52 $from = $skin->makeKnownLink( $ns[$result->ns_a].':'.$result->title_a ,'', 'redirect=no' );
53 $edit = $skin->makeBrokenLink( $ns[$result->ns_a].':'.$result->title_a , "(".wfMsg("qbedit").")" , 'redirect=no');
54 $to = $skin->makeKnownLink( $ns[$result->ns_b].':'.$result->title_b ,'');
55 $content = $result->rt;
56
57 return "$from $edit => $to ($content)";
58 }
59 }
60
61 /**
62 * constructor
63 */
64 function wfSpecialDoubleRedirects() {
65 list( $limit, $offset ) = wfCheckLimits();
66
67 $sdr = new DoubleRedirectsPage();
68
69 return $sdr->doQuery( $offset, $limit );
70
71 }
72 ?>