fix archive month-view entry counter for future entries
Posted: Sat Oct 23, 2004 12:59 pm
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];
}
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];
}