From d3426e6aa45fef18d7fbb8283832c662b0778fbf Mon Sep 17 00:00:00 2001 From: Christian Fowler Date: Wed, 30 Aug 2006 15:27:06 +0000 Subject: fix majorly busted ORDER BY changes --- BitArticle.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'BitArticle.php') diff --git a/BitArticle.php b/BitArticle.php index 9da0e71..4f97eb7 100644 --- a/BitArticle.php +++ b/BitArticle.php @@ -1,6 +1,6 @@ - * @version $Revision: 1.89 $ $Date: 2006/08/30 14:26:11 $ $Author: hash9 $ + * @version $Revision: 1.90 $ $Date: 2006/08/30 15:27:06 $ $Author: spiderr $ */ /** @@ -597,7 +597,7 @@ class BitArticle extends LibertyAttachable { } if( empty( $pParamHash['sort_mode'] ) ) { - $pParamHash['sort_mode'] = 'publish_date_desc'; + $pParamHash['sort_mode'] = $gBitSystem->isFeatureActive('articles_auto_approve') ? 'order_key_desc' : 'publish_date_desc'; } LibertyContent::prepGetList( $pParamHash ); @@ -669,12 +669,7 @@ class BitArticle extends LibertyAttachable { LEFT OUTER JOIN `".BIT_DB_PREFIX."liberty_attachments` la ON la.`attachment_id` = a.`image_attachment_id` LEFT OUTER JOIN `".BIT_DB_PREFIX."liberty_files` lf ON lf.`file_id` = la.`foreign_id` $joinSql WHERE lc.`content_type_guid` = ? $whereSql - ORDER BY "; - if ($gBitSystem->isFeatureActive('articles_auto_approve')) { - $query .= "order_key DESC"; - } else { - $query .= $this->mDb->convert_sortmode( $pParamHash['sort_mode'] ); - } + ORDER BY ".$this->mDb->convert_sortmode( $pParamHash['sort_mode'] ); $query_cant = "SELECT COUNT( * )FROM `".BIT_DB_PREFIX."articles` a INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON lc.`content_id` = a.`content_id` -- cgit v1.3