Brian Wolff has uploaded a new change for review.
https://gerrit.wikimedia.org/r/76238
Change subject: Add Special:UnwatchedChanges page.
......................................................................
Add Special:UnwatchedChanges page.
Basically Recentchanges for pages that aren't watched.
Performance considerations: I think this would have the same performance
characteristics as Special:Recentchangeslinked would on a large
category. How acceptable that is, I'm not sure.
Bug: 13063
Change-Id: I6d6b45fc1278eaa88dc7698fcad6d90c633d3a58
---
M RELEASE-NOTES-1.22
M includes/AutoLoader.php
M includes/SpecialPageFactory.php
M includes/specials/SpecialRecentchanges.php
A includes/specials/SpecialUnwatchedChanges.php
M languages/messages/MessagesEn.php
M languages/messages/MessagesQqq.php
M maintenance/language/messages.inc
8 files changed, 143 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/38/76238/1
diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index 2658193..bfc121e 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -165,6 +165,8 @@
* (bug 30713) New mw.hook "wikipage.content".
* (bug 40430) jquery.placeholder gets a new parameter to set the attribute
value
to be used.
+* (bug 13063) Special:UnwatchedChanges added to list recent changes to pages
+ with no watchers.
=== Bug fixes in 1.22 ===
* Disable Special:PasswordReset when $wgEnableEmail is false. Previously one
diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php
index bb8c272..453fa78 100644
--- a/includes/AutoLoader.php
+++ b/includes/AutoLoader.php
@@ -983,6 +983,7 @@
'SpecialUnblock' => 'includes/specials/SpecialUnblock.php',
'SpecialUndelete' => 'includes/specials/SpecialUndelete.php',
'SpecialUnlockdb' => 'includes/specials/SpecialUnlockdb.php',
+ 'SpecialUnwatchedChanges' =>
'includes/specials/SpecialUnwatchedChanges.php',
'SpecialUpload' => 'includes/specials/SpecialUpload.php',
'SpecialUploadStash' => 'includes/specials/SpecialUploadStash.php',
'SpecialUploadStashTooLargeException' =>
'includes/specials/SpecialUploadStash.php',
diff --git a/includes/SpecialPageFactory.php b/includes/SpecialPageFactory.php
index 02bd9e8..759b64f 100644
--- a/includes/SpecialPageFactory.php
+++ b/includes/SpecialPageFactory.php
@@ -69,6 +69,7 @@
'Unusedimages' => 'UnusedimagesPage',
'Unusedtemplates' => 'UnusedtemplatesPage',
'Unwatchedpages' => 'UnwatchedpagesPage',
+ 'UnwatchedChanges' => 'SpecialUnwatchedChanges',
'Wantedcategories' => 'WantedcategoriesPage',
'Wantedfiles' => 'WantedfilesPage',
'Wantedpages' => 'WantedpagesPage',
diff --git a/includes/specials/SpecialRecentchanges.php
b/includes/specials/SpecialRecentchanges.php
index d263202..143b41b 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -30,8 +30,8 @@
var $rcOptions, $rcSubpage;
protected $customFilters;
- public function __construct( $name = 'Recentchanges' ) {
- parent::__construct( $name );
+ public function __construct( $name = 'Recentchanges', $restriction = ''
) {
+ parent::__construct( $name, $restriction );
}
/**
diff --git a/includes/specials/SpecialUnwatchedChanges.php
b/includes/specials/SpecialUnwatchedChanges.php
new file mode 100644
index 0000000..c114428
--- /dev/null
+++ b/includes/specials/SpecialUnwatchedChanges.php
@@ -0,0 +1,121 @@
+<?php
+/**
+ * Implements Special:UnwatchedChanges
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup SpecialPage
+ */
+
+/**
+ * This is to display changes made to all articles linked in an article.
+ *
+ * @ingroup SpecialPage
+ */
+class SpecialUnwatchedChanges extends SpecialRecentChanges {
+
+ function __construct( $name = 'UnwatchedChanges', $restriction =
'unwatchedpages' ) {
+ parent::__construct( $name, $restriction );
+ }
+
+ function execute( $subpage ) {
+ $this->checkPermissions();
+ parent::execute( $subpage );
+ }
+
+ /**
+ * Special:RecentChanges is includable, however we do not
+ * want to be, since only certain users allowed to view this page.
+ */
+ function isIncludable() {
+ return false;
+ }
+
+ public function getFeedObject( $feedFormat ) {
+ # This would really only work for in-browser RSS readers, since
+ # you would need to be logged in. If users complain, we could
+ # set up something similar to watchlist rss with the token,
+ # but for now, lets wait to see if the limitation actually
+ # bothers anybody.
+ $feed = new ChangesFeed( $feedFormat, false );
+ $feedObj = $feed->getFeedObject(
+ $this->msg( 'unwatchedchanges' )
+ ->inContentLanguage()->text(),
+ $this->msg( 'unwatchedchanges-feed'
)->inContentLanguage()->text(),
+ $this->getTitle()->getFullURL()
+ );
+ return array( $feed, $feedObj );
+ }
+
+ public function doMainQuery( $conds, $opts ) {
+ // XXX: Should this be in the 'watchlist' query group? Its own
group? No group?
+ $dbr = wfGetDB( DB_SLAVE, 'watchlist' );
+
+ $tables = array( 'recentchanges', 'watchlist' );
+ $select = RecentChange::selectFields();
+ $queryOptions = array(
+ 'LIMIT' => $opts['limit'],
+ 'ORDER BY' => 'rc_timestamp DESC'
+ );
+
+ $joinConds = array(
+ 'watchlist' => array(
+ 'LEFT JOIN', array(
+ 'wl_title=rc_title',
+ 'wl_namespace=rc_namespace'
+ )
+ )
+ );
+
+ // We only want unwatched pages.
+ $conds['wl_title'] = null;
+
+ if ( $this->getUser()->isAllowed( 'rollback' ) ) {
+ $tables[] = 'page';
+ $joinConds['page'] = array( 'LEFT JOIN',
'rc_cur_id=page_id' );
+ $select[] = 'page_latest';
+ }
+ ChangeTags::modifyDisplayQuery(
+ $tables,
+ $select,
+ $conds,
+ $joinConds,
+ $queryOptions,
+ $opts['tagfilter']
+ );
+
+ if ( !wfRunHooks( 'SpecialRecentChangesQuery', array( &$conds,
&$tables, &$joinConds, $opts, &$queryOptions, &$select ) ) ) {
+ return false;
+ }
+
+ $res = $dbr->select(
+ $tables,
+ $select,
+ $conds,
+ __METHOD__,
+ $queryOptions,
+ $joinConds
+ );
+
+ if ( $res->numRows() == 0 ) {
+ $this->mResultEmpty = true;
+ }
+
+ return $res;
+ }
+
+}
diff --git a/languages/messages/MessagesEn.php
b/languages/messages/MessagesEn.php
index b525465..a9314a2 100644
--- a/languages/messages/MessagesEn.php
+++ b/languages/messages/MessagesEn.php
@@ -468,6 +468,7 @@
'Unusedimages' => array( 'UnusedFiles', 'UnusedImages' ),
'Unusedtemplates' => array( 'UnusedTemplates' ),
'Unwatchedpages' => array( 'UnwatchedPages' ),
+ 'UnwatchedChanges' => array( 'UnwatchedChanges' ),
'Upload' => array( 'Upload' ),
'UploadStash' => array( 'UploadStash' ),
'Userlogin' => array( 'UserLogin', 'Login' ),
@@ -5106,4 +5107,8 @@
# Image rotation
'rotate-comment' => 'Image rotated by $1 {{PLURAL:$1|degree|degrees}}
clockwise',
+# Special:UnwatchedChanges
+'unwatchedchanges' => 'Unwatched changes',
+'unwatchedchanges-feed' => 'Recent changes to pages that are not watched.',
+'unwatchedchanges-summary' => "This is a list of changes made recently to
pages that have nobody watching them.",
);
diff --git a/languages/messages/MessagesQqq.php
b/languages/messages/MessagesQqq.php
index 58c6086..0431f25 100644
--- a/languages/messages/MessagesQqq.php
+++ b/languages/messages/MessagesQqq.php
@@ -9187,4 +9187,9 @@
# Image rotation
'rotate-comment' => 'Edit summary for the act of rotating an image.',
+# Special:UnwatchedChanges
+'unwatchedchanges' => '{{doc-special|UnwatchedChanges}}
+Title of Unwatched changes page',
+'unwatchedchanges-feed' => 'Description of RSS feed for
Special:UnwatchedChanges',
+'unwatchedchanges-summary' => "Summary text for [[Special:UnwatchedChangs]]",
);
diff --git a/maintenance/language/messages.inc
b/maintenance/language/messages.inc
index be96d6e..e5f598c 100644
--- a/maintenance/language/messages.inc
+++ b/maintenance/language/messages.inc
@@ -3946,6 +3946,11 @@
'rotation' => array(
'rotate-comment',
),
+ 'unwatchedchanges' => array(
+ 'unwatchedchanges',
+ 'unwatchedchanges-feed',
+ 'unwatchedchanges-summary',
+ ),
);
/** Comments for each block */
@@ -4189,4 +4194,5 @@
'duration' => 'Durations',
'cachedspecial' => 'SpecialCachedPage',
'rotation' => 'Image rotation',
+ 'unwatchedchanges' => 'Special:UnwatchedChanges',
);
--
To view, visit https://gerrit.wikimedia.org/r/76238
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d6b45fc1278eaa88dc7698fcad6d90c633d3a58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits