3 * Implements Special:Wantedpages
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
21 * @ingroup SpecialPage
25 * A special page that lists most linked pages that does not exist
27 * @ingroup SpecialPage
29 class WantedPagesPage
extends WantedQueryPage
{
31 function __construct( $name = 'Wantedpages' ) {
32 parent
::__construct( $name );
35 function isIncludable() {
39 function execute( $par ) {
40 $inc = $this->including();
43 $parts = explode( '/', $par, 2 );
44 $this->limit
= (int)$parts[0];
45 // @todo FIXME: nlinks is ignored
46 //$nlinks = isset( $parts[1] ) && $parts[1] === 'nlinks';
51 $this->setListoutput( $inc );
52 $this->shownavigation
= !$inc;
53 parent
::execute( $par );
56 function getQueryInfo() {
57 global $wgWantedPagesThreshold;
58 $count = $wgWantedPagesThreshold - 1;
66 'namespace' => 'pl_namespace',
67 'title' => 'pl_title',
71 'pg1.page_namespace IS NULL',
72 "pl_namespace NOT IN ( '" . NS_USER
.
73 "', '" . NS_USER_TALK
. "' )",
74 "pg2.page_namespace != '" . NS_MEDIAWIKI
. "'"
77 'HAVING' => "COUNT(*) > $count",
78 'GROUP BY' => array( 'pl_namespace', 'pl_title' )
80 'join_conds' => array(
83 'pg1.page_namespace = pl_namespace',
84 'pg1.page_title = pl_title'
87 'pg2' => array( 'LEFT JOIN', 'pg2.page_id = pl_from' )
90 // Replacement for the WantedPages::getSQL hook
91 wfRunHooks( 'WantedPages::getQueryInfo', array( &$this, &$query ) );
95 protected function getGroupName() {