http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97991

Revision: 97991
Author:   catrope
Date:     2011-09-24 11:46:17 +0000 (Sat, 24 Sep 2011)
Log Message:
-----------
SpecialMoodBarFeedback: Make permalinks work

Modified Paths:
--------------
    trunk/extensions/MoodBar/SpecialMoodBarFeedback.php

Modified: trunk/extensions/MoodBar/SpecialMoodBarFeedback.php
===================================================================
--- trunk/extensions/MoodBar/SpecialMoodBarFeedback.php 2011-09-24 10:51:20 UTC 
(rev 97990)
+++ trunk/extensions/MoodBar/SpecialMoodBarFeedback.php 2011-09-24 11:46:17 UTC 
(rev 97991)
@@ -12,16 +12,21 @@
        public function execute( $par ) {
                global $wgOut, $wgRequest;
                
-               // Determine filters from the query string
-               $filters = array();
-               $type = $wgRequest->getArray( 'type' );
-               if ( $type ) {
-                       $filters['type'] = $type;
+               $id = intval( $par );
+               if ( $id > 0 ) {
+                       $filters = array( 'id' => $id );
+               } else {
+                       // Determine filters from the query string
+                       $filters = array();
+                       $type = $wgRequest->getArray( 'type' );
+                       if ( $type ) {
+                               $filters['type'] = $type;
+                       }
+                       $username = strval( $wgRequest->getVal( 'username' ) );
+                       if ( $username !== '' ) {
+                               $filters['username'] = $username;
+                       }
                }
-               $username = strval( $wgRequest->getVal( 'username' ) );
-               if ( $username !== '' ) {
-                       $filters['username'] = $username;
-               }
                // Do the query
                $res = $this->doQuery( $filters );
 
@@ -144,6 +149,9 @@
                                $conds[] = 'mbf_user_ip IS NULL';
                        }
                }
+               if ( isset( $filters['id'] ) ) {
+                       $conds['mbf_id'] = $filters['id'];
+               }
                
                $dbr = wfGetDB( DB_SLAVE );
                return $dbr->select( array( 'moodbar_feedback', 'user' ), array(


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to