[pLog-svn] r2091 - plog/branches/plog-1.1-ben/class/dao
ork at devel.plogworld.net
ork at devel.plogworld.net
Sun May 29 13:44:18 GMT 2005
Author: ork
Date: 2005-05-29 13:44:17 +0000 (Sun, 29 May 2005)
New Revision: 2091
Modified:
plog/branches/plog-1.1-ben/class/dao/articles.class.php
Log:
as far as i see this, getBlogArticle will just be called with an id, so we do not need to have that many parameters here. didn't find any place in the code where getBlogArticle was fetched with more than 2 parameters. didn't check the plugins, though ..
Modified: plog/branches/plog-1.1-ben/class/dao/articles.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/articles.class.php 2005-05-29 13:25:43 UTC (rev 2090)
+++ plog/branches/plog-1.1-ben/class/dao/articles.class.php 2005-05-29 13:44:17 UTC (rev 2091)
@@ -70,30 +70,22 @@
* @param blogId If set, the article must belong to the given blog
* @return Returns an Article object or 'false' otherwise.
*/
- function getBlogArticle( $artId, $blogId = -1, $includeHiddenFields = true, $date = -1, $categoryId = -1, $userId = -1, $status = null )
+ function getBlogArticle( $artId, $blogId = -1 )
{
+ // TBD: remove me
+ // function getBlogArticle( $artId, $blogId = -1, $includeHiddenFields = true, $date = -1, $categoryId = -1, $userId = -1, $status = null )
+ // $this->log->info("called getBlogArticle with: $artId, $blogId, $includeHiddenFields, $date, $categoryId, $userId, $status");
$prefix = $this->getPrefix();
$query = "SELECT a.id, a.date,
a.user_id,a.blog_id,a.status,a.properties,
a.num_reads, a.slug FROM {$prefix}articles a ";
// thanks jon for the tip :) You're right that the amount of rows will be too big
// if we don't really need these fields!
- if($categoryId != -1 && $blogId != -1) {
- $query .= ", {$prefix}articles_categories c, {$prefix}article_categories_link l ";
- }
$query .= "WHERE a.id = ".Db::qstr($artId);
- if( $blogId != -1 )
+ if( $blogId != -1 ) {
$query .= " AND a.blog_id = ".Db::qstr($blogId);
- if( $date != -1 )
- $query .= " AND a.date+0 LIKE '$date%'";
- if( $userId != -1 )
- $query .= " AND a.user_id = ".Db::qstr($userId);
- if( $categoryId != -1 )
- $query .= " AND c.id = ".Db::qstr($categoryId)." AND c.id = l.category_id AND a.id = l.article_id";
- if( $status != null && $status != POST_STATUS_PUBLISHED ) {
- $query .= " AND a.status = $status;";
}
return $this->_getBlogArticleFromQuery( $query, $includeHiddenFields );
More information about the pLog-svn
mailing list