[pLog-svn] r2916 - plog/trunk/class/dao

mark at devel.lifetype.net mark at devel.lifetype.net
Tue Feb 7 09:45:22 GMT 2006


Author: mark
Date: 2006-02-07 09:45:21 +0000 (Tue, 07 Feb 2006)
New Revision: 2916

Modified:
   plog/trunk/class/dao/commentscommon.class.php
Log:
1. Modify the COMMENT_STATUS_ACTIVE to COMMENT_STATUS_NONSPAM
2. Some more bug fix.

Modified: plog/trunk/class/dao/commentscommon.class.php
===================================================================
--- plog/trunk/class/dao/commentscommon.class.php	2006-02-07 09:24:29 UTC (rev 2915)
+++ plog/trunk/class/dao/commentscommon.class.php	2006-02-07 09:45:21 UTC (rev 2916)
@@ -67,14 +67,14 @@
 				$blog = $article->getBlogInfo();
 				if( $comment->getType() == COMMENT_TYPE_COMMENT ) {
 					$article->setTotalComments( $article->getTotalComments() + 1 );
-					if( $comment->getStatus() == COMMENT_STATUS_ACTIVE ) {
+					if( $comment->getStatus() == COMMENT_STATUS_NONSPAM ) {
 						$article->setNumComments( $article->getNumComments() +1 );
 					}
 					$blog->setTotalComments( $blog->getTotalComments() + 1 );
 				}
 				else {
 					$article->setTotalTrackbacks( $article->getTotalTrackbacks() + 1 );
-					if( $comment->getStatus() == COMMENT_STATUS_ACTIVE ) {
+					if( $comment->getStatus() == COMMENT_STATUS_NONSPAM ) {
 						$article->setNumTrackbacks( $article->getNumTrackbacks() +1 );
 					}
 					$blog->setTotalTrackbacks( $blog->getTotalTrackbacks() + 1 );					
@@ -183,7 +183,7 @@
 				if( $status == COMMENT_STATUS_ALL && $article ) {
 					$numComments = $article->getTotalComments();
 				}
-				elseif( $status == COMMENT_STATUS_ACTIVE && $article ) {
+				elseif( $status == COMMENT_STATUS_NONSPAM && $article ) {
 					$numComments = $article->getNumComments();
 				}
 				else {
@@ -192,10 +192,10 @@
 			}
 			else {
 				if( $status == COMMENT_STATUS_ALL && $article ) {
-					$numComments = $article->getTotalComments();
+					$numComments = $article->getTotalTrackBacks();
 				}
-				elseif( $status == COMMENT_STATUS_ACTIVE && $article ) {
-					$numComments = $article->getNumComments();
+				elseif( $status == COMMENT_STATUS_NONSPAM && $article ) {
+					$numComments = $article->getNumTrackBacks();
 				}
 				else {
 					$numComments = $this->getPostComments( $artId, COMMENT_ORDER_NEWEST_FIRST, $status, $type );
@@ -239,7 +239,7 @@
 				if( $status != COMMENT_STATUS_ALL )
 					$cond .= " AND status = '".Db::qstr($status)."'";
 				if( $type != COMMENT_TYPE_ANY )
-					$query .= " AND type = '".Db::qstr($type)."'";				
+					$cond .= " AND type = '".Db::qstr($type)."'";				
 				$numComments = $this->getNumItems( $table, $cond );
         	}
         	
@@ -274,14 +274,14 @@
         	    if( $type == COMMENT_TYPE_COMMENT ) {
 	        	    $blog->setTotalComments( $blog->getTotalComments() - 1 );
 	        		$article->setTotalComments( $article->getTotalComments() - 1 );	        	    
-		        	if( $comment->getStatus() == COMMENT_STATUS_ACTIVE ) {
+		        	if( $comment->getStatus() == COMMENT_STATUS_NONSPAM ) {
 		        		$article->setNumComments( $article->getNumComments() - 1 );		        		
 		        	}
 	        	}
 	        	else {
 	        	    $blog->setTotalTrackbacks( $blog->getTotalTrackbacks() - 1 );	        	
 	        		$article->setTotalTrackbacks( $article->getTotalTrackbacks() - 1 );
-		        	if( $comment->getStatus() == COMMENT_STATUS_ACTIVE ) {
+		        	if( $comment->getStatus() == COMMENT_STATUS_NONSPAM ) {
 		        		$article->setNumTrackbacks( $article->getNumTrackbacks() - 1 );		        		
 		        	}
 	        	}



More information about the pLog-svn mailing list