$value) { if((time() - $value['timestamp']) > 300){ unset($connections[$key]); } } file_put_contents($connsa, json_encode($connections)); } } if (!empty($_SESSION["kod"]) && !empty($_SESSION['listeners']) && !empty($_SESSION["inicialyOriginal"])) { $kod = $_SESSION['kod']; $fol = 'streamy/' . $kod . '/'; $chata = $fol . 'chat.txt'; $configa = $fol . 'config.json'; $jsonobj = file_get_contents($configa); $config = json_decode($jsonobj, false); if (file_exists($chata) && $_SESSION["inicialyOriginal"] == $config->adminpwd) { if (!empty($_GET["onlyconns"])){ if (!empty($_SESSION["kod"]) && !empty($_SESSION['listeners']) && !empty($_SESSION['inicialy'])) { $connsa = $fol . 'people.json'; if (file_exists($connsa)) { $connections = json_decode(file_get_contents($connsa), true); $connadm = ' '; foreach($connections as $key => $value) { $connadm = $connadm . '' . '' . '' . '' . ''; } $connadm = $connadm . '
IniciályPočúvajúciDátum a čas pripojeniaDátum a čas keepaliveIP adresa
' . $value["inicialy"] . '' . $value["listeners"] . '' . $value["date"] . '' . $value["dateping"] . '' . $value["ip"] . '
'; echo $connadm; } } } else{ $cnt = 1; $chatdat = explode("\n", file_get_contents($chata)); if (!empty($_GET['delete'])&&!empty($_POST['delete'])){ if($_POST['delete'] == "*"){ file_put_contents($chata, ""); } else{ $chatxx = ""; array_splice($chatdat, $_POST['delete']-1, 1); foreach($chatdat as $line){ if ($line != ""){ $chatxx = $chatxx . $line . "\n"; } } file_put_contents($chata, $chatxx); $chatdat = explode("\n", file_get_contents($chata)); } } else{ $chatadm = ' '; foreach($chatdat as $line){ if ($cnt < sizeof($chatdat)){ $chatadm = $chatadm . ''; } $cnt++; } $chatadm = $chatadm . '
' . $line . '
'; if (!empty($_GET['onlytable'])){ echo $chatadm; } else{ $dats = file_get_contents("templates/admin.html"); $dats = str_replace('__VLOZ_CHAT_ADMIN_TABULKU__', $chatadm , $dats); $dats = str_replace('__VLOZ_URL_AUDIA__', $config->url , $dats); $dats = str_replace('__VLOZ_TYP_AUDIA__', $config->type , $dats); $dats = str_replace('__VLOZ_ROK__', date("Y"), $dats); echo $dats; } } } } else { echo ' '; } } else { echo ' '; } ?>