Index: trunk/phase3/includes/SpecialRecentchanges.php |
— | — | @@ -31,6 +31,7 @@ |
32 | 32 | /* bool */ 'hidebots' => true, |
33 | 33 | /* bool */ 'hideliu' => false, |
34 | 34 | /* bool */ 'hidepatrolled' => false, |
| 35 | + /* bool */ 'hidemyself' => false, |
35 | 36 | /* text */ 'from' => '', |
36 | 37 | /* text */ 'namespace' => null, |
37 | 38 | /* bool */ 'invert' => false, |
— | — | @@ -51,9 +52,8 @@ |
52 | 53 | $limit = $wgRequest->getInt( 'limit', $limit ); |
53 | 54 | |
54 | 55 | /* order of selection: url > preferences > default */ |
55 | | - $hideminor = $wgRequest->getBool( 'hideminor', $wgUser->getOption( 'hideminor') ? true : $defaults['hideminor'] ); |
56 | | - |
57 | | - |
| 56 | + $hideminor = $wgRequest->getBool( 'hideminor', $wgUser->getOption( 'hideminor') ? true : $defaults['hideminor'] ); |
| 57 | + |
58 | 58 | # As a feed, use limited settings only |
59 | 59 | if( $feedFormat ) { |
60 | 60 | global $wgFeedLimit; |
— | — | @@ -68,7 +68,8 @@ |
69 | 69 | $hidebots = $wgRequest->getBool( 'hidebots', $defaults['hidebots'] ); |
70 | 70 | $hideliu = $wgRequest->getBool( 'hideliu', $defaults['hideliu'] ); |
71 | 71 | $hidepatrolled = $wgRequest->getBool( 'hidepatrolled', $defaults['hidepatrolled'] ); |
72 | | - $from = $wgRequest->getVal( 'from', $defaults['from'] ); |
| 72 | + $hidemyself = $wgRequest->getBool ( 'hidemyself', $defaults['hidemyself'] ); |
| 73 | + $from = $wgRequest->getVal( 'from', $defaults['from'] ); |
73 | 74 | |
74 | 75 | # Get query parameters from path |
75 | 76 | if( $par ) { |
— | — | @@ -80,6 +81,7 @@ |
81 | 82 | if ( 'minor' == $bit ) $hideminor = 0; |
82 | 83 | if ( 'hideliu' == $bit ) $hideliu = 1; |
83 | 84 | if ( 'hidepatrolled' == $bit ) $hidepatrolled = 1; |
| 85 | + if ( 'hidemyself' == $bit ) $hidemyself = 1; |
84 | 86 | |
85 | 87 | if ( is_numeric( $bit ) ) { |
86 | 88 | $limit = $bit; |
— | — | @@ -128,8 +130,15 @@ |
129 | 131 | |
130 | 132 | $hidem = $hideminor ? 'AND rc_minor=0' : ''; |
131 | 133 | $hidem .= $hidebots ? ' AND rc_bot=0' : ''; |
132 | | - $hidem .= $hideliu ? ' AND rc_user=0' : ''; |
| 134 | + $hidem .= ( $hideliu && !$hidemyself ) ? ' AND rc_user=0' : ''; |
133 | 135 | $hidem .= $hidepatrolled ? ' AND rc_patrolled=0' : ''; |
| 136 | + if ( $hidemyself ) { |
| 137 | + if ( $wgUser->getID() ) { |
| 138 | + $hidem .= ' AND rc_user <> '.$wgUser->getID(); |
| 139 | + } else { |
| 140 | + $hidem .= ' AND rc_user_text<>' . $dbr->addQuotes( $wgUser->getName() ); |
| 141 | + } |
| 142 | + } |
134 | 143 | $hidem .= is_null( $namespace ) ? '' : ' AND rc_namespace' . ($invert ? '!=' : '=') . $namespace; |
135 | 144 | |
136 | 145 | // This is the big thing! |
— | — | @@ -185,6 +194,7 @@ |
186 | 195 | wfAppendToArrayIfNotDefault( 'hidebots', $hidebots, $defaults, $nondefaults); |
187 | 196 | wfAppendToArrayIfNotDefault( 'hideliu', $hideliu, $defaults, $nondefaults); |
188 | 197 | wfAppendToArrayIfNotDefault( 'hidepatrolled', $hidepatrolled, $defaults, $nondefaults); |
| 198 | + wfAppendToArrayIfNotDefault( 'hidemyself', $hidemyself, $defaults, $nondefaults); |
189 | 199 | wfAppendToArrayIfNotDefault( 'from', $from, $defaults, $nondefaults); |
190 | 200 | wfAppendToArrayIfNotDefault( 'namespace', $namespace, $defaults, $nondefaults); |
191 | 201 | wfAppendToArrayIfNotDefault( 'invert', $invert, $defaults, $nondefaults); |
— | — | @@ -420,7 +430,7 @@ |
421 | 431 | * Used by Recentchangeslinked |
422 | 432 | */ |
423 | 433 | function rcDayLimitLinks( $days, $limit, $page='Recentchanges', $more='', $doall = false, $minorLink = '', |
424 | | - $botLink = '', $liuLink = '', $patrLink = '' ) { |
| 434 | + $botLink = '', $liuLink = '', $patrLink = '', $myselfLink = '' ) { |
425 | 435 | if ($more != '') $more .= '&'; |
426 | 436 | $cl = rcCountLink( 50, $days, $page, $more ) . ' | ' . |
427 | 437 | rcCountLink( 100, $days, $page, $more ) . ' | ' . |
— | — | @@ -433,7 +443,7 @@ |
434 | 444 | rcDaysLink( $limit, 14, $page, $more ) . ' | ' . |
435 | 445 | rcDaysLink( $limit, 30, $page, $more ) . |
436 | 446 | ( $doall ? ( ' | ' . rcDaysLink( $limit, 0, $page, $more ) ) : '' ); |
437 | | - $shm = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink ); |
| 447 | + $shm = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink, $myselfLink ); |
438 | 448 | $note = wfMsg( 'rclinks', $cl, $dl, $shm ); |
439 | 449 | return $note; |
440 | 450 | } |
— | — | @@ -492,9 +502,10 @@ |
493 | 503 | array( 'hideliu' => 1-$options['hideliu'] ), $nondefaults); |
494 | 504 | $patrLink = makeOptionsLink( $showhide[1-$options['hidepatrolled']], |
495 | 505 | array( 'hidepatrolled' => 1-$options['hidepatrolled'] ), $nondefaults); |
496 | | - |
497 | | - $hl = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink ); |
498 | | - |
| 506 | + $myselfLink = makeOptionsLink( $showhide[1-$options['hidemyself']], |
| 507 | + array( 'hidemyself' => 1-$options['hidemyself'] ), $nondefaults); |
| 508 | + $hl = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink, $myselfLink ); |
| 509 | + |
499 | 510 | // show from this onward link |
500 | 511 | $now = $wgLang->timeanddate( wfTimestampNow(), true ); |
501 | 512 | $tl = makeOptionsLink( $now, array( 'from' => wfTimestampNow()), $nondefaults ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -345,6 +345,7 @@ |
346 | 346 | * (bug 3187) watchlist text refer to unexistent "Stop watching" action |
347 | 347 | * Add block link and a link to the block log to Special:Contributions |
348 | 348 | * Add contributions link to block log items |
| 349 | +* Added optional "hide own edits" feature to Special:Recentchanges |
349 | 350 | |
350 | 351 | Misc.: |
351 | 352 | * PHP 4.1 compatibility fix: don't use new_link parameter to mysql_connect |