There is an issue with the query for the SamNews index page, if a post hasn’t been made in the INDEX_INTERVAL (default is 5 days) the front page will show “no results.”
I have come up with a better query that addresses this problem. The new query shows all the posts within INDEX_INTERVAL on top, sorted score descending (and next by creation date)– then underneath the rest of the posts are displayed descending by their creation date.
To use the new query, replace the specified lines with the ones below:
index.php, change line 65 to:
$index_count_result = samq_c("SELECT count(post.id) AS index_count FROM post INNER JOIN users ON author = users.id ORDER BY CASE WHEN post.created >= DATE_SUB(NOW(),INTERVAL " . INDEX_INTERVAL . ") THEN post.score END DESC, post.created DESC",1);
index.php, change line 68 to:
$index = samq_c("SELECT post.id, title, users.id AS author_id, slug, url, domain, description, post.comment_count, login, users.voted_count AS user_score, post.score AS post_score, post.created FROM post INNER JOIN users ON author = users.id ORDER BY CASE WHEN post.created >= DATE_SUB(NOW(),INTERVAL " . INDEX_INTERVAL . ") THEN post.score END DESC, post.created DESC LIMIT " . $start . ", " . $end,1);
/cron/gen_rss.php, change line 25 to:
$index = samq_c("SELECT post.id, title, users.id AS author_id, slug, url, domain, description, post.comment_count, login, users.voted_count AS user_score, post.score AS post_score, post.created FROM post INNER JOIN users ON author = users.id ORDER BY CASE WHEN post.created >= DATE_SUB(NOW(),INTERVAL " . INDEX_INTERVAL . ") THEN post.score END DESC, post.created DESC LIMIT 0, " . RSS_DISPLAY,1);
The fix will be included in a future update.