[pLog-svn] r1740 - plog/branches/plog-1.1-ben/class/dao
ork at devel.plogworld.net
ork at devel.plogworld.net
Tue Apr 5 16:10:29 GMT 2005
Author: ork
Date: 2005-04-05 16:10:28 +0000 (Tue, 05 Apr 2005)
New Revision: 1740
Modified:
plog/branches/plog-1.1-ben/class/dao/articles.class.php
Log:
another include
Modified: plog/branches/plog-1.1-ben/class/dao/articles.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/articles.class.php 2005-04-05 15:46:55 UTC (rev 1739)
+++ plog/branches/plog-1.1-ben/class/dao/articles.class.php 2005-04-05 16:10:28 UTC (rev 1740)
@@ -83,14 +83,14 @@
* @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 = POST_STATUS_ALL )
+ function getBlogArticle( $artId, $blogId = -1, $includeHiddenFields = true, $date = -1, $categoryId = -1, $userId = -1, $status = null )
{
$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!
+ // 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 ";
}
@@ -105,8 +105,9 @@
$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 != POST_STATUS_ALL )
- $query .= " AND a.status = $status;";
+ if( $status != null ) {
+ $query .= " AND a.status = $status;";
+ }
return $this->_getBlogArticleFromQuery( $query, $includeHiddenFields );
}
@@ -242,6 +243,7 @@
*/
function buildWhere( $blogid, $date = -1, $amount = -1, $categoryId = 0, $status = 0, $userId = 0, $maxDate = 0, $searchTerms = "", $page = -1, $itemsPerPage = 15 )
{
+ include_once( PLOG_CLASS_PATH."class/database/db.class.php" );
$postStatus = $status;
$prefix = $this->getPrefix();
$query = "a.blog_id = ".Db::qstr($blogid);
@@ -311,7 +313,7 @@
if( $categoryId != -1 )
$query .= " GROUP BY a.id";
- $result = $this->_db->Execute( $query );
+ $result = $this->Execute( $query );
if( !$result )
return 0;
@@ -395,7 +397,7 @@
}
$ids = substr($ids, 0, -1);
- //$articleComments = $this->comments->getPostCommentsByIds( $ids, COMMENT_ORDER_NEWEST_FIRST, COMMENT_STATUS_ALL );
+ // $articleComments = $this->comments->getPostCommentsByIds( $ids, COMMENT_ORDER_NEWEST_FIRST, COMMENT_STATUS_ALL );
//$articleTrackbacks = $this->trackbacks->getArticleTrackbacksByIds( $ids );
$articleCategories = $this->categories->getArticleCategoriesByIds( $ids, $blogid );
$articleTexts = $this->getArticlesText( $ids );
@@ -1134,6 +1136,7 @@
function _fillArticleHeaderInformation( $query_result, $includeHiddenFields = true )
{
include_once( PLOG_CLASS_PATH.'class/dao/article.class.php' );
+ include_once( PLOG_CLASS_PATH.'class/data/timestamp.class.php' );
$id = $query_result['id'];
if( isset($this->cache[$id])) {
More information about the pLog-svn
mailing list