fix archive month-view entry counter for future entries

Found a bug? Tell us!!
Post Reply
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

fix archive month-view entry counter for future entries

Post by Timbalu »

This might be useful for somebody.
Ian

serendipity_functions.inc.php ~ line 3502

function serendipity_postAmount($year, $month) {
global $serendipity;

$s = mktime(0, 0, 0, $month, 1, $year);
$e = mktime(23, 59, 59, $month, date('t', $s), $year);
- $querystring = "SELECT count(id) FROM {$serendipity['dbPrefix']}entries WHERE isdraft = 'false' AND timestamp >= $s AND timestamp <= $e";
+ $querystring = "SELECT count(id) FROM {$serendipity['dbPrefix']}entries WHERE isdraft = 'false' AND timestamp >= $s AND timestamp <= $e AND timestamp <= " . time() . "";
$query = serendipity_db_query($querystring);

return $query[0][0];
}
tomsommer
Core Developer
Posts: 240
Joined: Tue Sep 02, 2003 6:43 pm
Location: Denmark
Contact:

Post by tomsommer »

This should already be fixed in the latest rc1, no?
Tom Sommer (Serendipity Core Developer)
http://blog.dreamcoder.dk
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Post by Timbalu »

tomsommer wrote:This should already be fixed in the latest rc1, no?
Really? :?
I looked into CVS yesterday and did not find it. Thats why I posted it here.
Is rc1 an extra branch?

Ian
tomsommer
Core Developer
Posts: 240
Joined: Tue Sep 02, 2003 6:43 pm
Location: Denmark
Contact:

Post by tomsommer »

No, I guess it's not there then, will look into it before 0.7
Tom Sommer (Serendipity Core Developer)
http://blog.dreamcoder.dk
Post Reply