Index: trunk/extensions/MoodBar/SpecialMoodBarFeedback.php |
— | — | @@ -12,16 +12,21 @@ |
13 | 13 | public function execute( $par ) { |
14 | 14 | global $wgOut, $wgRequest; |
15 | 15 | |
16 | | - // Determine filters from the query string |
17 | | - $filters = array(); |
18 | | - $type = $wgRequest->getArray( 'type' ); |
19 | | - if ( $type ) { |
20 | | - $filters['type'] = $type; |
| 16 | + $id = intval( $par ); |
| 17 | + if ( $id > 0 ) { |
| 18 | + $filters = array( 'id' => $id ); |
| 19 | + } else { |
| 20 | + // Determine filters from the query string |
| 21 | + $filters = array(); |
| 22 | + $type = $wgRequest->getArray( 'type' ); |
| 23 | + if ( $type ) { |
| 24 | + $filters['type'] = $type; |
| 25 | + } |
| 26 | + $username = strval( $wgRequest->getVal( 'username' ) ); |
| 27 | + if ( $username !== '' ) { |
| 28 | + $filters['username'] = $username; |
| 29 | + } |
21 | 30 | } |
22 | | - $username = strval( $wgRequest->getVal( 'username' ) ); |
23 | | - if ( $username !== '' ) { |
24 | | - $filters['username'] = $username; |
25 | | - } |
26 | 31 | // Do the query |
27 | 32 | $res = $this->doQuery( $filters ); |
28 | 33 | |
— | — | @@ -144,6 +149,9 @@ |
145 | 150 | $conds[] = 'mbf_user_ip IS NULL'; |
146 | 151 | } |
147 | 152 | } |
| 153 | + if ( isset( $filters['id'] ) ) { |
| 154 | + $conds['mbf_id'] = $filters['id']; |
| 155 | + } |
148 | 156 | |
149 | 157 | $dbr = wfGetDB( DB_SLAVE ); |
150 | 158 | return $dbr->select( array( 'moodbar_feedback', 'user' ), array( |