From 34f769b892c92bdcf4ab3032d7a8ff0d0676bd50 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Tue, 4 Mar 2008 09:44:11 +0000 Subject: [PATCH] Fix by roti --- .../serendipity_plugin_statistics.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/serendipity_event_statistics/serendipity_plugin_statistics.php b/plugins/serendipity_event_statistics/serendipity_plugin_statistics.php index e6e56997..02d0f09b 100644 --- a/plugins/serendipity_event_statistics/serendipity_plugin_statistics.php +++ b/plugins/serendipity_event_statistics/serendipity_plugin_statistics.php @@ -190,9 +190,14 @@ class serendipity_plugin_statistics extends serendipity_plugin if (!file_exists($cachef) || filesize($cachef) == 0 || filemtime($cachef) < (time() - $cachetime)) { // Create statistics - list($year, $month, $day) = split('-', date('Y-m-d')); - $lastmonday = date('Ymd', strtotime('last monday')); - $nextsunday = date('Ymd', strtotime('next sunday')); + list($year, $month, $day) = split('-', date('Y-m-d')); + $lastmonday = date('Ymd', strtotime('last monday')); + $nextsunday = date('Ymd', strtotime('next sunday')); + if (date('w', strtotime('today') ) == "1" ) { // now it is monday + $lastmonday = date('Ymd', strtotime('today')); + } else if (date('w', strtotime('today') ) == "0" ) { // now it is sunday + $nextsunday = date('Ymd', strtotime('today')); + } $content = ''; if (serendipity_db_bool($this->get_config('show_lastentry'))) {