Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.status.php |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | * @param $values |
33 | 33 | * @return true |
34 | 34 | */ |
35 | | - public static function setCache( $user, $values, $type, $time = null ) { |
| 35 | + private static function setCache( $user, $values, $type, $time = null ) { |
36 | 36 | global $wgOnlineStatusBar_WriteTime, $wgMemc; |
37 | 37 | // get a key |
38 | 38 | $cache_key = self::getCacheKey( $user, $type ); |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | * @param $user string |
49 | 49 | * @param $type string |
50 | 50 | */ |
51 | | - public static function getCache( $user, $type ) { |
| 51 | + private static function getCache( $user, $type ) { |
52 | 52 | global $wgMemc; |
53 | 53 | // get a key |
54 | 54 | $cache_key = self::getCacheKey( $user, $type ); |
— | — | @@ -73,7 +73,7 @@ |
74 | 74 | if ( $result == '' ) { |
75 | 75 | $dbr = wfGetDB( DB_SLAVE ); |
76 | 76 | $result = $dbr->selectField( 'online_status', 'timestamp', array( 'username' => $user->getName(), |
77 | | - "timestamp > " . $dbr->addQuotes( $dbr->timestamp( $t_time ) ) ), |
| 77 | + 'timestamp > ' . $dbr->addQuotes( $dbr->timestamp( $t_time ) ) ), |
78 | 78 | __METHOD__, array( 'LIMIT 1', 'ORDER BY timestamp DESC' ) ); |
79 | 79 | // cache it |
80 | 80 | self::setCache( $user->getName(), $result, "n" ); |
— | — | @@ -165,7 +165,7 @@ |
166 | 166 | } |
167 | 167 | } |
168 | 168 | // if user doesn't want to be tracked leave it as well for privacy reasons |
169 | | - if ( $wgUser->isLoggedIn() && !$wgUser->getOption ( "OnlineStatusBar_active", $wgOnlineStatusBarDefaultEnabled ) ) { |
| 169 | + if ( $wgUser->isLoggedIn() && !$wgUser->getOption ( 'OnlineStatusBar_active', $wgOnlineStatusBarDefaultEnabled ) ) { |
170 | 170 | return false; |
171 | 171 | } |
172 | 172 | $user_status = self::getStatus( $wgUser, true ); |
— | — | @@ -204,7 +204,7 @@ |
205 | 205 | // Check if we actually need to delete something before we write to master |
206 | 206 | $dbr = wfGetDB( DB_SLAVE ); |
207 | 207 | $time = OnlineStatusBar::getTimeoutDate(); |
208 | | - $result = $dbr->selectField( 'online_status', 'timestamp', array( "timestamp < " . $dbr->addQuotes( $dbr->timestamp( $time ) ) ), |
| 208 | + $result = $dbr->selectField( 'online_status', 'timestamp', array( 'timestamp < ' . $dbr->addQuotes( $dbr->timestamp( $time ) ) ), |
209 | 209 | __METHOD__, array( 'LIMIT 1' ) ); |
210 | 210 | if ( $result === false ) { |
211 | 211 | // no need for delete |
— | — | @@ -213,7 +213,7 @@ |
214 | 214 | |
215 | 215 | // calculate time and convert it back to mediawiki format |
216 | 216 | $dbw = wfGetDB( DB_MASTER ); |
217 | | - $dbw->delete( 'online_status', array( "timestamp < " . $dbw->addQuotes( $dbw->timestamp( $time ) ) ), __METHOD__ ); |
| 217 | + $dbw->delete( 'online_status', array( 'timestamp < ' . $dbw->addQuotes( $dbw->timestamp( $time ) ) ), __METHOD__ ); |
218 | 218 | self::setCache( 'null', 'true', 'delete', 3600 ); // remember we deleted it for 1 hour so that we avoid calling this too many times |
219 | 219 | return 0; |
220 | 220 | } |
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php |
— | — | @@ -171,6 +171,6 @@ |
172 | 172 | } |
173 | 173 | |
174 | 174 | // do we track them |
175 | | - return $user->getOption( "OnlineStatusBar_active", $wgOnlineStatusBarDefaultEnabled ); |
| 175 | + return $user->getOption( 'OnlineStatusBar_active', $wgOnlineStatusBarDefaultEnabled ); |
176 | 176 | } |
177 | 177 | } |
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBarHooks.php |
— | — | @@ -160,10 +160,10 @@ |
161 | 161 | case 'nostalgia': |
162 | 162 | case 'chick': |
163 | 163 | case 'cologneblue': |
164 | | - $out->addModules( 'ext.OnlineStatusBar.' . $skin->getSkinName() ); |
| 164 | + $out->addModuleStyles( 'ext.OnlineStatusBar.' . $skin->getSkinName() ); |
165 | 165 | break; |
166 | 166 | default: |
167 | | - $out->addModules( 'ext.OnlineStatusBar' ); |
| 167 | + $out->addModuleStyles( 'ext.OnlineStatusBar' ); |
168 | 168 | } |
169 | 169 | return true; |
170 | 170 | } |