[pLog-svn] r2295 - plog/branches/plog-1.0.2/class/dao

jondaley at devel.plogworld.net jondaley at devel.plogworld.net
Sat Jul 9 13:55:39 GMT 2005


Author: jondaley
Date: 2005-07-09 13:55:38 +0000 (Sat, 09 Jul 2005)
New Revision: 2295

Modified:
   plog/branches/plog-1.0.2/class/dao/articles.class.php
Log:
buildWhere was doing the wrong thing when blogId was equal to -1.  Is there a better solution than this?  This way makes it easier for the following lines, as they can always prepend 'AND' to their query.  I don't know if this makes mysql slower?

Modified: plog/branches/plog-1.0.2/class/dao/articles.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/dao/articles.class.php	2005-07-08 13:46:29 UTC (rev 2294)
+++ plog/branches/plog-1.0.2/class/dao/articles.class.php	2005-07-09 13:55:38 UTC (rev 2295)
@@ -256,7 +256,12 @@
 		{
             $postStatus = $status;
 		    $prefix = $this->getPrefix();
-		    $query = "a.blog_id = ".Db::qstr($blogid);
+            if($blogid == -1){
+                $query = "a.blog_id = a.blog_id";
+            }
+            else{
+                $query = "a.blog_id = ".Db::qstr($blogid);
+            }
             if( $date != -1 ) {
 				// consider the time difference
     	        $blogSettings = $this->blogs->getBlogSettings( $blogid );




More information about the pLog-svn mailing list