[pLog-svn] r5419 - in plog/branches/lifetype-1.2/class: action/admin dao
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Fri May 18 05:33:50 EDT 2007
Author: oscar
Date: 2007-05-18 05:33:50 -0400 (Fri, 18 May 2007)
New Revision: 5419
Modified:
plog/branches/lifetype-1.2/class/action/admin/adminupdatepostaction.class.php
plog/branches/lifetype-1.2/class/dao/articles.class.php
Log:
Fix for issue http://bugs.lifetype.net/view.php?id=1307 -- the modification date of articles was never being set or used (and we never needed it, but it turns out some enterprising users do)
Modified: plog/branches/lifetype-1.2/class/action/admin/adminupdatepostaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminupdatepostaction.class.php 2007-05-18 08:25:41 UTC (rev 5418)
+++ plog/branches/lifetype-1.2/class/action/admin/adminupdatepostaction.class.php 2007-05-18 09:33:50 UTC (rev 5419)
@@ -117,7 +117,12 @@
$post->setCommentsEnabled( $this->_commentsEnabled );
$post->setPostSlug( $this->_postSlug );
$post->setGlobalCategoryId( $this->_globalArticleCategoryId );
- $post->setUser( $this->_posterId );
+ $post->setUser( $this->_posterId );
+
+ // set the modification date
+ $blogSettings = $this->_blogInfo->getSettings();
+ $modifDate = Timestamp::getDateWithOffset( new Timestamp(), $blogSettings->getValue( "time_offset", 0 ));
+ $post->setModificationDate( $modifDate );
// prepare the custom fields
$fields = Array();
Modified: plog/branches/lifetype-1.2/class/dao/articles.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/articles.class.php 2007-05-18 08:25:41 UTC (rev 5418)
+++ plog/branches/lifetype-1.2/class/dao/articles.class.php 2007-05-18 09:33:50 UTC (rev 5419)
@@ -444,7 +444,8 @@
a.num_nonspam_comments AS num_nonspam_comments, a.num_trackbacks AS num_trackbacks,
a.num_nonspam_trackbacks AS num_nonspam_trackbacks,
a.global_category_id AS global_category_id,
- a.in_summary_page AS in_summary_page
+ a.in_summary_page AS in_summary_page,
+ a.modification_date AS modification_date
FROM {$prefix}articles a, {$prefix}articles_categories c,
{$prefix}article_categories_link l";
if( $searchTerms != "" )
@@ -1194,9 +1195,10 @@
$timeDiff = $blogSettings->getValue( 'time_offset' );
else
$timeDiff = 0;
-
+
// we can use this auxiliary function to help us...
$date = Timestamp::getDateWithOffset( $query_result['date'], $timeDiff );
+ $modifDate = Timestamp::getDateWithOffset( $query_result['modification_date'], $timeDiff );
$categories = new ArticleCategories();
$articleCategories = $categories->getArticleCategories( $query_result['id'], $query_result['blog_id'] );
@@ -1220,6 +1222,7 @@
// and fill in all the fields with the information we just got from the db
$article->setDate( $date );
+ $article->setModificationDate( $modifDate );
$article->setTimeOffset( $timeDiff );
$article->setCategories( $articleCategories );
// get information about the categories of the article
More information about the pLog-svn
mailing list