fixup database timestamps
authorDomas Mituzas <midom@users.mediawiki.org>
Thu, 19 Aug 2004 12:59:57 +0000 (12:59 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Thu, 19 Aug 2004 12:59:57 +0000 (12:59 +0000)
includes/Article.php
includes/RecentChange.php

index a00e5aa..091083e 100644 (file)
@@ -771,7 +771,7 @@ class Article {
                        'cur_text' => $text,
                        'cur_comment' => $summary,
                        'cur_user' => $wgUser->getID(),
-                       'cur_timestamp' => $now,
+                       'cur_timestamp' => $dbw->timestamp($now),
                        'cur_minor_edit' => $isminor,
                        'cur_counter' => 0,
                        'cur_restrictions' => '',
@@ -779,7 +779,7 @@ class Article {
                        'cur_is_redirect' => $redir,
                        'cur_is_new' => 1,
                        'cur_random' => $rand,
-                       'cur_touched' => $now,
+                       'cur_touched' => $dbw->timestamp($now),
                        'inverse_timestamp' => $won,
                ), $fname );
 
@@ -799,7 +799,8 @@ class Article {
 
                # The talk page isn't in the regular link tables, so we need to update manually:
                $talkns = $ns ^ 1; # talk -> normal; normal -> talk
-               $dbw->updateArray( 'cur', array( 'cur_touched' => $now ), array( 'cur_namespace' => $talkns, 'cur_title' => $ttl ), $fname );
+               $dbw->updateArray( 'cur', array('cur_touched' => $dbw->timestamp($now) ), 
+                       array(  'cur_namespace' => $talkns, 'cur_title' => $ttl ), $fname );
 
                # standard deferred updates
                $this->editUpdates( $text );
index fbe1161..dfb5fe1 100644 (file)
@@ -100,6 +100,10 @@ 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 );
 
@@ -119,7 +123,7 @@ class RecentChange
                                ), array( /* WHERE */
                                        'rc_namespace' => $ns,
                                        'rc_title' => $title,
-                                       'rc_timestamp' => $lastTime
+                                       'rc_timestamp' => $dbw->timestamp($lastTime)
                                ), $fname
                        );