OSDN Git Service

BugTrack2/141 Fix: counter plugin fails for yesterday on PHP5.1+
authorumorigu <umorigu@gmail.com>
Sun, 17 Jan 2016 13:33:30 +0000 (22:33 +0900)
committerumorigu <umorigu@gmail.com>
Sun, 17 Jan 2016 13:49:25 +0000 (22:49 +0900)
plugin/counter.inc.php

index 51b5c33..db572a1 100644 (file)
@@ -88,7 +88,7 @@ function plugin_counter_get_count($page)
        // Anothoer day?
        if ($counters[$page]['date'] != $default['date']) {
                $modify = TRUE;
-               $is_yesterday = ($counters[$page]['date'] == get_date('Y/m/d', strtotime('yesterday', UTIME)));
+               $is_yesterday = ($counters[$page]['date'] == get_date('Y/m/d', UTIME - 24 * 60 * 60));
                $counters[$page]['ip']        = $_SERVER['REMOTE_ADDR'];
                $counters[$page]['date']      = $default['date'];
                $counters[$page]['yesterday'] = $is_yesterday ? $counters[$page]['today'] : 0;
@@ -116,4 +116,3 @@ function plugin_counter_get_count($page)
 
        return $counters[$page];
 }
-?>