Last modified: 2010-05-15 15:38:08 UTC
There are often times when I would like to remove my own edits from the Recent Changes list, particularly on a wiki installation with not many active users. I've made a small patch to SpecialRecentchanges for this, attached below. This also, of course, requires extending MediaWiki:Showhideminor. I added '| $5 my edits' to the end of the default version. --- SpecialRecentchanges.php 2006-01-07 16:09:10.000000000 +0000 +++ /tmp/QEG 2006-01-07 16:08:59.000000000 +0000 @@ -31,6 +31,7 @@ /* int */ 'limit' => $wgUser->getDefaultOption('rclimit'), /* bool */ 'hideminor' => false, /* bool */ 'hidebots' => true, + /* bool */ 'hideme' => false, /* bool */ 'hideliu' => false, /* bool */ 'hidepatrolled' => false, /* text */ 'from' => '', @@ -67,6 +68,7 @@ $namespace = $wgRequest->getIntOrNull( 'namespace' ); $invert = $wgRequest->getBool( 'invert', $defaults['invert'] ); $hidebots = $wgRequest->getBool( 'hidebots', $defaults['hidebots'] ); + $hideme = $wgRequest->getBool( 'hideme', $defaults['hideme'] ); $hideliu = $wgRequest->getBool( 'hideliu', $defaults['hideliu'] ); $hidepatrolled = $wgRequest->getBool( 'hidepatrolled', $defaults['hidepatrolled'] ); $from = $wgRequest->getVal( 'from', $defaults['from'] ); @@ -80,6 +82,7 @@ if ( 'hideminor' == $bit ) $hideminor = 1; if ( 'minor' == $bit ) $hideminor = 0; if ( 'hideliu' == $bit ) $hideliu = 1; + if ( 'hideme' == $bit ) $hideme = 1; if ( 'hidepatrolled' == $bit ) $hidepatrolled = 1; if ( is_numeric( $bit ) ) { @@ -127,7 +130,10 @@ } } + $uid = $wgUser->getID(); + $hidem = $hideminor ? 'AND rc_minor=0' : ''; + $hidem .= $hideme ? " AND rc_user != $uid" : ''; $hidem .= $hidebots ? ' AND rc_bot=0' : ''; $hidem .= $hideliu ? ' AND rc_user=0' : ''; $hidem .= $hidepatrolled ? ' AND rc_patrolled=0' : ''; @@ -135,7 +141,6 @@ // This is the big thing! - $uid = $wgUser->getID(); $notifts = ($wgShowUpdatedMarker?",wl_notificationtimestamp":""); // Perform query @@ -183,6 +188,7 @@ wfAppendToArrayIfNotDefault( 'hidebots', $hidebots, $defaults, $nondefaults); wfAppendToArrayIfNotDefault( 'hideliu', $hideliu, $defaults, $nondefaults); wfAppendToArrayIfNotDefault( 'hidepatrolled', $hidepatrolled, $defaults, $nondefaults); + wfAppendToArrayIfNotDefault( 'hideme', $hideme, $defaults, $nondefaults); wfAppendToArrayIfNotDefault( 'from', $from, $defaults, $nondefaults); wfAppendToArrayIfNotDefault( 'namespace', $namespace, $defaults, $nondefaults); wfAppendToArrayIfNotDefault( 'invert', $invert, $defaults, $nondefaults); @@ -430,8 +436,10 @@ array( 'hideliu' => 1-$options['hideliu'] ), $nondefaults); $patrLink = makeOptionsLink( $showhide[1-$options['hidepatrolled']], array( 'hidepatrolled' => 1-$options['hidepatrolled'] ), $nondefaults); + $meLink = makeOptionsLink( $showhide[1-$options['hideme']], + array( 'hideme' => 1-$options['hideme'] ), $nondefaults); - $hl = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink ); + $hl = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink, $meLink ); // show from this onward link $now = $wgLang->timeanddate( wfTimestampNow(), true );
Created attachment 1273 [details] Proper version of patch Sorry for inline patch - I didn't see how to attach it originally.
*** This bug has been marked as a duplicate of 1417 ***