From 529839bfa8bb110a9bdeea0ad986f90200fbd368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Fri, 9 Jun 2023 21:53:18 +0200 Subject: [PATCH] fix --- index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index f07ef86..a0f845d 100644 --- a/index.php +++ b/index.php @@ -10,6 +10,10 @@ if (!empty($idcko)){ $contents = json_decode(file_get_contents("data/contents.json"), true); $logs = json_decode(file_get_contents("data/logs.json"), true); + if(!file_exists("data/logs.json")){ + file_put_contents("data/logs.json", "{}"); + } + $alllog = "data/all.log"; if(array_key_exists($idcko, $stranky)){ @@ -17,7 +21,7 @@ if (!empty($idcko)){ $entry = $stranky[$idcko]; $content = $contents[$entry["contentid"]]; $nickname = $entry["nickname"]; - $logmessage = "Success from $linkname, IP: $ipcka\n"; + $logmessage = "Success from $nickname($idcko), IP: $ipcka\n"; if (!array_key_exists($idcko, $logs)){ $logs[$idcko] = []; }