[pLog-svn] r1901 - plog/branches/plog-1.0.1/class/summary/dao

oscar at devel.plogworld.net oscar at devel.plogworld.net
Sun Apr 24 14:55:07 GMT 2005


Author: oscar
Date: 2005-04-24 14:55:06 +0000 (Sun, 24 Apr 2005)
New Revision: 1901

Modified:
   plog/branches/plog-1.0.1/class/summary/dao/summarystats.class.php
Log:
fixed some issues related to bug report 444.

Modified: plog/branches/plog-1.0.1/class/summary/dao/summarystats.class.php
===================================================================
--- plog/branches/plog-1.0.1/class/summary/dao/summarystats.class.php	2005-04-22 15:41:23 UTC (rev 1900)
+++ plog/branches/plog-1.0.1/class/summary/dao/summarystats.class.php	2005-04-24 14:55:06 UTC (rev 1901)
@@ -34,12 +34,11 @@
          * Returns the most commented articles so far
          *
          * @param maxPosts The maximum number of posts to return
-		 * @param date
 		 * @param ignoreTopic ignore posts based on a certain topic
 		 * @param ignoreText ignore post based on a certain text
          * @return An array of Article objects with the most commented articles
          */
-        function getMostCommentedArticles( $maxPosts = 0, $ignoreTopic = "", $ignoreText = "" ,$date = 0)
+        function getMostCommentedArticles( $maxPosts = 0, $ignoreTopic = "", $ignoreText = "" )
         {
 			$prefix = $this->getPrefix();
 			$query = " SELECT COUNT(*) as total_comments, a.* 
@@ -92,7 +91,7 @@
          * @return an array of Article objects with information about the posts
          * TODO: perfalmence tuning
          */
-        function getMostReadArticles( $maxPosts = 0, $ignoreTopic = "", $ignoreText = "", $date = 0 )
+        function getMostReadArticles( $maxPosts = 0, $ignoreTopic = "", $ignoreText = "" )
         {
             $prefix = $this->getPrefix();
 					$query = " SELECT 
@@ -174,11 +173,10 @@
          * returns an array with the most active blogs
          *
          * @param maxBlogs How many blogs to return
-         * @param date
          * @return An array of BlogInfo objects
          * @see BlogInfo
          */
-         function getMostActiveBlogs($maxBlogs = 0, $date = 0)
+         function getMostActiveBlogs( $maxBlogs = 0 )
          {
 			$prefix = $this->getPrefix();
             $query = "SELECT COUNT(*) as t, SUM((num_reads / (TO_DAYS(NOW()) - TO_DAYS(a.date) + 1)) ) as rank, b.*
@@ -255,8 +253,6 @@
          */
         function getRecentArticles( $maxPosts, $ignoreTopic = "", $ignoreText = "" )
         {
-            $t      = new Timestamp();
-            $date   = $t->getTimestamp();
 			$prefix = $this->getPrefix();
 
 			$query = "SELECT a.id as id, a.id,t.topic,t.text,a.date,
@@ -334,18 +330,19 @@
             $posts = Array();
             $count = 0;
             $ids   = array();
-
+            $articles = new Articles();
+            
             while( $row = $result->FetchRow()) {
 
                 if (empty($maxPosts))
                 {
-                    array_push( $posts, $this->_fillArticleInformation($row));
+                    array_push( $posts, $articles->_fillArticleInformation($row));
                     $count++;
                 }
                 else if($count <= $maxPosts && empty($ids[$row["blog_id"]]))
                 {
                     $ids[$row["blog_id"]] = true;
-                    array_push( $posts, $this->_fillArticleInformation($row));
+                    array_push( $posts, $articles->_fillArticleInformation($row));
                     $count++;
                 }
             }




More information about the pLog-svn mailing list