<?php
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
+/**
+ *
+ */
require_once('QueryPage.php');
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
class DoubleRedirectsPage extends PageQueryPage {
function getName() {
- return 'doubleredirects';
+ return 'DoubleRedirects';
}
function isExpensive( ) { return true; }
+ function isSyndicated() { return false; }
function getPageHeader( ) {
#FIXME : probably need to add a backlink to the maintenance page.
- return '<p>'.wfMsg("doubleredirectstext")."</p><br>\n";
+ return '<p>'.wfMsg("doubleredirectstext")."</p><br />\n";
}
function getSQL() {
$dbr =& wfGetDB( DB_SLAVE );
- extract( $dbr->tableNames( 'cur', 'links' ) );
-
- $sql = "SELECT ca.cur_namespace as ns_a, ca.cur_title as title_a," .
- " cb.cur_namespace as ns_b, cb.cur_title as title_b," .
- " cb.cur_text AS rt " .
- "FROM $links,$cur AS ca,$cur AS cb ".
- "WHERE ca.cur_is_redirect=1 AND cb.cur_is_redirect=1 AND l_to=cb.cur_id " .
- " AND l_from=ca.cur_id " ;
+ extract( $dbr->tableNames( 'page', 'links', 'text' ) );
+
+ $sql = "SELECT pa.page_namespace as ns_a, pa.page_title as title_a,
+ pb.page_namespace as ns_b, pb.page_title as title_b,
+ old_text AS rt
+ FROM $text AS t, $links,$page AS pa,$page AS pb
+ WHERE pa.page_is_redirect=1 AND pb.page_is_redirect=1 AND l_to=pb.page_id
+ AND l_from=pa.page_id
+ AND pb.page_latest=t.old_id" ;
return $sql;
}
}
function formatResult( $skin, $result ) {
- global $wgLang ;
- $ns = $wgLang->getNamespaces() ;
+ global $wgContLang ;
+ $ns = $wgContLang->getNamespaces() ;
$from = $skin->makeKnownLink( $ns[$result->ns_a].':'.$result->title_a ,'', 'redirect=no' );
$edit = $skin->makeBrokenLink( $ns[$result->ns_a].':'.$result->title_a , "(".wfMsg("qbedit").")" , 'redirect=no');
$to = $skin->makeKnownLink( $ns[$result->ns_b].':'.$result->title_b ,'');
}
}
+/**
+ * constructor
+ */
function wfSpecialDoubleRedirects() {
list( $limit, $offset ) = wfCheckLimits();