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] = []; }