[pLog-svn] r3137 - plog/trunk/class/summary/dao

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Mon Mar 27 04:18:36 GMT 2006


Author: jondaley
Date: 2006-03-27 04:18:35 +0000 (Mon, 27 Mar 2006)
New Revision: 3137

Modified:
   plog/trunk/class/summary/dao/summarystats.class.php
Log:
summary should only show comments on the most commented section.  Or if not, the count should be changed to include trackbacks, because otherwise it looks strange to have a 'most commented' article have 0 comments (but 27 trackbacks).  Also - perhaps the COMMENT_TYPE_* constants should be moved out of commentscommon.class.php, so the whole file doesn't have to be included just for the constants?

Modified: plog/trunk/class/summary/dao/summarystats.class.php
===================================================================
--- plog/trunk/class/summary/dao/summarystats.class.php	2006-03-27 03:55:04 UTC (rev 3136)
+++ plog/trunk/class/summary/dao/summarystats.class.php	2006-03-27 04:18:35 UTC (rev 3137)
@@ -51,6 +51,7 @@
         function getMostCommentedArticles( $maxPosts = 0, $ignoreTopic = "", $ignoreText = "" )
         {
             include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
+            include_once( PLOG_CLASS_PATH."class/dao/commentscommon.class.php" );
 			$articles = new Articles();
 
 			$prefix = $this->getPrefix();
@@ -61,6 +62,7 @@
        				   WHERE c.article_id = a.id  
        				         AND a.status = ".POST_STATUS_PUBLISHED." 
        				         AND c.status = ".COMMENT_STATUS_NONSPAM."
+       				         AND c.type = ".COMMENT_TYPE_COMMENT."
        				         AND b.id = a.blog_id
        				         AND b.status = ".BLOG_STATUS_ACTIVE."
        				         AND a.date <= ".$this->_now."



More information about the pLog-svn mailing list