[pLog-svn] r4315 - plog/branches/lifetype-1.1.3/class/dao

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Thu Nov 16 14:09:06 GMT 2006


Author: jondaley
Date: 2006-11-16 14:09:04 +0000 (Thu, 16 Nov 2006)
New Revision: 4315

Modified:
   plog/branches/lifetype-1.1.3/class/dao/commentscommon.class.php
Log:
if we called getNumPostComments with COMMENT_TYPE_ANY it would count only the trackbacks

Modified: plog/branches/lifetype-1.1.3/class/dao/commentscommon.class.php
===================================================================
--- plog/branches/lifetype-1.1.3/class/dao/commentscommon.class.php	2006-11-16 14:08:22 UTC (rev 4314)
+++ plog/branches/lifetype-1.1.3/class/dao/commentscommon.class.php	2006-11-16 14:09:04 UTC (rev 4315)
@@ -184,7 +184,7 @@
         	$numComments = 0;
 			$articles = new Articles();
 			$article = $articles->getArticle( $artId );        	
-            
+
             if(!$article)
                 return 0;
             
@@ -199,11 +199,10 @@
 					$numComments = $article->getTotalComments() - $article->getNumComments();
 				}
 				else {
-//					$numComments = $this->getPostComments( $artId, COMMENT_ORDER_NEWEST_FIRST, $status, $type );
                     $numComments = 0;
 				}
 			}
-			else {
+			else if($type == COMMENT_TYPE_TRACKBACK) {
 				if( $status == COMMENT_STATUS_ALL ) {
 					$numComments = $article->getTotalTrackBacks();
 				}
@@ -211,13 +210,16 @@
 					$numComments = $article->getNumTrackBacks();
 				}
 				elseif( $status == COMMENT_STATUS_SPAM ) {
-					$numComments = $article->getTotalTrackbacks() - $article->getNumTrackbacks();
+                        $numComments = $article->getTotalTrackbacks() - $article->getNumTrackbacks();
 				}
 				else {
-//					$numComments = $this->getPostComments( $artId, COMMENT_ORDER_NEWEST_FIRST, $status, $type );
                     $numComments = 0;
 				}
 			}
+            else{
+                $numComments = $this->getNumPostComments($artId, $status, COMMENT_TYPE_COMMENT) +
+                    $this->getNumPostComments($artId, $status, COMMENT_TYPE_TRACKBACK);
+            }
 			
 			return( $numComments );
         }



More information about the pLog-svn mailing list