[pLog-svn] r6365 - plog/branches/lifetype-1.2/class/action

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Mon Apr 28 15:22:20 EDT 2008


Author: jondaley
Date: 2008-04-28 15:22:20 -0400 (Mon, 28 Apr 2008)
New Revision: 6365

Modified:
   plog/branches/lifetype-1.2/class/action/commentaction.class.php
Log:
reply to parent comment has been broken for a while.  I have heard of one user complaining about it, but only a template or two actually use this feature.  It is now fixed

Modified: plog/branches/lifetype-1.2/class/action/commentaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/commentaction.class.php	2008-04-28 19:21:25 UTC (rev 6364)
+++ plog/branches/lifetype-1.2/class/action/commentaction.class.php	2008-04-28 19:22:20 UTC (rev 6365)
@@ -62,6 +62,14 @@
                 return false;
             }			
 
+            if(!$article->getCommentsEnabled()) {
+                    // NOTE: this is a slightly wrong error message, but why is someone
+                    // clicking on a "reply" link if comments aren't enabled anyway?
+                $this->_view = new ErrorView( $this->_blogInfo, "error_comments_not_enabled" );
+                $this->setCommonData();
+                return false;
+            }									
+            
         	$this->_view = new BlogView( $this->_blogInfo, "commentarticle", SMARTY_VIEW_CACHE_CHECK, 
 											   Array( "articleId" => $this->_articleId, "parentId" => $this->_parentId ));
 			// do nothing if the view was already cached
@@ -70,6 +78,9 @@
 				return true;
             }
 
+                // if we got this far, comments are allowed
+			$this->_view->setValue( "allowComments", true );
+            
 			// fetch the comments so far
             lt_include( PLOG_CLASS_PATH."class/dao/articlecomments.class.php" );
 			$comments = new ArticleComments();
@@ -90,7 +101,7 @@
 			$this->_view->setValue( "comments", $postComments );
 			$this->_view->setValue( "postcomments", $postComments );
 			$this->_view->setValue( "topic", $replyString );			
-	    
+
             $this->setCommonData();
 
             // and return everything normal



More information about the pLog-svn mailing list