From: Antoine Musso Date: Sat, 21 Aug 2004 22:05:47 +0000 (+0000) Subject: Moving disambiguations code from specialMaintenance. Fixing the function meantime X-Git-Tag: 1.5.0alpha1~2265 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=fe299887d8c5fcbfcc9defeb3437564c2b47851c;p=lhc%2Fweb%2Fwiklou.git Moving disambiguations code from specialMaintenance. Fixing the function meantime --- diff --git a/includes/SpecialDisambiguations.php b/includes/SpecialDisambiguations.php new file mode 100644 index 0000000000..b0a28bad60 --- /dev/null +++ b/includes/SpecialDisambiguations.php @@ -0,0 +1,60 @@ +'.wfMsg("disambiguationstext", wfMsg("disambiguationspage"))."


\n"; + } + + function getSQL() { + $dbr =& wfGetDB( DB_SLAVE ); + extract( $dbr->tableNames( 'cur', 'links' ) ); + + $dp = Title::newFromText(wfMsg("disambiguationspage")); + $dpid = $dp->getArticleID(); + + $sql = "SELECT ca.cur_namespace AS ns_art, ca.cur_title AS title_art," + . " cb.cur_namespace AS ns_dis, cb.cur_title AS title_dis" + . " FROM links as la, links as lb, cur as ca, cur as cb" + . " WHERE la.l_to = '{$dpid}'" + . " AND la.l_from = lb.l_to" + . " AND ca.cur_id = lb.l_from" + . " AND cb.cur_id = lb.l_to"; + + return $sql; + } + + function getOrder() { + return ''; + } + + function formatResult( $skin, $result ) { + global $wgLang ; + $ns = $wgLang->getNamespaces() ; + + $from = $skin->makeKnownLink( $ns[$result->ns_art].':'.$result->title_art ,''); + $edit = $skin->makeBrokenLink( $ns[$result->ns_art].':'.$result->title_art , "(".wfMsg("qbedit").")" , 'redirect=no'); + $to = $skin->makeKnownLink( $ns[$result->ns_dis].':'.$result->title_dis ,''); + + return "$from $edit => $to"; + } +} + +function wfSpecialDisambiguations() { + list( $limit, $offset ) = wfCheckLimits(); + + $sd = new DisambiguationsPage(); + + return $sd->doQuery( $offset, $limit ); + +} +?> diff --git a/includes/SpecialMaintenance.php b/includes/SpecialMaintenance.php index 220da9af5a..8b76d3e65b 100644 --- a/includes/SpecialMaintenance.php +++ b/includes/SpecialMaintenance.php @@ -52,7 +52,7 @@ function wfSpecialMaintenance( $par=NULL ) { # Links to subfunctions $r .= "