more specific error message, using WikiError, if user trys to create account with...
[mediawiki.git] / includes / specials / SpecialLonelypages.php
blob90da25fdc35264ebdb38eb14296590061da46a64
1 <?php
2 /**
3 * @file
4 * @ingroup SpecialPage
5 */
7 /**
8 * A special page looking for articles with no article linking to them,
9 * thus being lonely.
10 * @ingroup SpecialPage
12 class LonelyPagesPage extends PageQueryPage {
14 function getName() {
15 return "Lonelypages";
17 function getPageHeader() {
18 return wfMsgExt( 'lonelypagestext', array( 'parse' ) );
21 function sortDescending() {
22 return false;
25 function isExpensive() {
26 return true;
28 function isSyndicated() { return false; }
30 function getSQL() {
31 $dbr = wfGetDB( DB_SLAVE );
32 list( $page, $pagelinks, $templatelinks ) = $dbr->tableNamesN( 'page', 'pagelinks', 'templatelinks' );
34 return
35 "SELECT 'Lonelypages' AS type,
36 page_namespace AS namespace,
37 page_title AS title,
38 page_title AS value
39 FROM $page
40 LEFT JOIN $pagelinks
41 ON page_namespace=pl_namespace AND page_title=pl_title
42 LEFT JOIN $templatelinks
43 ON page_namespace=tl_namespace AND page_title=tl_title
44 WHERE pl_namespace IS NULL
45 AND page_namespace=".NS_MAIN."
46 AND page_is_redirect=0
47 AND tl_namespace IS NULL";
52 /**
53 * Constructor
55 function wfSpecialLonelypages() {
56 list( $limit, $offset ) = wfCheckLimits();
58 $lpp = new LonelyPagesPage();
60 return $lpp->doQuery( $offset, $limit );