你看一下在 /class/summary/dao/summarystates.class.php 這一支程式。裡面 getMostReadArticles 這個 function 中的 sql:
$prefix = $this->getPrefix();
$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,
t.article_id as article_id,
t.text as text
FROM {$prefix}articles a, {$prefix}articles_text t, {$prefix}blogs b
WHERE a.id = t.article_id
AND a.status = ".POST_STATUS_PUBLISHED."
AND TO_DAYS(NOW()) - TO_DAYS(date) < 7
AND a.blog_id = b.id AND b.status = ".BLOG_STATUS_ACTIVE;
他是去選
7 天內被閱讀做多次的文章,而不是針對所有的文章去做排序。這應該就是原因了吧!如果你要修改,就修改這一句吧:
AND TO_DAYS(NOW()) - TO_DAYS(date) < 7
不過建議別去動他。因為你要是真的全部文章一起 query, 那是會很慢的,請自行斟酌。
Mark