[pLog-svn] r3272 - plugins/trunk/moderate/class/action

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sun Apr 23 21:28:34 GMT 2006


Author: oscar
Date: 2006-04-23 21:28:33 +0000 (Sun, 23 Apr 2006)
New Revision: 3272

Modified:
   plugins/trunk/moderate/class/action/adminupdateunmoderatedcommentsaction.class.php
Log:
fixed the 'moderate' plugin


Modified: plugins/trunk/moderate/class/action/adminupdateunmoderatedcommentsaction.class.php
===================================================================
--- plugins/trunk/moderate/class/action/adminupdateunmoderatedcommentsaction.class.php	2006-04-23 19:17:52 UTC (rev 3271)
+++ plugins/trunk/moderate/class/action/adminupdateunmoderatedcommentsaction.class.php	2006-04-23 21:28:33 UTC (rev 3272)
@@ -69,7 +69,20 @@
 			$comments = new UnmoderatedComments();
 			
 			foreach( $this->_updateComments as $commentId ) {
-				$comments->updateCommentStatus( $commentId, COMMENT_STATUS_NONSPAM );
+				
+				$comment = $comments->getComment( $commentId );
+				
+				// check if the comment exists
+				if( !$comment )
+				    continue;
+				    
+				// check if it belongs to the right blog
+				if( $comment->getBlogId() != $this->_blogInfo->getId())
+				    continue;
+				    
+				// everything correct, so we can update
+				$comment->setStatus( COMMENT_STATUS_NONSPAM );
+				$comments->updateComment( $comment );
 			}
 			
 			$this->_view = new AdminUnmoderatedCommentsview( $this->_blogInfo );



More information about the pLog-svn mailing list