5fda1684a4b21c96f148548cd52552e67b2d1a2c
9 require_once('QueryPage.php');
14 class DisambiguationsPage
extends PageQueryPage
{
17 return 'disambiguations';
20 function isExpensive( ) { return true; }
22 function getPageHeader( ) {
24 $sk = $wgUser->getSkin();
26 #FIXME : probably need to add a backlink to the maintenance page.
27 return '<p>'.wfMsg("disambiguationstext", $sk->makeKnownLink(wfMsg('disambiguationspage')) )."</p><br>\n";
31 $dbr =& wfGetDB( DB_SLAVE
);
32 extract( $dbr->tableNames( 'cur', 'links' ) );
34 $dp = Title
::newFromText(wfMsg("disambiguationspage"));
35 $dpid = $dp->getArticleID();
37 $sql = "SELECT ca.cur_namespace AS ns_art, ca.cur_title AS title_art,"
38 . " cb.cur_namespace AS ns_dis, cb.cur_title AS title_dis"
39 . " FROM links as la, links as lb, cur as ca, cur as cb"
40 . " WHERE la.l_to = '{$dpid}'"
41 . " AND la.l_from = lb.l_to"
42 . " AND ca.cur_id = lb.l_from"
43 . " AND cb.cur_id = lb.l_to";
52 function formatResult( $skin, $result ) {
54 $ns = $wgLang->getNamespaces() ;
56 $from = $skin->makeKnownLink( $ns[$result->ns_art
].':'.$result->title_art
,'');
57 $edit = $skin->makeBrokenLink( $ns[$result->ns_art
].':'.$result->title_art
, "(".wfMsg("qbedit").")" , 'redirect=no');
58 $to = $skin->makeKnownLink( $ns[$result->ns_dis
].':'.$result->title_dis
,'');
60 return "$from $edit => $to";
67 function wfSpecialDisambiguations() {
68 list( $limit, $offset ) = wfCheckLimits();
70 $sd = new DisambiguationsPage();
72 return $sd->doQuery( $offset, $limit );