8 * implements Special:Wantedpages
11 class WantedPagesPage
extends WantedQueryPage
{
14 function WantedPagesPage( $inc = false, $nlinks = true ) {
15 $this->setListoutput( $inc );
16 $this->nlinks
= $nlinks;
24 global $wgWantedPagesThreshold;
25 $count = $wgWantedPagesThreshold - 1;
26 $dbr = wfGetDB( DB_SLAVE
);
27 $pagelinks = $dbr->tableName( 'pagelinks' );
28 $page = $dbr->tableName( 'page' );
29 $sql = "SELECT 'Wantedpages' AS type,
30 pl_namespace AS namespace,
34 LEFT JOIN $page AS pg1
35 ON pl_namespace = pg1.page_namespace AND pl_title = pg1.page_title
36 LEFT JOIN $page AS pg2
37 ON pl_from = pg2.page_id
38 WHERE pg1.page_namespace IS NULL
39 AND pl_namespace NOT IN ( " . NS_USER
. ", ". NS_USER_TALK
. ")
40 AND pg2.page_namespace != " . NS_MEDIAWIKI
. "
41 GROUP BY pl_namespace, pl_title
42 HAVING COUNT(*) > $count";
44 wfRunHooks( 'WantedPages::getSQL', array( &$this, &$sql ) );
52 function wfSpecialWantedpages( $par = null, $specialPage ) {
53 $inc = $specialPage->including();
56 @list
( $limit, $nlinks ) = explode( '/', $par, 2 );
58 $nlinks = $nlinks === 'nlinks';
61 list( $limit, $offset ) = wfCheckLimits();
65 $wpp = new WantedPagesPage( $inc, $nlinks );
67 $wpp->doQuery( $offset, $limit, !$inc );