X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FRecentChange.php;h=1dba1ea679b29a7306b2c4056f4a4ff243340e57;hb=5c2b2730ff78e9f1ecac759a56470ce6eba859ef;hp=fbe1161e632b82456efe025af15da94527145a41;hpb=7820951f7f757dc5e93e3b9e67d14d8b44de85d6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/RecentChange.php b/includes/RecentChange.php index fbe1161e63..1dba1ea679 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -1,39 +1,48 @@ mExtra) ) { @@ -100,8 +109,12 @@ class RecentChange $this->mAttribs['rc_ip'] = ''; } + # Fixup database timestamps + $this->mAttribs['rc_timestamp']=$dbw->timestamp($this->mAttribs['rc_timestamp']); + $this->mAttribs['rc_cur_time']=$dbw->timestamp($this->mAttribs['rc_cur_time']); + # Insert new row - $dbw->insertArray( "recentchanges", $this->mAttribs, $fname ); + $dbw->insertArray( 'recentchanges', $this->mAttribs, $fname ); # Update old rows, if necessary if ( $this->mAttribs['rc_type'] == RC_EDIT ) { @@ -119,7 +132,7 @@ class RecentChange ), array( /* WHERE */ 'rc_namespace' => $ns, 'rc_title' => $title, - 'rc_timestamp' => $lastTime + 'rc_timestamp' => $dbw->timestamp($lastTime) ), $fname ); @@ -142,7 +155,7 @@ class RecentChange # Marks a certain row as patrolled function markPatrolled( $rcid ) { - $fname = "RecentChange::markPatrolled"; + $fname = 'RecentChange::markPatrolled'; $dbw =& wfGetDB( DB_MASTER ); @@ -159,7 +172,7 @@ class RecentChange /*static*/ function notifyEdit( $timestamp, &$title, $minor, &$user, $comment, $oldId, $lastTimestamp, $bot = "default", $ip = '' ) { - if ( $bot == "default " ) { + if ( $bot == 'default ' ) { $bot = $user->isBot(); } @@ -186,6 +199,7 @@ class RecentChange 'rc_moved_to_ns' => 0, 'rc_moved_to_title' => '', 'rc_ip' => $ip, + 'rc_patrolled' => 0, 'rc_new' => 0 # obsolete ); @@ -204,7 +218,7 @@ class RecentChange global $wgIP; $ip = empty( $wgIP ) ? '' : $wgIP; } - if ( $bot == "default" ) { + if ( $bot == 'default' ) { $bot = $user->isBot(); } @@ -226,6 +240,7 @@ class RecentChange 'rc_moved_to_ns' => 0, 'rc_moved_to_title' => '', 'rc_ip' => $ip, + 'rc_patrolled' => 0, 'rc_new' => 1 # obsolete ); @@ -328,16 +343,16 @@ class RecentChange function loadFromCurRow( $row ) { $this->mAttribs = array( - "rc_timestamp" => $row->cur_timestamp, - "rc_cur_time" => $row->cur_timestamp, - "rc_user" => $row->cur_user, - "rc_user_text" => $row->cur_user_text, - "rc_namespace" => $row->cur_namespace, - "rc_title" => $row->cur_title, - "rc_comment" => $row->cur_comment, - "rc_minor" => !!$row->cur_minor_edit, - "rc_type" => $row->cur_is_new ? RC_NEW : RC_EDIT, - "rc_cur_id" => $row->cur_id, + 'rc_timestamp' => $row->cur_timestamp, + 'rc_cur_time' => $row->cur_timestamp, + 'rc_user' => $row->cur_user, + 'rc_user_text' => $row->cur_user_text, + 'rc_namespace' => $row->cur_namespace, + 'rc_title' => $row->cur_title, + 'rc_comment' => $row->cur_comment, + 'rc_minor' => !!$row->cur_minor_edit, + 'rc_type' => $row->cur_is_new ? RC_NEW : RC_EDIT, + 'rc_cur_id' => $row->cur_id, 'rc_this_oldid' => 0, 'rc_last_oldid' => 0, 'rc_bot' => 0, @@ -353,20 +368,22 @@ class RecentChange } - # Gets the end part of the diff URL assoicated with this object - # Blank if no diff link should be displayed + /** + * Gets the end part of the diff URL assoicated with this object + * Blank if no diff link should be displayed + */ function diffLinkTrail( $forceCur ) { if ( $this->mAttribs['rc_type'] == RC_EDIT ) { $trail = "curid=" . (int)($this->mAttribs['rc_cur_id']) . "&oldid=" . (int)($this->mAttribs['rc_last_oldid']); if ( $forceCur ) { - $trail .= "&diff=0" ; + $trail .= '&diff=0' ; } else { - $trail .= "&diff=" . (int)($this->mAttribs['rc_this_oldid']); + $trail .= '&diff=' . (int)($this->mAttribs['rc_this_oldid']); } } else { - $trail = ""; + $trail = ''; } return $trail; }