[pLog-general] question about getBlogArticles?

linuxman subaochen at 126.com
Sat Feb 19 13:20:05 GMT 2005


or, change the default value of parameter categoryId to -1 in function
getBlogArticles.

在 2005-02-19六的 20:59 +0800,linuxman写道:
> 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
> 
> 
> 
> _______________________________________________
> pLog-general mailing list
> pLog-general at devel.plogworld.net
> http://devel.plogworld.net/mailman/listinfo/plog-general
> 





More information about the pLog-general mailing list