- if ( $wgDatabase->tableExists( 'user_newtalk' ) ) {
- $res = $wgDatabase->safeQuery( 'SELECT user_id, user_ip FROM !',
- $wgDatabase->tableName( 'user_newtalk' ) );
- $num_newtalks=$wgDatabase->numRows($res);
- echo "ENOTIF: Now converting ".$num_newtalks." user_newtalk entries to watchlist table entries ... \n";
-
- $user = new User();
- for ( $i = 1; $i <= $num_newtalks; $i++ ) {
- $wluser = $wgDatabase->fetchObject( $res );
- echo 'ENOTIF: <= user_newtalk: user_id='.$wluser->user_id.' user_ip='.$wluser->user_ip."\n";
- if ($wluser->user_id == 0) { # anonymous users ... have IP numbers as "names"
- if ($user->isIP($wluser->user_ip)) { # do only if it really looks like an IP number (double checked)
- $wgDatabase->replace( 'watchlist',
- array(array('wl_user','wl_namespace', 'wl_title', 'wl_notificationtimestamp' )),
- array('wl_user' => 0,
- 'wl_namespace' => NS_USER_TALK,
- 'wl_title' => $wluser->user_ip,
- 'wl_notificationtimestamp' => '19700101000000'
- ), 'updaters.inc::do_watchlist_update2'
- );
- echo 'ENOTIF: ====> watchlist: user_id=0 '.$wluser->user_ip."\n";
- }
- } else { # normal users ... have user_ids
- $user->setID($wluser->user_id);
+ $res = $wgDatabase->safeQuery( 'SELECT user_id, user_ip FROM !',
+ $wgDatabase->tableName( 'user_newtalk' ) );
+ $num_newtalks=$wgDatabase->numRows($res);
+ echo "Now converting ".$num_newtalks." user_newtalk entries to watchlist table entries ... \n";
+
+ $user = new User();
+ for ( $i = 1; $i <= $num_newtalks; $i++ ) {
+ $wluser = $wgDatabase->fetchObject( $res );
+ if ($wluser->user_id == 0) { # anonymous users ... have IP numbers as "names"
+ if ($user->isIP($wluser->user_ip)) { # do only if it really looks like an IP number (double checked)