[pLog-svn] r3068 - plog/trunk/class/summary/dao

mark at devel.lifetype.net mark at devel.lifetype.net
Mon Mar 13 06:47:02 GMT 2006


Author: mark
Date: 2006-03-13 06:47:01 +0000 (Mon, 13 Mar 2006)
New Revision: 3068

Modified:
   plog/trunk/class/summary/dao/summarystats.class.php
Log:
Fix some DAO errors.

Modified: plog/trunk/class/summary/dao/summarystats.class.php
===================================================================
--- plog/trunk/class/summary/dao/summarystats.class.php	2006-03-13 01:49:21 UTC (rev 3067)
+++ plog/trunk/class/summary/dao/summarystats.class.php	2006-03-13 06:47:01 UTC (rev 3068)
@@ -64,7 +64,7 @@
        				         AND b.id = a.blog_id
        				         AND b.status = ".BLOG_STATUS_ACTIVE."
        				         AND a.date <= ".$this->_now."
-							 AND in_summmary_page = '1'";
+							 AND a.in_summary_page = '1'";
 
 			$query .= " GROUP BY c.article_id ORDER BY total_comments DESC ";
 
@@ -104,15 +104,7 @@
              $prefix = $this->getPrefix();
 			 $articles = new Articles();
 
-             $query = " SELECT 
-                 a.id as id, 
-                 a.properties as properties, 
-                 a.date as date, 
-                 a.user_id as user_id,
-                 a.blog_id as blog_id,
-                 a.status as status,
-                 a.num_reads as num_reads,
-                 a.slug as slug
+             $query = "SELECT a.*
                  FROM {$prefix}articles a, {$prefix}blogs b
                  WHERE a.status = ".POST_STATUS_PUBLISHED."
                  AND a.blog_id = b.id AND b.status = ".BLOG_STATUS_ACTIVE."
@@ -234,16 +226,14 @@
             $date   = $t->getTimestamp();
 			$prefix = $this->getPrefix();
 
-			$query = "SELECT a.id as id, a.id,a.date,
-                             a.user_id,a.blog_id, a.status, a.properties,
-                             a.num_reads, a.slug
+			$query = "SELECT a.*
 					  FROM {$prefix}articles a, 
 					       {$prefix}blogs b
 					  WHERE a.date >= ".$this->_sevenDaysAgo." AND a.date <= ".$this->_now."
 					        AND a.blog_id = b.id
 					        AND b.status = ".BLOG_STATUS_ACTIVE."
 					        AND a.status = ".POST_STATUS_PUBLISHED."
-							AND in_summary_page = '1'";
+							AND a.in_summary_page = '1'";
 
 			$query .= " GROUP BY a.id ORDER BY a.date DESC LIMIT 0, $maxPosts";
             $result = $this->Execute( $query );
@@ -264,10 +254,10 @@
                     $i++;
                 }
             }
-            
+
             $result->Close();            
 
             return $posts;
         }
     }
-?>
+?>
\ No newline at end of file



More information about the pLog-svn mailing list