[pLog-svn] r6826 - plugins/branches/lifetype-1.2/clean/class/dao

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Sat Feb 21 16:15:58 EST 2009


Author: jondaley
Date: 2009-02-21 16:15:58 -0500 (Sat, 21 Feb 2009)
New Revision: 6826

Modified:
   plugins/branches/lifetype-1.2/clean/class/dao/unusedblogs.class.php
Log:
missing a couple spaces and an occasional AND

Modified: plugins/branches/lifetype-1.2/clean/class/dao/unusedblogs.class.php
===================================================================
--- plugins/branches/lifetype-1.2/clean/class/dao/unusedblogs.class.php	2009-02-21 21:05:59 UTC (rev 6825)
+++ plugins/branches/lifetype-1.2/clean/class/dao/unusedblogs.class.php	2009-02-21 21:15:58 UTC (rev 6826)
@@ -37,25 +37,18 @@
 			$where = $lastUpdateCond." AND ".$totalPostLessThanCond;
 			
             if( $status != BLOG_STATUS_ALL )
-                $where .= "status = '".Db::qstr($status)."'";
+                $where .= " AND status = '".Db::qstr($status)."'";
 
 			if( $blogCategoryId != ALL_BLOG_CATEGORIES ) {
-				if( $where != "" ) 
-					$where .= " AND ";
-				$where .= " blog_category_id = '".Db::qstr($blogCategoryId)."'";
+				$where .= " AND blog_category_id = '".Db::qstr($blogCategoryId)."'";
 			}
 
 			if( $searchTerms != "" ){
-                if( $where != "" )
-                    $where .= " AND ";
-				$where .= $this->getSearchConditions( $searchTerms );
+				$where .= " AND " .$this->getSearchConditions( $searchTerms );
             }
 				
-			if( $where != "" )
-				$where = " WHERE $where";			
+            $query = "SELECT * FROM ".$this->getPrefix()."blogs WHERE $where ORDER BY id DESC";
 
-            $query = "SELECT * FROM ".$this->getPrefix()."blogs $where ORDER BY id DESC";
-
             $result = $this->Execute( $query, $page, $itemsPerPage );
 
             if( !$result )
@@ -96,16 +89,14 @@
 			$where = $lastUpdateCond." AND ".$totalPostLessThanCond;
 
              if( $status != BLOG_STATUS_ALL )
-                 $where .= "status = '".Db::qstr($status)."'";
+                 $where .= " AND status = '".Db::qstr($status)."'";
 
 			if( $blogCategoryId != ALL_BLOG_CATEGORIES )
 				$where .= " AND blog_category_id = '".Db::qstr($blogCategoryId)."'";				
 										
 			if( $searchTerms != "" ) {				
 				$searchCond = $this->getSearchConditions( $searchTerms );
-                if( $where != "" )
-                    $where .= " AND";
- 				$where .= " ".$searchCond;
+ 				$where .= " AND " . $searchCond;
             }
 			return( $this->getNumItems( $this->getPrefix()."blogs", $where ));
         }



More information about the pLog-svn mailing list