Index: trunk/extensions/SocialProfile/UserSystemMessages/UserSystemMessagesClass.php |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | * @param $type Integer: 0 by default |
18 | 18 | * @param $message Mixed: message to be sent out |
19 | 19 | */ |
20 | | - public function addMessage( $userName, $type, $message ) { |
| 20 | + public function addMessage( $userName, $type = 0, $message ) { |
21 | 21 | $userId = User::idFromName( $userName ); |
22 | 22 | $dbw = wfGetDB( DB_MASTER ); |
23 | 23 | |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | * @return $requests |
58 | 58 | */ |
59 | 59 | public function getMessageList( $type, $limit = 0, $page = 0 ) { |
60 | | - $dbw = wfGetDB( DB_MASTER ); |
| 60 | + $dbr = wfGetDB( DB_SLAVE ); |
61 | 61 | |
62 | 62 | if ( $limit > 0 ) { |
63 | 63 | $limitvalue = 0; |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | } |
70 | 70 | |
71 | 71 | $params['ORDER BY'] = 'ug_id DESC'; |
72 | | - $res = $dbw->select( |
| 72 | + $res = $dbr->select( |
73 | 73 | array( 'user_gift', 'gift' ), |
74 | 74 | array( |
75 | 75 | 'ug_id', 'ug_user_id_from', 'ug_user_name_from', 'ug_gift_id', |