Index: trunk/extensions/SocialProfile/UserStatus/UserStatus_AjaxFunctions.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | foreach ( $historyArray as $row ) { |
48 | 48 | $us = htmlspecialchars( $row['ush_status'] ); |
49 | 49 | $status_id = intval( $row['ush_id'] ); |
50 | | - $status_likes = $us_class->likeCount( $status_id ); |
| 50 | + $status_likes = $us_class->getLikeCount( $status_id ); |
51 | 51 | $href = ''; |
52 | 52 | // We can only *view* other user's past status updates, we cannot |
53 | 53 | // do anything with them...so don't bother generating the href |
Index: trunk/extensions/SocialProfile/UserStatus/UserStatusClass.php |
— | — | @@ -183,16 +183,15 @@ |
184 | 184 | return; |
185 | 185 | } |
186 | 186 | |
187 | | - public function likeCount( $status_id ) { |
| 187 | + public function getLikeCount( $status_id ) { |
188 | 188 | $dbr = wfGetDB( DB_SLAVE ); |
189 | | - $statusLikes = $dbr->select( |
190 | | - 'user_status_likes', |
191 | | - '*', |
192 | | - array( 'usl_status_id' => $status_id ), |
193 | | - __METHOD__ |
194 | | - ); |
195 | | - |
196 | | - return $dbr->numRows( $statusLikes ); |
| 189 | + $count = (int)$dbr->selectField( |
| 190 | + 'user_status_likes', |
| 191 | + 'COUNT(*) AS count', |
| 192 | + array( 'usl_status_id' => $status_id ), |
| 193 | + __METHOD__ |
| 194 | + ); |
| 195 | + return $count; |
197 | 196 | } |
198 | 197 | |
199 | 198 | public function likeStatus( $liker_id, $status_id ) { |
— | — | @@ -219,6 +218,6 @@ |
220 | 219 | __METHOD__ |
221 | 220 | ); |
222 | 221 | } |
223 | | - return (string)$this->likeCount($status_id).' ♥'; |
| 222 | + return (string)$this->getLikeCount($status_id).' ♥'; |
224 | 223 | } |
225 | 224 | } |
\ No newline at end of file |