MediaWiki  1.23.2
SpecialWantedpages.php
Go to the documentation of this file.
1 <?php
30 
31  function __construct( $name = 'Wantedpages' ) {
32  parent::__construct( $name );
33  }
34 
35  function isIncludable() {
36  return true;
37  }
38 
39  function execute( $par ) {
40  $inc = $this->including();
41 
42  if ( $inc ) {
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';
47  $this->offset = 0;
48  } else {
49  //$nlinks = true;
50  }
51  $this->setListoutput( $inc );
52  $this->shownavigation = !$inc;
53  parent::execute( $par );
54  }
55 
56  function getQueryInfo() {
57  global $wgWantedPagesThreshold;
58  $count = $wgWantedPagesThreshold - 1;
59  $query = array(
60  'tables' => array(
61  'pagelinks',
62  'pg1' => 'page',
63  'pg2' => 'page'
64  ),
65  'fields' => array(
66  'namespace' => 'pl_namespace',
67  'title' => 'pl_title',
68  'value' => 'COUNT(*)'
69  ),
70  'conds' => array(
71  'pg1.page_namespace IS NULL',
72  "pl_namespace NOT IN ( '" . NS_USER . "', '" . NS_USER_TALK . "' )",
73  "pg2.page_namespace != '" . NS_MEDIAWIKI . "'"
74  ),
75  'options' => array(
76  'HAVING' => "COUNT(*) > $count",
77  'GROUP BY' => array( 'pl_namespace', 'pl_title' )
78  ),
79  'join_conds' => array(
80  'pg1' => array(
81  'LEFT JOIN', array(
82  'pg1.page_namespace = pl_namespace',
83  'pg1.page_title = pl_title'
84  )
85  ),
86  'pg2' => array( 'LEFT JOIN', 'pg2.page_id = pl_from' )
87  )
88  );
89  // Replacement for the WantedPages::getSQL hook
90  wfRunHooks( 'WantedPages::getQueryInfo', array( &$this, &$query ) );
91 
92  return $query;
93  }
94 
95  protected function getGroupName() {
96  return 'maintenance';
97  }
98 }
QueryPage\setListoutput
setListoutput( $bool)
A mutator for $this->listoutput;.
Definition: QueryPage.php:122
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
WantedPagesPage\getQueryInfo
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
Definition: SpecialWantedpages.php:56
WantedPagesPage\execute
execute( $par)
This is the actual workhorse.
Definition: SpecialWantedpages.php:39
WantedPagesPage\__construct
__construct( $name='Wantedpages')
Definition: SpecialWantedpages.php:31
WantedPagesPage\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialWantedpages.php:95
wfRunHooks
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
Definition: GlobalFunctions.php:4001
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
execute
$batch execute()
NS_USER_TALK
const NS_USER_TALK
Definition: Defines.php:82
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
WantedPagesPage\isIncludable
isIncludable()
Whether it's allowed to transclude the special page via {{Special:Foo/params}}.
Definition: SpecialWantedpages.php:35
$count
$count
Definition: UtfNormalTest2.php:96
WantedPagesPage
A special page that lists most linked pages that does not exist.
Definition: SpecialWantedpages.php:29
NS_USER
const NS_USER
Definition: Defines.php:81
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:87
$query
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
Definition: hooks.txt:1105
SpecialPage\including
including( $x=null)
Whether the special page is being evaluated via transclusion.
Definition: SpecialPage.php:207
WantedQueryPage
Class definition for a wanted query page like WantedPages, WantedTemplates, etc.
Definition: QueryPage.php:766