[pLog-svn] r4571 - plog/branches/lifetype-1.1.5/class/summary/dao
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Wed Jan 24 21:10:38 GMT 2007
Author: oscar
Date: 2007-01-24 21:10:38 +0000 (Wed, 24 Jan 2007)
New Revision: 4571
Modified:
plog/branches/lifetype-1.1.5/class/summary/dao/summarystats.class.php
Log:
Modified: plog/branches/lifetype-1.1.5/class/summary/dao/summarystats.class.php
===================================================================
--- plog/branches/lifetype-1.1.5/class/summary/dao/summarystats.class.php 2007-01-24 20:29:32 UTC (rev 4570)
+++ plog/branches/lifetype-1.1.5/class/summary/dao/summarystats.class.php 2007-01-24 21:10:38 UTC (rev 4571)
@@ -179,16 +179,11 @@
include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
$prefix = $this->getPrefix();
- $query = "SELECT COUNT(a.id) as t, SUM((num_reads / (TO_DAYS(NOW()) - TO_DAYS(a.date) + 1)) ) as rank, b.id AS blog_id
- FROM {$prefix}articles AS a
- INNER JOIN {$prefix}blogs AS b
- ON b.id = a.blog_id AND b.status = ".BLOG_STATUS_ACTIVE."
- WHERE a.date >= ".$this->_startTime." AND a.date <= ".$this->_now."
- AND in_summary_page = '1'
- AND b.show_in_summary = '1'
- GROUP BY a.id
- ORDER BY rank DESC";
-
+ $query = "SELECT num_posts, last_update_date FROM {$prefix}blogs
+ WHERE show_in_summary = '1'
+ AND last_update_date >= ".$this->_startTime." AND last_update_date <= ".$this->_now."
+ ORDER BY last_update_date DESC, num_posts DESC";
+
if( $maxBlogs > 0 )
$query .= " LIMIT 0,".$maxBlogs;
else
More information about the pLog-svn
mailing list