[pLog-svn] r2959 - plog/trunk/class/dao
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Thu Feb 16 17:55:04 GMT 2006
Author: oscar
Date: 2006-02-16 17:55:04 +0000 (Thu, 16 Feb 2006)
New Revision: 2959
Modified:
plog/trunk/class/dao/commentscommon.class.php
Log:
this was a nasty one... first of all, we had "=!" instead of "!=" and second, there was an incorrect method name and variable within that if{} block.
Modified: plog/trunk/class/dao/commentscommon.class.php
===================================================================
--- plog/trunk/class/dao/commentscommon.class.php 2006-02-16 17:34:51 UTC (rev 2958)
+++ plog/trunk/class/dao/commentscommon.class.php 2006-02-16 17:55:04 UTC (rev 2959)
@@ -216,21 +216,21 @@
*/
function getNumBlogComments( $blogId, $status = COMMENT_STATUS_ALL, $type = COMMENT_TYPE_ANY, $searchTerms = "" )
{
- if( $status == COMMENT_STATUS_ALL && $type =! COMMENT_TYPE_ANY ) {
+ if( $status == COMMENT_STATUS_ALL && $type != COMMENT_TYPE_ANY ) {
// fast case, we can load the blog and query one of its intrinsic fields
include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
$blogs = new Blogs();
- $blogInfo = $blogs->getBlogInfoById( $blogId );
+ $blogInfo = $blogs->getBlogInfo( $blogId );
if( !$blogInfo )
$numComments = 0;
else {
if( $type == COMMENT_TYPE_COMMENT )
- $numComments = $blog->getTotalComments();
+ $numComments = $blogInfo->getTotalComments();
else
- $numComments = $blog->getTotalTrackbacks();
+ $numComments = $blogInfo->getTotalTrackbacks();
}
}
- else {
+ else {
// create the table name
$prefix = $this->getPrefix();
$table = "{$prefix}articles_comments";
@@ -240,6 +240,7 @@
$cond .= " AND status = '".Db::qstr($status)."'";
if( $type != COMMENT_TYPE_ANY )
$cond .= " AND type = '".Db::qstr($type)."'";
+ //print("type = ".$type." - cond = $cond");
$numComments = $this->getNumItems( $table, $cond );
}
More information about the pLog-svn
mailing list