Compare commits
13 Commits
18360eb63e
...
main
Author | SHA1 | Date | |
---|---|---|---|
d07d6d6a63 | |||
71c414c51a | |||
2d311b17da | |||
b4069885ae | |||
9d2cb3c11e | |||
826147e3f7 | |||
5038381b65 | |||
a915dd7efb | |||
b6956ea654 | |||
fbb743a810 | |||
b6dbc2ad5a | |||
a91bd6a9a7 | |||
ac03be16c3 |
34
index.php
34
index.php
@@ -17,7 +17,7 @@ foreach ($headers as $header => $value) {
|
|||||||
function languageSelector(){
|
function languageSelector(){
|
||||||
$lang_dir = "templates/locale";
|
$lang_dir = "templates/locale";
|
||||||
$langs = scandir($lang_dir);
|
$langs = scandir($lang_dir);
|
||||||
$langSelectDat = '<div id="langselect"><select>';
|
$langSelectDat = '<div id="langselect"><label for="langselector">Language/Jazyk:</label><select id="langselector">\n';
|
||||||
foreach($langs as $lang){
|
foreach($langs as $lang){
|
||||||
if (str_contains($lang, ".json")){
|
if (str_contains($lang, ".json")){
|
||||||
$parsedLang = json_decode(file_get_contents($lang_dir . '/' . $lang), true);
|
$parsedLang = json_decode(file_get_contents($lang_dir . '/' . $lang), true);
|
||||||
@@ -36,7 +36,13 @@ function languageSelector(){
|
|||||||
}
|
}
|
||||||
function localize($input_string){
|
function localize($input_string){
|
||||||
if (empty($_SESSION['language'])){
|
if (empty($_SESSION['language'])){
|
||||||
$_SESSION['language'] = "en";
|
if (empty($_COOKIE['language'])){
|
||||||
|
$_SESSION['language'] = "en";
|
||||||
|
setcookie("language", $_SESSION['language'], 2147483647);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$_SESSION['language'] = $_COOKIE['language'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$language = htmlspecialchars($_SESSION['language']) ;
|
$language = htmlspecialchars($_SESSION['language']) ;
|
||||||
$lang_dir = "templates/locale";
|
$lang_dir = "templates/locale";
|
||||||
@@ -48,6 +54,12 @@ function localize($input_string){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!file_exists($lang_file)){
|
||||||
|
$_SESSION['language'] = "en";
|
||||||
|
setcookie("language", $_SESSION['language'], 2147483647);
|
||||||
|
$lang_file = $lang_dir . '/' . $lang;
|
||||||
|
}
|
||||||
|
|
||||||
if (file_exists($lang_file)){
|
if (file_exists($lang_file)){
|
||||||
$language_obj = json_decode(file_get_contents($lang_file), true);
|
$language_obj = json_decode(file_get_contents($lang_file), true);
|
||||||
$tempStr = str_replace("__VLOZ_ROK__", date("Y"), $input_string);
|
$tempStr = str_replace("__VLOZ_ROK__", date("Y"), $input_string);
|
||||||
@@ -79,12 +91,18 @@ function connectionAdminTable($idcko){
|
|||||||
<tr><th>__LOCALIZATION_LOGIN_INITIALS_LABEL__</th><th>__LOCALIZATION_LOGIN_LISTENERS_LABEL__</th><th>__LOCALIZATION_CONNECTIONS_DATETIME_CONNECT_ADMIN__</th><th>__LOCALIZATION_CONNECTIONS_DATETIME_PING_ADMIN__</th><th>__LOCALIZATION_CONNECTIONS_IP_ADMIN__</th></tr>
|
<tr><th>__LOCALIZATION_LOGIN_INITIALS_LABEL__</th><th>__LOCALIZATION_LOGIN_LISTENERS_LABEL__</th><th>__LOCALIZATION_CONNECTIONS_DATETIME_CONNECT_ADMIN__</th><th>__LOCALIZATION_CONNECTIONS_DATETIME_PING_ADMIN__</th><th>__LOCALIZATION_CONNECTIONS_IP_ADMIN__</th></tr>
|
||||||
';
|
';
|
||||||
if ($stmt3->num_rows > 0){
|
if ($stmt3->num_rows > 0){
|
||||||
|
$listenersall = 0;
|
||||||
|
$connctionsall = 0;
|
||||||
while ($stmt3->fetch())
|
while ($stmt3->fetch())
|
||||||
{
|
{
|
||||||
$connadm = $connadm . '<tr><td>' . $inicialy . '</td>' . '<td>' . $listeners . '</td>' . '<td>' . $timeConn . '</td>' . '<td>' . $timePing . '</td>' . '<td>' . $IP . '</td></tr>';
|
$connadm = $connadm . '<tr><td>' . $inicialy . '</td>' . '<td>' . $listeners . '</td>' . '<td>' . $timeConn . '</td>' . '<td>' . $timePing . '</td>' . '<td>' . $IP . '</td></tr>';
|
||||||
|
$listenersall += intval($listeners);
|
||||||
|
$connctionsall += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$connadm = $connadm . '</table>';
|
$connadm = $connadm . '</table>';
|
||||||
|
$connadm = $connadm . "<p>__LOCALIZATION_ALL_CONNECTIONS__" . strval($connctionsall) . "</p>\n";
|
||||||
|
$connadm = $connadm . "<p>__LOCALIZATION_ALL_LISTENERS__" . strval($listenersall) . "</p>\n";
|
||||||
$localized = localize($connadm);
|
$localized = localize($connadm);
|
||||||
return $localized;
|
return $localized;
|
||||||
}
|
}
|
||||||
@@ -131,6 +149,7 @@ if (!empty($_GET['setLang'])){
|
|||||||
if ($lang == $language . '.json'){
|
if ($lang == $language . '.json'){
|
||||||
$lang2 = str_replace(".json", "", $lang);
|
$lang2 = str_replace(".json", "", $lang);
|
||||||
$_SESSION['language'] = htmlspecialchars($lang2);
|
$_SESSION['language'] = htmlspecialchars($lang2);
|
||||||
|
setcookie("language", $_SESSION['language'], 2147483647);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit();
|
exit();
|
||||||
@@ -147,7 +166,8 @@ if (!empty($_GET['keepalive'])){
|
|||||||
while($stmt6->fetch()){
|
while($stmt6->fetch()){
|
||||||
$stmt7 = $mysqli->prepare("UPDATE Connections SET TimestampPing=CURRENT_TIMESTAMP, TimePing = ? WHERE PHPSessID = ?;");
|
$stmt7 = $mysqli->prepare("UPDATE Connections SET TimestampPing=CURRENT_TIMESTAMP, TimePing = ? WHERE PHPSessID = ?;");
|
||||||
$currsessid = session_id();
|
$currsessid = session_id();
|
||||||
$stmt7->bind_param("ss", date("Y.n.d H:i:s"), $currsessid);
|
$curdate = date("Y.n.d H:i:s");
|
||||||
|
$stmt7->bind_param("ss", $curdate, $currsessid);
|
||||||
$stmt7->execute();
|
$stmt7->execute();
|
||||||
$stmt7->store_result();
|
$stmt7->store_result();
|
||||||
}
|
}
|
||||||
@@ -272,12 +292,14 @@ if (!empty($_POST['kod']) && !empty($_POST['listeners']) && !empty($_POST['ini']
|
|||||||
$_SESSION['inicialy'] = htmlspecialchars($inicialy);
|
$_SESSION['inicialy'] = htmlspecialchars($inicialy);
|
||||||
if (empty($_SESSION['language'])){
|
if (empty($_SESSION['language'])){
|
||||||
$_SESSION['language'] = "en";
|
$_SESSION['language'] = "en";
|
||||||
|
setcookie("language", $_SESSION['language'], 2147483647);
|
||||||
}
|
}
|
||||||
setcookie("inicialy", $inicialy);
|
setcookie("inicialy", $inicialy);
|
||||||
|
|
||||||
$stmt12 = $mysqli->prepare("INSERT INTO Connections (PHPSessID, TimeConnect, TimestampPing, TimePing, Listeners, Inicialy, IP, StreamID) VALUES (?, ?, CURRENT_TIMESTAMP, ?, ?, ?, ?, ?);");
|
$stmt12 = $mysqli->prepare("INSERT INTO Connections (PHPSessID, TimeConnect, TimestampPing, TimePing, Listeners, Inicialy, IP, StreamID) VALUES (?, ?, CURRENT_TIMESTAMP, ?, ?, ?, ?, ?);");
|
||||||
$currsessid = session_id();
|
$currsessid = session_id();
|
||||||
$stmt12->bind_param('sssissi', $currsessid, date("Y.n.d H:i:s"), date("Y.n.d H:i:s"), $listeners, $inicialy, $ipcka, $idcko);
|
$curdate = date("Y.n.d H:i:s");
|
||||||
|
$stmt12->bind_param('sssissi', $currsessid, $curdate, $curdate, $listeners, $inicialy, $ipcka, $idcko);
|
||||||
$stmt12->execute();
|
$stmt12->execute();
|
||||||
$stmt12->store_result();
|
$stmt12->store_result();
|
||||||
|
|
||||||
@@ -352,11 +374,12 @@ if (!empty($_GET["admin"])){
|
|||||||
while ($stmt->fetch())
|
while ($stmt->fetch())
|
||||||
{
|
{
|
||||||
if (!empty($_GET['deletechatmsg'])&&!empty($_POST['deletechatmsg'])){
|
if (!empty($_GET['deletechatmsg'])&&!empty($_POST['deletechatmsg'])){
|
||||||
if(htmlspecialchars($_POST['deletechatmsg']) == "*"){
|
if($_POST['deletechatmsg'] == "*"){
|
||||||
$stmt5 = $mysqli->prepare("DELETE from Chat WHERE StreamID = ?;");
|
$stmt5 = $mysqli->prepare("DELETE from Chat WHERE StreamID = ?;");
|
||||||
$stmt5->bind_param('i', $idcko);
|
$stmt5->bind_param('i', $idcko);
|
||||||
$stmt5->execute();
|
$stmt5->execute();
|
||||||
$stmt5->store_result();
|
$stmt5->store_result();
|
||||||
|
exit();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$deleteid = intval(htmlspecialchars($_POST['deletechatmsg']));
|
$deleteid = intval(htmlspecialchars($_POST['deletechatmsg']));
|
||||||
@@ -365,6 +388,7 @@ if (!empty($_GET["admin"])){
|
|||||||
$stmt6->bind_param('ii', $idcko, $deleteid);
|
$stmt6->bind_param('ii', $idcko, $deleteid);
|
||||||
$stmt6->execute();
|
$stmt6->execute();
|
||||||
$stmt6->store_result();
|
$stmt6->store_result();
|
||||||
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,13 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html data-theme="dark">
|
<html data-theme="dark">
|
||||||
<head>
|
<head>
|
||||||
|
<script data-website-id="ec75bcbd-29d7-471c-a1a8-c20cb688f2b6" src="https://umami.brn.systems/script.js"></script>
|
||||||
<script src=assets/jquery.js> </script>
|
<script src=assets/jquery.js> </script>
|
||||||
<script>
|
<script>
|
||||||
__LOCALIZATION_LANGSELECT_SCRIPT__
|
__LOCALIZATION_LANGSELECT_SCRIPT__
|
||||||
function deleteit(indexik){
|
function deleteit(indexik){
|
||||||
$.post("index.php?admin=1&delete=1",
|
$.post("index.php?admin=1&deletechatmsg=1",
|
||||||
{
|
{
|
||||||
delete: indexik
|
deletechatmsg: indexik
|
||||||
},
|
},
|
||||||
function(data, status){
|
function(data, status){
|
||||||
updateTable();
|
updateTable();
|
||||||
@@ -34,6 +35,9 @@
|
|||||||
$("#send").click(function(){
|
$("#send").click(function(){
|
||||||
data = $("#ins").val();
|
data = $("#ins").val();
|
||||||
if(data != ""){
|
if(data != ""){
|
||||||
|
try{
|
||||||
|
umami.trackEvent('Admin send chat message', { type: 'chatadminmessage', code: kod});
|
||||||
|
} catch(e) {}
|
||||||
$.post("index.php?chat=1&send=1",
|
$.post("index.php?chat=1&send=1",
|
||||||
{
|
{
|
||||||
text: data
|
text: data
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"__LOCALIZATION_LANG_SHORT": "en",
|
"__LOCALIZATION_LANG_SHORT": "en",
|
||||||
"__LOCALIZATION_LANG_LONG": "English",
|
"__LOCALIZATION_LANG_LONG": "English",
|
||||||
|
"__LOCALIZATION_LANG_LABEL": "Language",
|
||||||
|
|
||||||
|
|
||||||
"__LOCALIZATION_LOGOUT__": "Log out",
|
"__LOCALIZATION_LOGOUT__": "Log out",
|
||||||
@@ -35,6 +36,8 @@
|
|||||||
"__LOCALIZATION_CONNECTIONS_DATETIME_CONNECT_ADMIN__": "Date and time of connection",
|
"__LOCALIZATION_CONNECTIONS_DATETIME_CONNECT_ADMIN__": "Date and time of connection",
|
||||||
"__LOCALIZATION_CONNECTIONS_DATETIME_PING_ADMIN__": "Date and time of keepalive",
|
"__LOCALIZATION_CONNECTIONS_DATETIME_PING_ADMIN__": "Date and time of keepalive",
|
||||||
"__LOCALIZATION_CONNECTIONS_IP_ADMIN__": "IP address",
|
"__LOCALIZATION_CONNECTIONS_IP_ADMIN__": "IP address",
|
||||||
|
"__LOCALIZATION_ALL_CONNECTIONS__": "Total number of connections:",
|
||||||
|
"__LOCALIZATION_ALL_LISTENERS__": "Total number of listeners",
|
||||||
|
|
||||||
"__LOCALIZATION_ADDER_ADDRESS_LABEL__": "Audio address:",
|
"__LOCALIZATION_ADDER_ADDRESS_LABEL__": "Audio address:",
|
||||||
"__LOCALIZATION_ADDER_TYPE_LABEL__": "Audio type:",
|
"__LOCALIZATION_ADDER_TYPE_LABEL__": "Audio type:",
|
||||||
|
@@ -1,12 +1,13 @@
|
|||||||
{
|
{
|
||||||
"__LOCALIZATION_LANG_SHORT": "sk",
|
"__LOCALIZATION_LANG_SHORT": "sk",
|
||||||
"__LOCALIZATION_LANG_LONG": "Slovenčina",
|
"__LOCALIZATION_LANG_LONG": "Slovenčina",
|
||||||
|
"__LOCALIZATION_LANG_LABEL": "Jazyk",
|
||||||
|
|
||||||
|
|
||||||
"__LOCALIZATION_LOGOUT__": "Odhlásiť sa",
|
"__LOCALIZATION_LOGOUT__": "Odhlásiť sa",
|
||||||
|
|
||||||
|
|
||||||
"__LOCALIZATION_PLAYLIST_DOWNLOAD__": "Stiahnunť playlist",
|
"__LOCALIZATION_PLAYLIST_DOWNLOAD__": "Stiahnuť playlist",
|
||||||
"__LOCALIZATION_PLAYER_TITLE__": "Streaming",
|
"__LOCALIZATION_PLAYER_TITLE__": "Streaming",
|
||||||
"__LOCALIZATION_CHAT_SENDING__": "Odosielam",
|
"__LOCALIZATION_CHAT_SENDING__": "Odosielam",
|
||||||
"__LOCALIZATION_CHAT_SEND__": "Odoslať",
|
"__LOCALIZATION_CHAT_SEND__": "Odoslať",
|
||||||
@@ -35,6 +36,8 @@
|
|||||||
"__LOCALIZATION_CONNECTIONS_DATETIME_CONNECT_ADMIN__": "Dátum a čas pripojenia",
|
"__LOCALIZATION_CONNECTIONS_DATETIME_CONNECT_ADMIN__": "Dátum a čas pripojenia",
|
||||||
"__LOCALIZATION_CONNECTIONS_DATETIME_PING_ADMIN__": "Dátum a čas keepalive",
|
"__LOCALIZATION_CONNECTIONS_DATETIME_PING_ADMIN__": "Dátum a čas keepalive",
|
||||||
"__LOCALIZATION_CONNECTIONS_IP_ADMIN__": "IP adresa",
|
"__LOCALIZATION_CONNECTIONS_IP_ADMIN__": "IP adresa",
|
||||||
|
"__LOCALIZATION_ALL_CONNECTIONS__": "Súčet pripojení:",
|
||||||
|
"__LOCALIZATION_ALL_LISTENERS__": "Súčet poslucháčov:",
|
||||||
|
|
||||||
"__LOCALIZATION_ADDER_ADDRESS_LABEL__": "Adresa zvuku:",
|
"__LOCALIZATION_ADDER_ADDRESS_LABEL__": "Adresa zvuku:",
|
||||||
"__LOCALIZATION_ADDER_TYPE_LABEL__": "Typ zvuku:",
|
"__LOCALIZATION_ADDER_TYPE_LABEL__": "Typ zvuku:",
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>__LOCALIZATION_LOGIN_TITLE__</title>
|
<title>__LOCALIZATION_LOGIN_TITLE__</title>
|
||||||
<link rel="stylesheet" href="assets/pico.css">
|
<link rel="stylesheet" href="assets/pico.css">
|
||||||
|
<script data-website-id="ec75bcbd-29d7-471c-a1a8-c20cb688f2b6" src="https://umami.brn.systems/script.js"></script>
|
||||||
<meta charset="utf-8"></meta>
|
<meta charset="utf-8"></meta>
|
||||||
<script src="assets/jquery.js"></script>
|
<script src="assets/jquery.js"></script>
|
||||||
<style>
|
<style>
|
||||||
@@ -30,6 +31,9 @@
|
|||||||
},
|
},
|
||||||
function(data, status){
|
function(data, status){
|
||||||
if (data == "verified"){
|
if (data == "verified"){
|
||||||
|
try{
|
||||||
|
umami.trackEvent('Good code', { type: 'goodcode', code: kod });
|
||||||
|
} catch(e) {}
|
||||||
$("#firstQuestion").fadeOut("slow", function(){
|
$("#firstQuestion").fadeOut("slow", function(){
|
||||||
$("#secondQuestion").fadeIn("slow", function(){
|
$("#secondQuestion").fadeIn("slow", function(){
|
||||||
$("#ini").focus();
|
$("#ini").focus();
|
||||||
@@ -49,11 +53,17 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
try{
|
||||||
|
umami.trackEvent('Bad code', { type: 'badcode', code: kod });
|
||||||
|
} catch(e) {}
|
||||||
$("#error").fadeIn();
|
$("#error").fadeIn();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$("#back").click(function() {
|
$("#back").click(function() {
|
||||||
|
try{
|
||||||
|
umami.trackEvent('Back button', { type: 'loginback' });
|
||||||
|
} catch(e) {}
|
||||||
$("#secondQuestion").fadeOut("slow", function(){
|
$("#secondQuestion").fadeOut("slow", function(){
|
||||||
$("#firstQuestion").fadeIn("slow", function(){
|
$("#firstQuestion").fadeIn("slow", function(){
|
||||||
$("#kod").focus();
|
$("#kod").focus();
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html data-theme="dark">
|
<html data-theme="dark">
|
||||||
<head>
|
<head>
|
||||||
|
<script data-website-id="ec75bcbd-29d7-471c-a1a8-c20cb688f2b6" src="https://umami.brn.systems/script.js"></script>
|
||||||
<script src=assets/jquery.js> </script>
|
<script src=assets/jquery.js> </script>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<link rel="stylesheet" href="assets/pico.css">
|
<link rel="stylesheet" href="assets/pico.css">
|
||||||
@@ -45,6 +46,9 @@
|
|||||||
data = $("#ins").val();
|
data = $("#ins").val();
|
||||||
Getc();
|
Getc();
|
||||||
if(data != ""){
|
if(data != ""){
|
||||||
|
try{
|
||||||
|
umami.trackEvent('Send chat message', { type: 'chatmessage', code: kod});
|
||||||
|
} catch(e) {}
|
||||||
$.post("index.php?chat=1&send=1",
|
$.post("index.php?chat=1&send=1",
|
||||||
{
|
{
|
||||||
text: data
|
text: data
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
<script>
|
<script>
|
||||||
window.location.href = "index.php";
|
window.location.href = "index.php";
|
||||||
</script>
|
</script>
|
||||||
|
<script data-website-id="ec75bcbd-29d7-471c-a1a8-c20cb688f2b6" src="https://umami.brn.systems/script.js"></script>
|
@@ -1,3 +1,4 @@
|
|||||||
<script>
|
<script>
|
||||||
location.reload();
|
location.reload();
|
||||||
</script>
|
</script>
|
||||||
|
<script data-website-id="ec75bcbd-29d7-471c-a1a8-c20cb688f2b6" src="https://umami.brn.systems/script.js"></script>
|
@@ -1,6 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html data-theme="dark">
|
<html data-theme="dark">
|
||||||
<head>
|
<head>
|
||||||
|
<script data-website-id="ec75bcbd-29d7-471c-a1a8-c20cb688f2b6" src="https://umami.brn.systems/script.js"></script>
|
||||||
<script src=assets/jquery.js> </script>
|
<script src=assets/jquery.js> </script>
|
||||||
<script>
|
<script>
|
||||||
__LOCALIZATION_LANGSELECT_SCRIPT__
|
__LOCALIZATION_LANGSELECT_SCRIPT__
|
||||||
|
Reference in New Issue
Block a user