[pLog-svn] r2551 - plog/branches/plog-1.0.2/class/dao

jondaley at devel.plogworld.net jondaley at devel.plogworld.net
Thu Nov 10 13:35:14 GMT 2005


Author: jondaley
Date: 2005-11-10 13:35:14 +0000 (Thu, 10 Nov 2005)
New Revision: 2551

Modified:
   plog/branches/plog-1.0.2/class/dao/articles.class.php
Log:
reverted change 2547.  dates are now broken for people using non-zero time offsets.  Apparently the xmlrpc and 'normal' paths put the dates in different formats into the database.  The way to fix all paths is to store the dates in the database in UTC format

Modified: plog/branches/plog-1.0.2/class/dao/articles.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/dao/articles.class.php	2005-11-10 04:36:36 UTC (rev 2550)
+++ plog/branches/plog-1.0.2/class/dao/articles.class.php	2005-11-10 13:35:14 UTC (rev 2551)
@@ -695,18 +695,13 @@
          */
         function addArticle( &$newArticle )
         {
-                // all this just to get the blog offset.
-            $blogInfo = $this->blogs->getBlogInfo( $newArticle->getBlog() );
-            $blogSettings = $blogInfo->getSettings();
-            $timeDiff = $blogSettings->getValue( 'time_offset' );
-            $articleDate = Timestamp::getDateWithOffset( $newArticle->getDate(), -($timeDiff));
-
-                // first, we build up the query
+            // first, we build up the query
+            $filter = new Textfilter();
             $query = "INSERT INTO ".$this->getPrefix()."articles( user_id,blog_id,status,date,properties, slug )
                       VALUES ( ".$newArticle->getUser().",".
                       $newArticle->getBlog().",'".
                       $newArticle->getStatus()."','".
-                      $articleDate."','".
+                      $newArticle->getDate()."','".
                       serialize($newArticle->getProperties())."','".
 					  $newArticle->getPostSlug()."');";
             // and then we send it to the db
@@ -827,6 +822,7 @@
         {
             // we have to build up the query, which will be pretty long...
             $articleDate = Timestamp::getDateWithOffset( $article->getDate(), -($article->getTimeOffset()));
+            $filter = new Textfilter();
 
             $query = "UPDATE ".$this->getPrefix()."articles SET id = ".$article->getId().
                      ", user_id = ".$article->getUser().




More information about the pLog-svn mailing list