r101519 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101518‎ | r101519 | r101520 >
Date:19:55, 1 November 2011
Author:petrb
Status:deferred
Tags:
Comment:
Merged branches with latest stable of OnlineStatusBar
Modified paths:
  • /branches/REL1_17/extensions/OnlineStatusBar (modified) (history)
  • /branches/REL1_17/extensions/OnlineStatusBar/OnlineStatusBar.body.php (modified) (history)
  • /branches/REL1_17/extensions/OnlineStatusBar/OnlineStatusBar.i18n.php (modified) (history)
  • /branches/REL1_17/extensions/OnlineStatusBar/OnlineStatusBar.php (modified) (history)
  • /branches/REL1_17/extensions/OnlineStatusBar/OnlineStatusBarHooks.php (modified) (history)
  • /branches/REL1_18/extensions/OnlineStatusBar (modified) (history)
  • /branches/REL1_18/extensions/OnlineStatusBar/OnlineStatusBar.body.php (modified) (history)
  • /branches/REL1_18/extensions/OnlineStatusBar/OnlineStatusBar.i18n.php (modified) (history)
  • /branches/REL1_18/extensions/OnlineStatusBar/OnlineStatusBar.php (modified) (history)
  • /branches/REL1_18/extensions/OnlineStatusBar/OnlineStatusBarHooks.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/extensions/OnlineStatusBar/OnlineStatusBar.body.php
@@ -32,7 +32,7 @@
3333 * @return string
3434 */
3535 public static function GetImageHtml( $mode ) {
36 - global $wgExtensionAssetsPath, $wgOnlineStatusBarIcon, $wgOnlineStatusBarModes;
 36+ global $wgExtensionAssetsPath, $wgOnlineStatusBarIcon;
3737 $icon = "$wgExtensionAssetsPath/OnlineStatusBar/{$wgOnlineStatusBarIcon[$mode]}";
3838 return Html::element( 'img', array( 'src' => $icon ) );
3939 }
@@ -46,23 +46,26 @@
4747 */
4848 public static function getAnonFromTitle( Title $title ) {
4949 global $wgOnlineStatusBarTrackIpUsers;
 50+ // if user is anon and we don't track them stop
5051 if ( $wgOnlineStatusBarTrackIpUsers == false ) {
5152 return false;
5253 }
5354
 55+ // checks ns
5456 if ( $title->getNamespace() != NS_USER && $title->getNamespace() != NS_USER_TALK ) {
5557 return false;
5658 }
5759
 60+ // we need to create temporary user object
5861 $user = User::newFromId( 0 );
5962 $user->setName( $title->getBaseText() );
6063
6164 // Check if something wrong didn't happen
62 - if ( $user === false ) {
 65+ if ( !($user instanceof User) ) {
6366 return false;
6467 }
6568
66 - $status = self::getStatus( $user );
 69+ $status = self::getStatus( $user, true );
6770
6871 return array( $status, $user );
6972 }
@@ -81,14 +84,14 @@
8285
8386 $user = User::newFromName( $title->getBaseText() );
8487 // Invalid user
85 - if ( $user === false ) {
 88+ if ( !($user instanceof User) ) {
8689 return false;
8790 }
8891 if ( !self::isValid( $user ) ) {
8992 return false;
9093 }
9194
92 - $status = self::getStatus( $user );
 95+ $status = self::getStatus( $user, true );
9396
9497 return array( $status, $user );
9598 }
@@ -102,11 +105,14 @@
103106 // remove old entries
104107 if ( $update )
105108 {
106 - self::DeleteOld();
 109+ self::deleteOld();
107110 }
108111
 112+ // instead of delete every time just select the records which are not that old
 113+ $t_time = self::getTimeoutDate();
109114 $dbr = wfGetDB( DB_SLAVE );
110 - $result = $dbr->selectField( 'online_status', 'username', array( 'username' => $user->getName() ),
 115+ $result = $dbr->selectField( 'online_status', 'username', array( 'username' => $user->getName(),
 116+ "timestamp > " . $dbr->addQuotes( $dbr->timestamp( $t_time ) ) ),
111117 __METHOD__, array( 'LIMIT 1', 'ORDER BY timestamp DESC' ) );
112118
113119 if ( $result === false ) {
@@ -128,13 +134,40 @@
129135 }
130136
131137 /**
 138+ * Purge page
 139+ * @return bool
 140+ *
 141+ */
 142+ public static function purge( $user_type ) {
 143+ if ( $user_type instanceof User ) {
 144+ $user = $user_type;
 145+ } else if ( is_string( $user_type ) ){
 146+ $user = User::newFromName( $user_type );
 147+ } else {
 148+ return false;
 149+ }
 150+
 151+ // check if something weird didn't happen
 152+ if ( $user instanceof User ) {
 153+ // purge both pages now
 154+ if ( $user->getOption('OnlineStatusBar_active', false) ) {
 155+ if ( $user->getOption('OnlineStatusBar_autoupdate', false) == true ) {
 156+ WikiPage::factory( $user->getUserPage() )->doPurge();
 157+ WikiPage::factory( $user->getTalkPage() )->doPurge();
 158+ }
 159+ }
 160+ }
 161+ return true;
 162+ }
 163+
 164+ /**
132165 * Insert to the database
133166 * @return bool
134167 */
135 - public static function UpdateDb() {
136 - global $wgUser, $wgOnlineStatusBarDefaultOnline;
 168+ public static function updateDb() {
 169+ global $wgUser;
137170 // Skip users we don't track
138 - if ( self::IsValid ( $wgUser ) != true ) {
 171+ if ( self::isValid ( $wgUser ) != true ) {
139172 return false;
140173 }
141174 // If we track them, let's insert it to the table
@@ -148,12 +181,23 @@
149182 }
150183
151184 /**
 185+ * Update status of user
152186 * @return bool
153187 */
154 - public static function UpdateStatus() {
155 - global $wgUser, $wgOnlineStatusBarDefaultOffline;
156 - if ( OnlineStatusBar::GetStatus( $wgUser, true ) == $wgOnlineStatusBarDefaultOffline ) {
157 - OnlineStatusBar::UpdateDb();
 188+ public static function updateStatus() {
 189+ global $wgUser, $wgOnlineStatusBarDefaultOffline, $wgOnlineStatusBarTrackIpUsers, $wgOnlineStatusBarDefaultEnabled;
 190+ // if anon users are not tracked and user is anon leave it
 191+ if ( !$wgOnlineStatusBarTrackIpUsers ) {
 192+ if ( !$wgUser->isLoggedIn() ) {
 193+ return false;
 194+ }
 195+ }
 196+ // if user doesn't want to be tracked leave it as well for privacy reasons
 197+ if ( $wgUser->isLoggedIn() && !$wgUser->getOption ( "OnlineStatusBar_active", $wgOnlineStatusBarDefaultEnabled ) ) {
 198+ return false;
 199+ }
 200+ if ( OnlineStatusBar::getStatus( $wgUser ) == $wgOnlineStatusBarDefaultOffline ) {
 201+ OnlineStatusBar::updateDb();
158202 return true;
159203 }
160204
@@ -165,17 +209,25 @@
166210 __METHOD__
167211 );
168212
169 - return false;
 213+ return true;
170214 }
171215
172216 /**
 217+ * @return timestamp
 218+ */
 219+ private static function getTimeoutDate() {
 220+ global $wgOnlineStatusBar_LogoutTime;
 221+ return wfTimestamp( TS_UNIX ) - $wgOnlineStatusBar_LogoutTime;
 222+ }
 223+
 224+ /**
 225+ * Delete old records from the table, this function is called frequently too keep it as small as possible
173226 * @return int
174227 */
175 - public static function DeleteOld() {
176 - global $wgOnlineStatusBar_LogoutTime;
 228+ public static function deleteOld() {
177229 $dbw = wfGetDB( DB_MASTER );
178230 // calculate time and convert it back to mediawiki format
179 - $time = wfTimestamp( TS_UNIX ) - $wgOnlineStatusBar_LogoutTime;
 231+ $time = self::getTimeoutDate();
180232 $dbw->delete( 'online_status', array( "timestamp < " . $dbw->addQuotes( $dbw->timestamp( $time ) ) ), __METHOD__ );
181233 return 0;
182234 }
@@ -204,7 +256,7 @@
205257 * @param $userName string
206258 * @return bool
207259 */
208 - static function DeleteStatus( $userName ) {
 260+ static function deleteStatus( $userName ) {
209261 $dbw = wfGetDB( DB_MASTER );
210262 $dbw->delete( 'online_status', array( 'username' => $userName ), __METHOD__ ); // delete user
211263 return true;
Index: branches/REL1_17/extensions/OnlineStatusBar/OnlineStatusBar.i18n.php
@@ -22,6 +22,8 @@
2323 'onlinestatusbar-used' => 'Do you want to let others see if you are online?',
2424 // Message in config asking what status they want to use
2525 'onlinestatusbar-status' => 'What is the default status you wish to use:',
 26+ // Message in config asking if user wants to purge the user page
 27+ 'onlinestatusbar-purge' => 'Purge user page everytime when you login or logout',
2628 // Section for config
2729 'prefs-onlinestatus' => 'Online status',
2830 // Message in config
@@ -46,6 +48,7 @@
4749 * $3 a status, it will appear in title bar of their user space pages',
4850 'onlinestatusbar-used' => 'Message in config asking user if they want to enable it, checkbox',
4951 'onlinestatusbar-status' => 'Message in config asking what status they want to use, option box',
 52+ 'onlinestatusbar-purge' => 'Option to purge user page everytime they login so that magic word is updated',
5053 'prefs-onlinestatus' => 'Section for config, located in preferences - misc',
5154 'onlinestatusbar-hide' => 'Ask user if they want to hide status bar this is useful when they are using custom template but need to check if they are online',
5255 'onlinestatusbar-status-online' => 'Status for users who mark themselves as active',
@@ -83,6 +86,7 @@
8487
8588 /** French (Français)
8689 * @author DavidL
 90+ * @author Gomoko
8791 */
8892 $messages['fr'] = array(
8993 'onlinestatusbar-desc' => "Barre d'état montrant si un utilisateur est en ligne, basé sur les préférences, sur leur page utilisateur",
@@ -91,6 +95,11 @@
9296 'onlinestatusbar-status' => 'Quel est le statut par défaut que vous souhaitez utiliser :',
9397 'prefs-onlinestatus' => 'État en ligne',
9498 'onlinestatusbar-hide' => "Voulez-vous masquer la barre d'état afin d'utiliser le mot magique seulement ? (Pour les utilisateurs avancés)",
 99+ 'onlinestatusbar-status-online' => 'Présent',
 100+ 'onlinestatusbar-status-busy' => 'Occupé',
 101+ 'onlinestatusbar-status-away' => 'Parti',
 102+ 'onlinestatusbar-status-offline' => 'Absent',
 103+ 'onlinestatusbar-status-hidden' => 'Caché',
95104 );
96105
97106 /** Galician (Galego)
@@ -123,6 +132,23 @@
124133 'onlinestatusbar-status-hidden' => 'Schowany',
125134 );
126135
 136+/** Interlingua (Interlingua)
 137+ * @author McDutchie
 138+ */
 139+$messages['ia'] = array(
 140+ 'onlinestatusbar-desc' => 'Barra de stato que monstra si un usator es in linea, dependente de su preferentias, in su pagina de usator',
 141+ 'onlinestatusbar-line' => '$1 es ora $2 $3',
 142+ 'onlinestatusbar-used' => 'Vole tu permitter que alteres vide si tu es in linea?',
 143+ 'onlinestatusbar-status' => 'Qual es le stato predefinite que tu vole usar:',
 144+ 'prefs-onlinestatus' => 'Stato in linea',
 145+ 'onlinestatusbar-hide' => 'Vole tu celar le barra de stato pro usar solmente le parola magic? (Pro usatores avantiate)',
 146+ 'onlinestatusbar-status-online' => 'In linea',
 147+ 'onlinestatusbar-status-busy' => 'Occupate',
 148+ 'onlinestatusbar-status-away' => 'Absente',
 149+ 'onlinestatusbar-status-offline' => 'Foras de linea',
 150+ 'onlinestatusbar-status-hidden' => 'Celate',
 151+);
 152+
127153 /** Luxembourgish (Lëtzebuergesch)
128154 * @author Robby
129155 */
Index: branches/REL1_17/extensions/OnlineStatusBar/OnlineStatusBar.php
@@ -17,7 +17,7 @@
1818 $wgExtensionCredits[version_compare( $wgVersion, '1.17', '>=' ) ? 'userpage tools' : 'other'][] = array(
1919 'path' => __FILE__,
2020 'name' => 'Online status bar',
21 - 'version' => '1.0.0',
 21+ 'version' => '1.0.1',
2222 'author' => array( 'Petr Bena' ),
2323 'descriptionmsg' => 'onlinestatusbar-desc',
2424 'url' => 'http://www.mediawiki.org/wiki/Extension:OnlineStatusBar',
Index: branches/REL1_17/extensions/OnlineStatusBar/OnlineStatusBarHooks.php
@@ -28,16 +28,19 @@
2929 * @return bool
3030 */
3131 public static function logout( &$user, &$inject_html, $old_name ) {
32 - OnlineStatusBar::DeleteStatus( $old_name );
 32+ OnlineStatusBar::purge( $old_name );
 33+ OnlineStatusBar::deleteStatus( $old_name );
3334 return true;
3435 }
3536
3637 /**
37 - * Called everytime when it's needed to update db
 38+ * Called everytime on login
3839 * @return bool
3940 */
4041 public static function updateStatus() {
41 - OnlineStatusBar::UpdateDb();
 42+ global $wgUser;
 43+ OnlineStatusBar::purge( $wgUser );
 44+ OnlineStatusBar::updateStatus();
4245 return true;
4346 }
4447
@@ -51,7 +54,7 @@
5255 public static function renderBar( &$article, &$outputDone, &$pcache ) {
5356 $context = $article->getContext();
5457
55 - OnlineStatusBar::UpdateStatus();
 58+ OnlineStatusBar::updateStatus();
5659 $result = OnlineStatusBar::getUserInfoFromTitle( $article->getTitle() );
5760 if ( $result === false && User::isIP ( $article->getTitle()->getBaseText() ) ) {
5861 $result = OnlineStatusBar::getAnonFromTitle( $article->getTitle() );
@@ -88,6 +91,7 @@
8992 global $wgOnlineStatusBarDefaultOnline, $wgOnlineStatusBarDefaultEnabled, $wgOnlineStatusBarModes;
9093 $preferences['OnlineStatusBar_active'] = array( 'type' => 'toggle', 'label-message' => 'onlinestatusbar-used', 'section' => 'misc/onlinestatus' );
9194 $preferences['OnlineStatusBar_hide'] = array( 'type' => 'toggle', 'label-message' => 'onlinestatusbar-hide', 'section' => 'misc/onlinestatus' );
 95+ $preferences['OnlineStatusBar_autoupdate'] = array( 'type' => 'toggle', 'label-message' => 'onlinestatusbar-purge', 'section' => 'misc/onlinestatus' );
9296 $preferences['OnlineStatusBar_status'] = array( 'type' => 'radio', 'label-message' => 'onlinestatusbar-status', 'section' => 'misc/onlinestatus',
9397 'options' => array(
9498 wfMessage( 'onlinestatusbar-status-online' )->escaped() => 'online',
@@ -106,6 +110,7 @@
107111 public static function setDefaultOptions( &$defaultOptions ) {
108112 global $wgOnlineStatusBarDefaultOnline, $wgOnlineStatusBarDefaultEnabled;
109113 // set defaults
 114+ $defaultOptions['OnlineStatusBar_autoupdate'] = false;
110115 $defaultOptions['OnlineStatusBar_status'] = $wgOnlineStatusBarDefaultOnline;
111116 $defaultOptions['OnlineStatusBar_active'] = $wgOnlineStatusBarDefaultEnabled;
112117 $defaultOptions['OnlineStatusBar_hide'] = false;
Property changes on: branches/REL1_17/extensions/OnlineStatusBar
___________________________________________________________________
Added: svn:mergeinfo
113118 Merged /trunk/extensions/OnlineStatusBar:r83817,90221,90723,91145,101374-101518
Index: branches/REL1_18/extensions/OnlineStatusBar/OnlineStatusBar.body.php
@@ -32,7 +32,7 @@
3333 * @return string
3434 */
3535 public static function GetImageHtml( $mode ) {
36 - global $wgExtensionAssetsPath, $wgOnlineStatusBarIcon, $wgOnlineStatusBarModes;
 36+ global $wgExtensionAssetsPath, $wgOnlineStatusBarIcon;
3737 $icon = "$wgExtensionAssetsPath/OnlineStatusBar/{$wgOnlineStatusBarIcon[$mode]}";
3838 return Html::element( 'img', array( 'src' => $icon ) );
3939 }
@@ -46,23 +46,26 @@
4747 */
4848 public static function getAnonFromTitle( Title $title ) {
4949 global $wgOnlineStatusBarTrackIpUsers;
 50+ // if user is anon and we don't track them stop
5051 if ( $wgOnlineStatusBarTrackIpUsers == false ) {
5152 return false;
5253 }
5354
 55+ // checks ns
5456 if ( $title->getNamespace() != NS_USER && $title->getNamespace() != NS_USER_TALK ) {
5557 return false;
5658 }
5759
 60+ // we need to create temporary user object
5861 $user = User::newFromId( 0 );
5962 $user->setName( $title->getBaseText() );
6063
6164 // Check if something wrong didn't happen
62 - if ( $user === false ) {
 65+ if ( !($user instanceof User) ) {
6366 return false;
6467 }
6568
66 - $status = self::getStatus( $user );
 69+ $status = self::getStatus( $user, true );
6770
6871 return array( $status, $user );
6972 }
@@ -81,14 +84,14 @@
8285
8386 $user = User::newFromName( $title->getBaseText() );
8487 // Invalid user
85 - if ( $user === false ) {
 88+ if ( !($user instanceof User) ) {
8689 return false;
8790 }
8891 if ( !self::isValid( $user ) ) {
8992 return false;
9093 }
9194
92 - $status = self::getStatus( $user );
 95+ $status = self::getStatus( $user, true );
9396
9497 return array( $status, $user );
9598 }
@@ -102,11 +105,14 @@
103106 // remove old entries
104107 if ( $update )
105108 {
106 - self::DeleteOld();
 109+ self::deleteOld();
107110 }
108111
 112+ // instead of delete every time just select the records which are not that old
 113+ $t_time = self::getTimeoutDate();
109114 $dbr = wfGetDB( DB_SLAVE );
110 - $result = $dbr->selectField( 'online_status', 'username', array( 'username' => $user->getName() ),
 115+ $result = $dbr->selectField( 'online_status', 'username', array( 'username' => $user->getName(),
 116+ "timestamp > " . $dbr->addQuotes( $dbr->timestamp( $t_time ) ) ),
111117 __METHOD__, array( 'LIMIT 1', 'ORDER BY timestamp DESC' ) );
112118
113119 if ( $result === false ) {
@@ -128,13 +134,40 @@
129135 }
130136
131137 /**
 138+ * Purge page
 139+ * @return bool
 140+ *
 141+ */
 142+ public static function purge( $user_type ) {
 143+ if ( $user_type instanceof User ) {
 144+ $user = $user_type;
 145+ } else if ( is_string( $user_type ) ){
 146+ $user = User::newFromName( $user_type );
 147+ } else {
 148+ return false;
 149+ }
 150+
 151+ // check if something weird didn't happen
 152+ if ( $user instanceof User ) {
 153+ // purge both pages now
 154+ if ( $user->getOption('OnlineStatusBar_active', false) ) {
 155+ if ( $user->getOption('OnlineStatusBar_autoupdate', false) == true ) {
 156+ WikiPage::factory( $user->getUserPage() )->doPurge();
 157+ WikiPage::factory( $user->getTalkPage() )->doPurge();
 158+ }
 159+ }
 160+ }
 161+ return true;
 162+ }
 163+
 164+ /**
132165 * Insert to the database
133166 * @return bool
134167 */
135 - public static function UpdateDb() {
136 - global $wgUser, $wgOnlineStatusBarDefaultOnline;
 168+ public static function updateDb() {
 169+ global $wgUser;
137170 // Skip users we don't track
138 - if ( self::IsValid ( $wgUser ) != true ) {
 171+ if ( self::isValid ( $wgUser ) != true ) {
139172 return false;
140173 }
141174 // If we track them, let's insert it to the table
@@ -148,12 +181,23 @@
149182 }
150183
151184 /**
 185+ * Update status of user
152186 * @return bool
153187 */
154 - public static function UpdateStatus() {
155 - global $wgUser, $wgOnlineStatusBarDefaultOffline;
156 - if ( OnlineStatusBar::GetStatus( $wgUser, true ) == $wgOnlineStatusBarDefaultOffline ) {
157 - OnlineStatusBar::UpdateDb();
 188+ public static function updateStatus() {
 189+ global $wgUser, $wgOnlineStatusBarDefaultOffline, $wgOnlineStatusBarTrackIpUsers, $wgOnlineStatusBarDefaultEnabled;
 190+ // if anon users are not tracked and user is anon leave it
 191+ if ( !$wgOnlineStatusBarTrackIpUsers ) {
 192+ if ( !$wgUser->isLoggedIn() ) {
 193+ return false;
 194+ }
 195+ }
 196+ // if user doesn't want to be tracked leave it as well for privacy reasons
 197+ if ( $wgUser->isLoggedIn() && !$wgUser->getOption ( "OnlineStatusBar_active", $wgOnlineStatusBarDefaultEnabled ) ) {
 198+ return false;
 199+ }
 200+ if ( OnlineStatusBar::getStatus( $wgUser ) == $wgOnlineStatusBarDefaultOffline ) {
 201+ OnlineStatusBar::updateDb();
158202 return true;
159203 }
160204
@@ -165,17 +209,25 @@
166210 __METHOD__
167211 );
168212
169 - return false;
 213+ return true;
170214 }
171215
172216 /**
 217+ * @return timestamp
 218+ */
 219+ private static function getTimeoutDate() {
 220+ global $wgOnlineStatusBar_LogoutTime;
 221+ return wfTimestamp( TS_UNIX ) - $wgOnlineStatusBar_LogoutTime;
 222+ }
 223+
 224+ /**
 225+ * Delete old records from the table, this function is called frequently too keep it as small as possible
173226 * @return int
174227 */
175 - public static function DeleteOld() {
176 - global $wgOnlineStatusBar_LogoutTime;
 228+ public static function deleteOld() {
177229 $dbw = wfGetDB( DB_MASTER );
178230 // calculate time and convert it back to mediawiki format
179 - $time = wfTimestamp( TS_UNIX ) - $wgOnlineStatusBar_LogoutTime;
 231+ $time = self::getTimeoutDate();
180232 $dbw->delete( 'online_status', array( "timestamp < " . $dbw->addQuotes( $dbw->timestamp( $time ) ) ), __METHOD__ );
181233 return 0;
182234 }
@@ -204,7 +256,7 @@
205257 * @param $userName string
206258 * @return bool
207259 */
208 - static function DeleteStatus( $userName ) {
 260+ static function deleteStatus( $userName ) {
209261 $dbw = wfGetDB( DB_MASTER );
210262 $dbw->delete( 'online_status', array( 'username' => $userName ), __METHOD__ ); // delete user
211263 return true;
Index: branches/REL1_18/extensions/OnlineStatusBar/OnlineStatusBar.i18n.php
@@ -22,6 +22,8 @@
2323 'onlinestatusbar-used' => 'Do you want to let others see if you are online?',
2424 // Message in config asking what status they want to use
2525 'onlinestatusbar-status' => 'What is the default status you wish to use:',
 26+ // Message in config asking if user wants to purge the user page
 27+ 'onlinestatusbar-purge' => 'Purge user page everytime when you login or logout',
2628 // Section for config
2729 'prefs-onlinestatus' => 'Online status',
2830 // Message in config
@@ -46,6 +48,7 @@
4749 * $3 a status, it will appear in title bar of their user space pages',
4850 'onlinestatusbar-used' => 'Message in config asking user if they want to enable it, checkbox',
4951 'onlinestatusbar-status' => 'Message in config asking what status they want to use, option box',
 52+ 'onlinestatusbar-purge' => 'Option to purge user page everytime they login so that magic word is updated',
5053 'prefs-onlinestatus' => 'Section for config, located in preferences - misc',
5154 'onlinestatusbar-hide' => 'Ask user if they want to hide status bar this is useful when they are using custom template but need to check if they are online',
5255 'onlinestatusbar-status-online' => 'Status for users who mark themselves as active',
@@ -83,6 +86,7 @@
8487
8588 /** French (Français)
8689 * @author DavidL
 90+ * @author Gomoko
8791 */
8892 $messages['fr'] = array(
8993 'onlinestatusbar-desc' => "Barre d'état montrant si un utilisateur est en ligne, basé sur les préférences, sur leur page utilisateur",
@@ -91,6 +95,11 @@
9296 'onlinestatusbar-status' => 'Quel est le statut par défaut que vous souhaitez utiliser :',
9397 'prefs-onlinestatus' => 'État en ligne',
9498 'onlinestatusbar-hide' => "Voulez-vous masquer la barre d'état afin d'utiliser le mot magique seulement ? (Pour les utilisateurs avancés)",
 99+ 'onlinestatusbar-status-online' => 'Présent',
 100+ 'onlinestatusbar-status-busy' => 'Occupé',
 101+ 'onlinestatusbar-status-away' => 'Parti',
 102+ 'onlinestatusbar-status-offline' => 'Absent',
 103+ 'onlinestatusbar-status-hidden' => 'Caché',
95104 );
96105
97106 /** Galician (Galego)
@@ -123,6 +132,23 @@
124133 'onlinestatusbar-status-hidden' => 'Schowany',
125134 );
126135
 136+/** Interlingua (Interlingua)
 137+ * @author McDutchie
 138+ */
 139+$messages['ia'] = array(
 140+ 'onlinestatusbar-desc' => 'Barra de stato que monstra si un usator es in linea, dependente de su preferentias, in su pagina de usator',
 141+ 'onlinestatusbar-line' => '$1 es ora $2 $3',
 142+ 'onlinestatusbar-used' => 'Vole tu permitter que alteres vide si tu es in linea?',
 143+ 'onlinestatusbar-status' => 'Qual es le stato predefinite que tu vole usar:',
 144+ 'prefs-onlinestatus' => 'Stato in linea',
 145+ 'onlinestatusbar-hide' => 'Vole tu celar le barra de stato pro usar solmente le parola magic? (Pro usatores avantiate)',
 146+ 'onlinestatusbar-status-online' => 'In linea',
 147+ 'onlinestatusbar-status-busy' => 'Occupate',
 148+ 'onlinestatusbar-status-away' => 'Absente',
 149+ 'onlinestatusbar-status-offline' => 'Foras de linea',
 150+ 'onlinestatusbar-status-hidden' => 'Celate',
 151+);
 152+
127153 /** Luxembourgish (Lëtzebuergesch)
128154 * @author Robby
129155 */
Index: branches/REL1_18/extensions/OnlineStatusBar/OnlineStatusBar.php
@@ -17,7 +17,7 @@
1818 $wgExtensionCredits[version_compare( $wgVersion, '1.17', '>=' ) ? 'userpage tools' : 'other'][] = array(
1919 'path' => __FILE__,
2020 'name' => 'Online status bar',
21 - 'version' => '1.0.0',
 21+ 'version' => '1.0.1',
2222 'author' => array( 'Petr Bena' ),
2323 'descriptionmsg' => 'onlinestatusbar-desc',
2424 'url' => 'http://www.mediawiki.org/wiki/Extension:OnlineStatusBar',
Index: branches/REL1_18/extensions/OnlineStatusBar/OnlineStatusBarHooks.php
@@ -28,16 +28,19 @@
2929 * @return bool
3030 */
3131 public static function logout( &$user, &$inject_html, $old_name ) {
32 - OnlineStatusBar::DeleteStatus( $old_name );
 32+ OnlineStatusBar::purge( $old_name );
 33+ OnlineStatusBar::deleteStatus( $old_name );
3334 return true;
3435 }
3536
3637 /**
37 - * Called everytime when it's needed to update db
 38+ * Called everytime on login
3839 * @return bool
3940 */
4041 public static function updateStatus() {
41 - OnlineStatusBar::UpdateDb();
 42+ global $wgUser;
 43+ OnlineStatusBar::purge( $wgUser );
 44+ OnlineStatusBar::updateStatus();
4245 return true;
4346 }
4447
@@ -51,7 +54,7 @@
5255 public static function renderBar( &$article, &$outputDone, &$pcache ) {
5356 $context = $article->getContext();
5457
55 - OnlineStatusBar::UpdateStatus();
 58+ OnlineStatusBar::updateStatus();
5659 $result = OnlineStatusBar::getUserInfoFromTitle( $article->getTitle() );
5760 if ( $result === false && User::isIP ( $article->getTitle()->getBaseText() ) ) {
5861 $result = OnlineStatusBar::getAnonFromTitle( $article->getTitle() );
@@ -88,6 +91,7 @@
8992 global $wgOnlineStatusBarDefaultOnline, $wgOnlineStatusBarDefaultEnabled, $wgOnlineStatusBarModes;
9093 $preferences['OnlineStatusBar_active'] = array( 'type' => 'toggle', 'label-message' => 'onlinestatusbar-used', 'section' => 'misc/onlinestatus' );
9194 $preferences['OnlineStatusBar_hide'] = array( 'type' => 'toggle', 'label-message' => 'onlinestatusbar-hide', 'section' => 'misc/onlinestatus' );
 95+ $preferences['OnlineStatusBar_autoupdate'] = array( 'type' => 'toggle', 'label-message' => 'onlinestatusbar-purge', 'section' => 'misc/onlinestatus' );
9296 $preferences['OnlineStatusBar_status'] = array( 'type' => 'radio', 'label-message' => 'onlinestatusbar-status', 'section' => 'misc/onlinestatus',
9397 'options' => array(
9498 wfMessage( 'onlinestatusbar-status-online' )->escaped() => 'online',
@@ -106,6 +110,7 @@
107111 public static function setDefaultOptions( &$defaultOptions ) {
108112 global $wgOnlineStatusBarDefaultOnline, $wgOnlineStatusBarDefaultEnabled;
109113 // set defaults
 114+ $defaultOptions['OnlineStatusBar_autoupdate'] = false;
110115 $defaultOptions['OnlineStatusBar_status'] = $wgOnlineStatusBarDefaultOnline;
111116 $defaultOptions['OnlineStatusBar_active'] = $wgOnlineStatusBarDefaultEnabled;
112117 $defaultOptions['OnlineStatusBar_hide'] = false;
Property changes on: branches/REL1_18/extensions/OnlineStatusBar
___________________________________________________________________
Added: svn:mergeinfo
113118 Merged /trunk/extensions/OnlineStatusBar:r97886-97887,97899,97969,98054,98179,98497,98607,98654,98773,98801,98960,98982,99059,99097,99164,99167,99187,99193,99653,99897,100092,100573,100689,100692,101374-101518

Status & tagging log