[pLog-svn] r3005 - plugins/trunk/moderate/class/dao

oscar at devel.lifetype.net oscar at devel.lifetype.net
Thu Mar 2 19:29:25 GMT 2006


Author: oscar
Date: 2006-03-02 19:29:25 +0000 (Thu, 02 Mar 2006)
New Revision: 3005

Modified:
   plugins/trunk/moderate/class/dao/unmoderatedcomments.class.php
Log:
the query to load unmoderated comments can be simplified now because there is not need to join with plog_articles
anymore!


Modified: plugins/trunk/moderate/class/dao/unmoderatedcomments.class.php
===================================================================
--- plugins/trunk/moderate/class/dao/unmoderatedcomments.class.php	2006-03-02 18:03:02 UTC (rev 3004)
+++ plugins/trunk/moderate/class/dao/unmoderatedcomments.class.php	2006-03-02 19:29:25 UTC (rev 3005)
@@ -19,13 +19,9 @@
 		function getUnmoderatedComments( $blogId )
 		{
 			$prefix = $this->getPrefix();
-			$query = "SELECT c.id AS id, c.article_id AS article_id, c.topic AS topic, c.text AS text,
-			                 c.date AS date, c.user_email AS user_email, c.user_url AS user_url,
-							 c.parent_id AS parent_id, c.client_ip AS client_ip,
-							 c.send_notification AS send_notification, c.status AS status,
-							 c.spam_rate AS spam_rate
-			          FROM {$prefix}articles_comments c, {$prefix}articles a
-					  WHERE a.blog_id = $blogId AND c.article_id = a.id AND c.status = ".COMMENT_STATUS_UNMODERATED."
+			$query = "SELECT *
+			          FROM {$prefix}articles_comments
+					  WHERE blog_id = $blogId AND status = ".COMMENT_STATUS_UNMODERATED."
 					  ORDER BY date ASC";
 					  
 			$result = $this->Execute( $query );
@@ -37,7 +33,7 @@
 			// or else, loop through the array
 			$comments = Array();
 			while( $row = $result->FetchRow()) {
-				array_push( $comments, $this->_fillCommentInformation( $row ));
+				array_push( $comments, $this->mapRow( $row ));
 			}
 			
 			return $comments;



More information about the pLog-svn mailing list