[pLog-svn] r3141 - plog/trunk/class/dao
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Tue Mar 28 13:50:52 GMT 2006
Author: jondaley
Date: 2006-03-28 13:50:51 +0000 (Tue, 28 Mar 2006)
New Revision: 3141
Modified:
plog/trunk/class/dao/commentscommon.class.php
Log:
fixes crash because blog_id isn't in the plog_articles_comments table, so it can't be gotten in mapRow. I am not sure how this worked at all. Note, I am now grabbing a blogInfo->_id, which at least should be changed to a getId() non-private function, but I am not sure I have the right fix anyway?
Modified: plog/trunk/class/dao/commentscommon.class.php
===================================================================
--- plog/trunk/class/dao/commentscommon.class.php 2006-03-27 17:43:43 UTC (rev 3140)
+++ plog/trunk/class/dao/commentscommon.class.php 2006-03-28 13:50:51 UTC (rev 3141)
@@ -40,7 +40,7 @@
class CommentsCommon extends Model
{
- var $_blogSettings;
+// var $_blogSettings;
var $blogSettings;
var $timeDiff;
@@ -461,16 +461,18 @@
$prefix = $this->getPrefix();
$date = $row["date"];
$articleId = $row["article_id"];
- $blogId = $row["blog_id"];
-
- $blogs = new Blogs();
- $blogInfo = $blogs->getBlogInfo( $blogId );
- $blogSettings = $blogInfo->getSettings();
+
+ // load the post to get the blog in order to get the time difference
+ $articles = new Articles();
+ $article = $articles->getArticle( $row["article_id"]);
+ $blog = $article->getBlogInfo();
+ $blogSettings = $blog->getSettings();
+
$timeDiff = $blogSettings->getValue( "time_offset" );
$date = Timestamp::getDateWithOffset( $date, $timeDiff );
$comment = new UserComment( $row["article_id"],
- $row['blog_id'],
+ $blog->_id,
$row["parent_id"],
$row["topic"],
$row["text"],
More information about the pLog-svn
mailing list