04f56ca53b2c32344664d572058f9589d15d23d6
3 require_once('QueryPage.php');
5 class DisambiguationsPage
extends PageQueryPage
{
8 return 'disambiguations';
11 function isExpensive( ) { return true; }
13 function getPageHeader( ) {
15 $sk = $wgUser->getSkin();
17 #FIXME : probably need to add a backlink to the maintenance page.
18 return '<p>'.wfMsg("disambiguationstext", $sk->makeKnownLink(wfMsg('disambiguationspage')) )."</p><br>\n";
22 $dbr =& wfGetDB( DB_SLAVE
);
23 extract( $dbr->tableNames( 'cur', 'links' ) );
25 $dp = Title
::newFromText(wfMsg("disambiguationspage"));
26 $dpid = $dp->getArticleID();
28 $sql = "SELECT ca.cur_namespace AS ns_art, ca.cur_title AS title_art,"
29 . " cb.cur_namespace AS ns_dis, cb.cur_title AS title_dis"
30 . " FROM links as la, links as lb, cur as ca, cur as cb"
31 . " WHERE la.l_to = '{$dpid}'"
32 . " AND la.l_from = lb.l_to"
33 . " AND ca.cur_id = lb.l_from"
34 . " AND cb.cur_id = lb.l_to";
43 function formatResult( $skin, $result ) {
45 $ns = $wgLang->getNamespaces() ;
47 $from = $skin->makeKnownLink( $ns[$result->ns_art
].':'.$result->title_art
,'');
48 $edit = $skin->makeBrokenLink( $ns[$result->ns_art
].':'.$result->title_art
, "(".wfMsg("qbedit").")" , 'redirect=no');
49 $to = $skin->makeKnownLink( $ns[$result->ns_dis
].':'.$result->title_dis
,'');
51 return "$from $edit => $to";
55 function wfSpecialDisambiguations() {
56 list( $limit, $offset ) = wfCheckLimits();
58 $sd = new DisambiguationsPage();
60 return $sd->doQuery( $offset, $limit );