183,184c183,184
< $lastmonday = date('Ymd', strtotime('last monday'));
< $nextsunday = date('Ymd', strtotime('next sunday'));
---
> $lastmonday = date('Ynj', strtotime('last monday'));
> $nextsunday = date('Ynj', strtotime('next sunday'));
186c186
< $lastmonday = date('Ymd', strtotime('today'));
---
> $lastmonday = date('Ynj', strtotime('today'));
188c188
< $nextsunday = date('Ymd', strtotime('today'));
---
> $nextsunday = date('Ynj', strtotime('today'));
220,226d219
< if (serendipity_db_bool($this->get_config('show_dayvisitors'))) {
< $res = serendipity_db_query("SELECT sum(visits) AS dayvisitors FROM {$serendipity['dbPrefix']}visitors_count WHERE year='".$year."' AND month='".$month."' AND day='".$day."'", true, 'assoc');
< if (is_array($res) && isset($res['dayvisitors'])) {
< $content .= '
' . sprintf($this->get_config('text_dayvisitors'), '' . $res['dayvisitors'] . '') . "
\n";
< }
< }
<
233a227,233
> if (serendipity_db_bool($this->get_config('show_dayvisitors'))) {
> $res = serendipity_db_query("SELECT sum(visits) AS dayvisitors FROM {$serendipity['dbPrefix']}visitors_count WHERE year='".$year."' AND month='".$month."' AND day='".$day."'", true, 'assoc');
> if (is_array($res) && isset($res['dayvisitors'])) {
> $content .= '' . sprintf($this->get_config('text_dayvisitors'), '' . $res['dayvisitors'] . '') . "
\n";
> }
> }
>
246c246
< $q = "SELECT count(counter_id) AS currentvisitors FROM {$serendipity['dbPrefix']}visitors WHERE day LIKE '" . date('Y-m-d') . "' AND (REPLACE(time, ':', '') BETWEEN $min_ts AND $max_ts)";
---
> $q = "SELECT count(counter_id) AS currentvisitors FROM {$serendipity['dbPrefix']}visitors WHERE day LIKE '" . date('Y-m-d') . "' AND (REPLACE(time, ':', '') BETWEEN CAST($min_ts AS text) AND CAST($max_ts AS text))";