[pLog-general] question about getBlogArticles?

linuxman subaochen at 126.com
Sat Feb 19 12:59:08 GMT 2005


The question is actually about buildWhere, the codes list below:

            if( $categoryId == -1 )
                $query .= " AND c.id = l.category_id AND a.id =
l.article_id ";
            else {
                if( $categoryId > 0 )
                    $query .= " AND a.id = l.article_id AND
l.category_id = $categoryId AND c.id = l.category_id";
                else {
                    $query .= " AND c.id = l.category_id AND a.id =
l.article_id AND c.in_main_page = 1";
                }
            }


So, what if we call getBlogArticles by
$articles->getBlogArticles($blogId)? should return all articles blongs
to that $blogId? But the default parameter of categoryId is 0, is
buildWhere part will be :

$query .= " AND c.id = l.category_id AND a.id = l.article_id AND
c.in_main_page = 1";

You can see, will return all articles that showed in main page.

Any idea? remove AND c.in_main_page = 1 in buildWhere function?

Best regards,

Su Baochen






More information about the pLog-general mailing list