From b6623ea058128598ef03ebdbd1d19052f0e508d4 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sun, 2 Apr 2006 16:04:38 +0000 Subject: [PATCH] (bug 5385) Allow hiding anonymous edits on Special:Recentchanges --- RELEASE-NOTES | 1 + includes/SpecialRecentchanges.php | 9 ++++++++- languages/Messages.php | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9d0cd341f3..79408210da 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -393,6 +393,7 @@ Special Pages: * Special:Export can now export a list of all contributors to an article (off by default) * (bug 5372) Add number of files to Special:Statistics * (bug 2871) Links to talk pages in watchlist editing view +* (bug 5385) Allow hiding anonymous edits on Special:Recentchanges Misc.: * PHP 4.1 compatibility fix: don't use new_link parameter to mysql_connect diff --git a/includes/SpecialRecentchanges.php b/includes/SpecialRecentchanges.php index 5f5c81b972..bfecf086f5 100644 --- a/includes/SpecialRecentchanges.php +++ b/includes/SpecialRecentchanges.php @@ -32,6 +32,7 @@ function wfSpecialRecentchanges( $par, $specialPage ) { /* int */ 'limit' => $wgUser->getDefaultOption('rclimit'), /* bool */ 'hideminor' => false, /* bool */ 'hidebots' => true, + /* bool */ 'hideanons' => false, /* bool */ 'hideliu' => false, /* bool */ 'hidepatrolled' => false, /* bool */ 'hidemyself' => false, @@ -69,6 +70,7 @@ function wfSpecialRecentchanges( $par, $specialPage ) { $namespace = $wgRequest->getIntOrNull( 'namespace' ); $invert = $wgRequest->getBool( 'invert', $defaults['invert'] ); $hidebots = $wgRequest->getBool( 'hidebots', $defaults['hidebots'] ); + $hideanons = $wgRequest->getBool( 'hideanons', $defaults['hideanons'] ); $hideliu = $wgRequest->getBool( 'hideliu', $defaults['hideliu'] ); $hidepatrolled = $wgRequest->getBool( 'hidepatrolled', $defaults['hidepatrolled'] ); $hidemyself = $wgRequest->getBool ( 'hidemyself', $defaults['hidemyself'] ); @@ -84,6 +86,7 @@ function wfSpecialRecentchanges( $par, $specialPage ) { if ( 'minor' == $bit ) $hideminor = 0; if ( 'hideliu' == $bit ) $hideliu = 1; if ( 'hidepatrolled' == $bit ) $hidepatrolled = 1; + if ( 'hideanons' == $bit ) $hideanons = 1; if ( 'hidemyself' == $bit ) $hidemyself = 1; if ( is_numeric( $bit ) ) { @@ -135,6 +138,7 @@ function wfSpecialRecentchanges( $par, $specialPage ) { $hidem .= $hidebots ? ' AND rc_bot=0' : ''; $hidem .= ( $hideliu && !$hidemyself ) ? ' AND rc_user=0' : ''; $hidem .= $hidepatrolled ? ' AND rc_patrolled=0' : ''; + $hidem .= ( $hideanons && !$hideliu ) ? ' AND rc_user <> 0' : ''; if ( $hidemyself ) { if ( $wgUser->getID() ) { $hidem .= ' AND rc_user <> '.$wgUser->getID(); @@ -195,6 +199,7 @@ function wfSpecialRecentchanges( $par, $specialPage ) { wfAppendToArrayIfNotDefault( 'limit', $limit , $defaults, $nondefaults); wfAppendToArrayIfNotDefault( 'hideminor', $hideminor, $defaults, $nondefaults); wfAppendToArrayIfNotDefault( 'hidebots', $hidebots, $defaults, $nondefaults); + wfAppendToArrayIfNotDefault( 'hideanons', $hideanons, $defaults, $nondefaults ); wfAppendToArrayIfNotDefault( 'hideliu', $hideliu, $defaults, $nondefaults); wfAppendToArrayIfNotDefault( 'hidepatrolled', $hidepatrolled, $defaults, $nondefaults); wfAppendToArrayIfNotDefault( 'hidemyself', $hidemyself, $defaults, $nondefaults); @@ -500,13 +505,15 @@ function rcOptionsPanel( $defaults, $nondefaults ) { array( 'hideminor' => 1-$options['hideminor'] ), $nondefaults); $botLink = makeOptionsLink( $showhide[1-$options['hidebots']], array( 'hidebots' => 1-$options['hidebots'] ), $nondefaults); + $anonsLink = makeOptionsLink( $showhide[ 1 - $options['hideanons'] ], + array( 'hideanons' => 1 - $options['hideanons'] ), $nondefaults ); $liuLink = makeOptionsLink( $showhide[1-$options['hideliu']], array( 'hideliu' => 1-$options['hideliu'] ), $nondefaults); $patrLink = makeOptionsLink( $showhide[1-$options['hidepatrolled']], array( 'hidepatrolled' => 1-$options['hidepatrolled'] ), $nondefaults); $myselfLink = makeOptionsLink( $showhide[1-$options['hidemyself']], array( 'hidemyself' => 1-$options['hidemyself'] ), $nondefaults); - $hl = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink, $myselfLink ); + $hl = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink, $myselfLink, $anonsLink ); // show from this onward link $now = $wgLang->timeanddate( wfTimestampNow(), true ); diff --git a/languages/Messages.php b/languages/Messages.php index 3baa82413b..734f52f7b7 100644 --- a/languages/Messages.php +++ b/languages/Messages.php @@ -784,7 +784,7 @@ Unselected groups will not be changed. You can deselect a group with CTRL + Left 'rcnote' => "Below are the last $1 changes in last $2 days.", 'rcnotefrom' => "Below are the changes since $2 (up to $1 shown).", 'rclistfrom' => "Show new changes starting from $1", -'showhideminor' => "$1 minor edits | $2 bots | $3 logged in users | $4 patrolled edits", +'showhideminor' => "$1 minor edits | $2 bots | $3 logged in users | $6 anonymous users | $4 patrolled edits | $5 my edits", 'rclinks' => "Show last $1 changes in last $2 days
$3", 'rchide' => "in $4 form; $1 minor edits; $2 secondary namespaces; $3 multiple edits.", 'rcliu' => "; $1 edits from logged in users", -- 2.20.1