From 8e8c887dce5696d3cb902faf3fb88d9bf8123523 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sat, 31 Mar 2007 22:54:30 +0000 Subject: [PATCH] (bug 9046) Special page to list pages without language links --- RELEASE-NOTES | 1 + includes/AutoLoader.php | 1 + includes/QueryPage.php | 7 ++-- includes/SpecialPage.php | 1 + includes/SpecialWithoutinterwiki.php | 55 ++++++++++++++++++++++++++++ languages/messages/MessagesEn.php | 3 ++ 6 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 includes/SpecialWithoutinterwiki.php diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5a435b89ce..2cb1968638 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -109,6 +109,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 9069) Use galleries in query pages dedicated to images * (bug 9177) Installer now warns of various conditions affecting session.save_path which can lead to broken session storage +* (bug 9046) Special page to list pages without language links == Bugfixes since 1.9 == * (bug 7292) Fix site statistics when moving pages in/out of content namespaces diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 153cc3046d..b4b8ef8093 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -216,6 +216,7 @@ function __autoload($className) { 'WantedCategoriesPage' => 'includes/SpecialWantedcategories.php', 'WantedPagesPage' => 'includes/SpecialWantedpages.php', 'WhatLinksHerePage' => 'includes/SpecialWhatlinkshere.php', + 'WithoutInterwikiPage' => 'includes/SpecialWithoutinterwiki.php', 'SquidUpdate' => 'includes/SquidUpdate.php', 'ReplacementArray' => 'includes/StringUtils.php', 'Replacer' => 'includes/StringUtils.php', diff --git a/includes/QueryPage.php b/includes/QueryPage.php index 781a482720..957182719f 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -19,7 +19,7 @@ $wgQueryPages = array( array( 'DeadendPagesPage', 'Deadendpages' ), array( 'DisambiguationsPage', 'Disambiguations' ), array( 'DoubleRedirectsPage', 'DoubleRedirects' ), - array( 'ListredirectsPage', 'Listredirects' ), + array( 'ListredirectsPage', 'Listredirects' ), array( 'LonelyPagesPage', 'Lonelypages' ), array( 'LongPagesPage', 'Longpages' ), array( 'MostcategoriesPage', 'Mostcategories' ), @@ -31,13 +31,14 @@ $wgQueryPages = array( array( 'ShortPagesPage', 'Shortpages' ), array( 'UncategorizedCategoriesPage', 'Uncategorizedcategories' ), array( 'UncategorizedPagesPage', 'Uncategorizedpages' ), - array( 'UncategorizedImagesPage', 'Uncategorizedimages' ), + array( 'UncategorizedImagesPage', 'Uncategorizedimages' ), array( 'UnusedCategoriesPage', 'Unusedcategories' ), array( 'UnusedimagesPage', 'Unusedimages' ), array( 'WantedCategoriesPage', 'Wantedcategories' ), array( 'WantedPagesPage', 'Wantedpages' ), array( 'UnwatchedPagesPage', 'Unwatchedpages' ), - array( 'UnusedtemplatesPage', 'Unusedtemplates' ), + array( 'UnusedtemplatesPage', 'Unusedtemplates' ), + array( 'WithoutInterwikiPage', 'Withoutinterwiki' ), ); wfRunHooks( 'wgQueryPages', array( &$wgQueryPages ) ); diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 9950715f1d..2816b873e7 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -137,6 +137,7 @@ class SpecialPage 'Revisiondelete' => array( 'SpecialPage', 'Revisiondelete', 'deleterevision' ), 'Unusedtemplates' => array( 'SpecialPage', 'Unusedtemplates' ), 'Randomredirect' => array( 'SpecialPage', 'Randomredirect' ), + 'Withoutinterwiki' => array( 'SpecialPage', 'Withoutinterwiki' ), 'Mypage' => array( 'SpecialMypage' ), 'Mytalk' => array( 'SpecialMytalk' ), diff --git a/includes/SpecialWithoutinterwiki.php b/includes/SpecialWithoutinterwiki.php new file mode 100644 index 0000000000..1567b290bd --- /dev/null +++ b/includes/SpecialWithoutinterwiki.php @@ -0,0 +1,55 @@ + + */ +class WithoutInterwikiPage extends PageQueryPage { + + function getName() { + return 'Withoutinterwiki'; + } + + function getPageHeader() { + return '

' . wfMsgHtml( 'withoutinterwiki-header' ) . '

'; + } + + function sortDescending() { + return false; + } + + function isExpensive() { + return true; + } + + function isSyndicated() { + return false; + } + + function getSQL() { + $dbr = wfGetDB( DB_SLAVE ); + list( $page, $langlinks ) = $dbr->tableNamesN( 'page', 'langlinks' ); + return + "SELECT 'Withoutinterwiki' AS type, + page_namespace AS namespace, + page_title AS title, + page_title AS value + FROM $page + LEFT JOIN $langlinks + ON ll_from = page_id + WHERE ll_title IS NULL + AND page_namespace=" . NS_MAIN . " + AND page_is_redirect = 0"; + } + +} + +function wfSpecialWithoutinterwiki() { + list( $limit, $offset ) = wfCheckLimits(); + $wip = new WithoutInterwikiPage(); + $wip->doQuery( $offset, $limit ); +} + +?> \ No newline at end of file diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index d3f51fee85..8fd3cd4660 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1509,6 +1509,9 @@ The [http://meta.wikimedia.org/wiki/Help:Job_queue job queue] length is '''$7''' 'brokenredirects-edit' => '(edit)', 'brokenredirects-delete' => '(delete)', +'withoutinterwiki' => 'Pages without language links', +'withoutinterwiki-header' => 'The following pages do not link to other language versions:', + # Miscellaneous special pages # 'nbytes' => '$1 {{PLURAL:$1|byte|bytes}}', -- 2.20.1