* Removing the if($wgMetaNamespace === FALSE) line, inherited from the parent.
[mediawiki.git] / includes / SpecialDoubleRedirects.php
blobcc044f12c7c1416e57e328ead47f39b540d0fb2b
1 <?php
2 /**
4 * @package MediaWiki
5 * @subpackage SpecialPage
6 */
8 /**
9 *
11 require_once('QueryPage.php');
13 /**
15 * @package MediaWiki
16 * @subpackage SpecialPage
18 class DoubleRedirectsPage extends PageQueryPage {
20 function getName() {
21 return 'DoubleRedirects';
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("doubleredirectstext")."</p><br />\n";
32 function getSQL() {
33 $dbr =& wfGetDB( DB_SLAVE );
34 extract( $dbr->tableNames( 'page', 'links', 'text' ) );
36 $sql = "SELECT pa.page_namespace as ns_a, pa.page_title as title_a,
37 pb.page_namespace as ns_b, pb.page_title as title_b,
38 old_text AS rt
39 FROM $text AS t, $links,$page AS pa,$page AS pb
40 WHERE pa.page_is_redirect=1 AND pb.page_is_redirect=1 AND l_to=pb.page_id
41 AND l_from=pa.page_id
42 AND pb.page_latest=t.old_id" ;
43 return $sql;
46 function getOrder() {
47 return '';
50 function formatResult( $skin, $result ) {
51 global $wgContLang ;
52 $ns = $wgContLang->getNamespaces() ;
53 $from = $skin->makeKnownLink( $ns[$result->ns_a].':'.$result->title_a ,'', 'redirect=no' );
54 $edit = $skin->makeBrokenLink( $ns[$result->ns_a].':'.$result->title_a , "(".wfMsg("qbedit").")" , 'redirect=no');
55 $to = $skin->makeKnownLink( $ns[$result->ns_b].':'.$result->title_b ,'');
56 $content = $result->rt;
58 return "$from $edit => $to ($content)";
62 /**
63 * constructor
65 function wfSpecialDoubleRedirects() {
66 list( $limit, $offset ) = wfCheckLimits();
68 $sdr = new DoubleRedirectsPage();
70 return $sdr->doQuery( $offset, $limit );