diff --git a/lang/en_us.php b/lang/en_us.php index e7ce563..af88690 100644 --- a/lang/en_us.php +++ b/lang/en_us.php @@ -65,5 +65,11 @@ define("STRINGS", [ "title" => "Title", "page id" => "Page ID (slug)", "add page" => "Add page", - "page settings" => "Page Settings" + "page settings" => "Page Settings", + "today" => "Today", + "this week" => "This Week", + "visit" => "visit", + "visits" => "visits", + "page view" => "page view", + "page views" => "page views", ]); \ No newline at end of file diff --git a/lib/gatheranalytics.php b/lib/gatheranalytics.php index 5c6ce10..2ffb5c7 100644 --- a/lib/gatheranalytics.php +++ b/lib/gatheranalytics.php @@ -8,7 +8,7 @@ use GeoIp2\Database\Reader; -$_SERVER['REMOTE_ADDR'] = "206.127.96.82"; +//$_SERVER['REMOTE_ADDR'] = "206.127.96.82"; try { diff --git a/pages/home.php b/pages/home.php index 1d44fbf..965fe02 100644 --- a/pages/home.php +++ b/pages/home.php @@ -2,5 +2,70 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +require_once __DIR__ . '/../required.php'; + +redirectifnotloggedin(); ?> -

Hello World

\ No newline at end of file +
+ select('analytics', "uuid", ["time[>]" => date("Y-m-d H:i:s", strtotime("-1 day"))]); + $uuids = []; + foreach ($visitors as $v) { + if (!in_array($v, $uuids)) { + $uuids[] = $v; + } + } + $visits_today = count($uuids); + $views_today = count($visitors); + ?> +
+
+

+

+

+
+
+ select('analytics', "uuid", ["time[>]" => date("Y-m-d H:i:s", strtotime("-1 week"))]); + $uuids = []; + foreach ($visitors as $v) { + if (!in_array($v, $uuids)) { + $uuids[] = $v; + } + } + $visits_week = count($uuids); + $views_week = count($visitors); + ?> +
text-light"> +
+

+

+

+
+
+