From cf22be7996c5ce1643cefebcbe2049c525500f75 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 2 Apr 2008 10:47:50 +0000 Subject: [PATCH] (bug 13441) Allow Special:Recentchanges to show bots only --- RELEASE-NOTES | 1 + includes/SpecialRecentchanges.php | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c67c32497b..a6046e8cc0 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -149,6 +149,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 13554) PHP Notice in old pre-processor when list item is empty. * (bug 13556) Don't show a blank form if no image is attached in Special:Upload * (bug 13576) maintenance/rebuildrecentchanges.php fails +* (bug 13441) Allow Special:Recentchanges to show bots only === API changes in 1.13 === diff --git a/includes/SpecialRecentchanges.php b/includes/SpecialRecentchanges.php index 382833d181..22c92c52e1 100644 --- a/includes/SpecialRecentchanges.php +++ b/includes/SpecialRecentchanges.php @@ -132,16 +132,25 @@ function wfSpecialRecentchanges( $par, $specialPage ) { # It makes no sense to hide both anons and logged-in users # Where this occurs, force anons to be shown - if( $hideanons && $hideliu ) - $hideanons = false; + $forcebot = false; + if( $hideanons && $hideliu ){ + # Check if the user wants to show bots only + if( $hidebots ){ + $hideanons = 0; + } else { + $forcebot = true; + $hidebots = 0; + } + } # Form WHERE fragments for all the options $hidem = $hideminor ? 'AND rc_minor = 0' : ''; $hidem .= $hidebots ? ' AND rc_bot = 0' : ''; - $hidem .= $hideliu ? ' AND rc_user = 0' : ''; + $hidem .= $hideliu && !$forcebot ? ' AND rc_user = 0' : ''; $hidem .= ( ChangesList::usePatrol() && $hidepatrolled ) ? ' AND rc_patrolled = 0' : ''; - $hidem .= $hideanons ? ' AND rc_user != 0' : ''; - + $hidem .= $hideanons && !$forcebot ? ' AND rc_user != 0' : ''; + $hidem .= $forcebot ? ' AND rc_bot = 1' : ''; + if( $hidemyself ) { if( $wgUser->getID() ) { $hidem .= ' AND rc_user != ' . $wgUser->getID(); -- 2.20.1