Index: trunk/phase3/includes/SpecialRecentchanges.php |
— | — | @@ -134,18 +134,27 @@ |
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
138 | | - $hidem = $hideminor ? 'AND rc_minor=0' : ''; |
139 | | - $hidem .= $hidebots ? ' AND rc_bot=0' : ''; |
140 | | - $hidem .= ( $hideliu && !$hidemyself ) ? ' AND rc_user=0' : ''; |
141 | | - $hidem .= $hidepatrolled ? ' AND rc_patrolled=0' : ''; |
142 | | - $hidem .= ( $hideanons && !$hideliu ) ? ' AND rc_user <> 0' : ''; |
143 | | - if ( $hidemyself ) { |
144 | | - if ( $wgUser->getID() ) { |
145 | | - $hidem .= ' AND rc_user <> '.$wgUser->getID(); |
| 138 | + # It makes no sense to hide both anons and logged-in users |
| 139 | + # Where this occurs, force anons to be shown |
| 140 | + if( $hideanons && $hideliu ) |
| 141 | + $hideanons = false; |
| 142 | + |
| 143 | + # Form WHERE fragments for all the options |
| 144 | + $hidem = $hideminor ? 'AND rc_minor = 0' : ''; |
| 145 | + $hidem .= $hidebots ? ' AND rc_bot = 0' : ''; |
| 146 | + $hidem .= $hideliu ? ' AND rc_user = 0' : ''; |
| 147 | + $hidem .= $hidepatrolled ? ' AND rc_patrolled = 0' : ''; |
| 148 | + $hidem .= $hideanons ? ' AND rc_user != 0' : ''; |
| 149 | + |
| 150 | + if( $hidemyself ) { |
| 151 | + if( $wgUser->getID() ) { |
| 152 | + $hidem .= ' AND rc_user != ' . $wgUser->getID(); |
146 | 153 | } else { |
147 | | - $hidem .= ' AND rc_user_text<>' . $dbr->addQuotes( $wgUser->getName() ); |
| 154 | + $hidem .= ' AND rc_user_text != ' . $dbr->addQuotes( $wgUser->getName() ); |
148 | 155 | } |
149 | 156 | } |
| 157 | + |
| 158 | + # Namespace filtering |
150 | 159 | $hidem .= is_null( $namespace ) ? '' : ' AND rc_namespace' . ($invert ? '!=' : '=') . $namespace; |
151 | 160 | |
152 | 161 | // This is the big thing! |