From 345583741e80bda91b567cd7b577374ef026b392 Mon Sep 17 00:00:00 2001 From: Sebi94nbg Date: Sun, 9 Jul 2023 17:10:42 +0200 Subject: [PATCH] Issue 701: Add stats for Internet Protocol version - Adds a new database column - Updates the SQL statements to save the new information in the database - Adds a new donut graph for "IPv4 vs IPv6" --- install.php | 5 +++-- jobs/check_db.php | 8 +++++++- jobs/event_userenter.php | 13 ++++++++----- ...0\271\330\261\330\250\331\212\330\251_arab.php" | 3 ++- "languages/core_az_Az\311\231rbaycan_az.php" | 3 ++- "languages/core_cz_\304\214e\305\241tina_cz.php" | 3 ++- languages/core_de_Deutsch_de.php | 3 ++- languages/core_en_english_gb.php | 3 ++- "languages/core_es_espa\303\261ol_es.php" | 3 ++- "languages/core_fr_fran\303\247ais_fr.php" | 3 ++- languages/core_hu_Hungary_hu.php | 3 ++- languages/core_it_Italiano_it.php | 3 ++- languages/core_nl_Nederlands_nl.php | 3 ++- languages/core_pl_polski_pl.php | 1 + "languages/core_pt_Portugu\303\252s_pt.php" | 3 ++- "languages/core_ro_Rom\303\242n\304\203_ro.php" | 3 ++- ...321\201\321\201\320\272\320\270\320\271_ru.php" | 3 ++- libs/statsindex.js | 2 +- stats/index.php | 14 +++++++++++++- 19 files changed, 59 insertions(+), 23 deletions(-) diff --git a/install.php b/install.php index c244bd3..d5bbc2c 100644 --- a/install.php +++ b/install.php @@ -289,7 +289,8 @@ function install($type, $host, $user, $pass, $dbname, $lang, $mysqlcon, &$err_ms if($mysqlcon->exec("CREATE TABLE `$dbname`.`user_iphash` ( `uuid` char(28) CHARACTER SET utf8 COLLATE utf8_unicode_ci PRIMARY KEY, `iphash` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci, - `ip` varchar(39) CHARACTER SET utf8 COLLATE utf8_unicode_ci + `ip` varchar(39) CHARACTER SET utf8 COLLATE utf8_unicode_ci, + `is_ipv4` tinyint(1) NOT NULL );") === false) { $err_msg .= $lang['isntwidbmsg'].$mysqlcon->errorCode()." ".print_r($mysqlcon->errorInfo(), true).'
'; $err_lvl = 2; $count++; @@ -1072,4 +1073,4 @@ function install($type, $host, $user, $pass, $dbname, $lang, $mysqlcon, &$err_ms }); - \ No newline at end of file + diff --git a/jobs/check_db.php b/jobs/check_db.php index 3fdb16f..b46da3e 100644 --- a/jobs/check_db.php +++ b/jobs/check_db.php @@ -549,10 +549,16 @@ function check_writable($cfg,$mysqlcon) { $updatedone = TRUE; } + if(version_compare($cfg['version_current_using'], '1.3.24', '<')) { + if($mysqlcon->exec("ALTER TABLE `$dbname`.`user_iphash` ADD COLUMN `is_ipv4` tinyint(1) NOT NULL;") === false) { } else { + enter_logfile(4," [1.3.24] Successfully added the new `is_ipv4` column to the table `user_iphash`."); + } + } + $cfg = set_new_version($mysqlcon,$cfg,$dbname); } enter_logfile(5,"Check Ranksystem database for updates [done]"); if(isset($updatedone) && $updatedone === TRUE) return TRUE; return FALSE; } -?> \ No newline at end of file +?> diff --git a/jobs/event_userenter.php b/jobs/event_userenter.php index 6b73470..5140dab 100644 --- a/jobs/event_userenter.php +++ b/jobs/event_userenter.php @@ -15,8 +15,10 @@ function event_userenter(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3 if($client['client_database_id'] == $event['client_database_id']) { if(strstr($client['connection_client_ip'], '[')) { $ip = str_replace(array('[',']'),'',$client['connection_client_ip']); + $is_ipv4 = false; // IPv6 } else { $ip = $client['connection_client_ip']; + $is_ipv4 = true; // IPv4 } break; } @@ -46,12 +48,13 @@ function event_userenter(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3 } $uuid = htmlspecialchars($event['client_unique_identifier'], ENT_QUOTES); + $is_ipv4 = (isset($is_ipv4)) ? $is_ipv4 : true; // default IPv4, if it couldn't be detected if(isset($sqlhashs[$uuid])) { - $sqlexec3 .= "UPDATE `$dbname`.`user_iphash` SET `iphash`='$hash',`ip`='$ip' WHERE `uuid`='{$event['client_unique_identifier']}'; "; - enter_logfile(6,"Userenter: UPDATE `$dbname`.`user_iphash` SET `iphash`='$hash',`ip`='$ip' WHERE `uuid`='{$event['client_unique_identifier']}'; "); + $sqlexec3 .= "UPDATE `$dbname`.`user_iphash` SET `iphash`='$hash',`ip`='$ip',`is_ipv4`=$is_ipv4 WHERE `uuid`='{$event['client_unique_identifier']}'; "; + enter_logfile(6,"Userenter: UPDATE `$dbname`.`user_iphash` SET `iphash`='$hash',`ip`='$ip',`is_ipv4`=$is_ipv4 WHERE `uuid`='{$event['client_unique_identifier']}'; "); } else { - $sqlexec3 .= "INSERT INTO `$dbname`.`user_iphash` (`uuid`,`iphash`,`ip`) VALUES ('{$event['client_unique_identifier']}','$hash','$ip'); "; - enter_logfile(6,"Userenter: INSERT INTO `$dbname`.`user_iphash` (`uuid`,`iphash`,`ip`) VALUES ('{$event['client_unique_identifier']}','$hash','$ip'); "); + $sqlexec3 .= "INSERT INTO `$dbname`.`user_iphash` (`uuid`,`iphash`,`ip`,`is_ipv4`) VALUES ('{$event['client_unique_identifier']}','$hash','$ip',$is_ipv4); "; + enter_logfile(6,"Userenter: INSERT INTO `$dbname`.`user_iphash` (`uuid`,`iphash`,`ip`,`is_ipv4`) VALUES ('{$event['client_unique_identifier']}','$hash','$ip',$is_ipv4); "); } if($mysqlcon->exec($sqlexec3) === false) { enter_logfile(2,"event_userenter 3:".print_r($mysqlcon->errorInfo(), true)); @@ -62,4 +65,4 @@ function event_userenter(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3 } } } -?> \ No newline at end of file +?> diff --git "a/languages/core_ar_\330\247\331\204\330\271\330\261\330\250\331\212\330\251_arab.php" "b/languages/core_ar_\330\247\331\204\330\271\330\261\330\250\331\212\330\251_arab.php" index eebbd40..4e58b14 100644 --- "a/languages/core_ar_\330\247\331\204\330\271\330\261\330\250\331\212\330\251_arab.php" +++ "b/languages/core_ar_\330\247\331\204\330\271\330\261\330\250\331\212\330\251_arab.php" @@ -270,6 +270,7 @@ $lang['stix0062'] = "View all nations"; $lang['stix0063'] = "View all platforms"; $lang['stix0064'] = "Last 3 months"; +$lang['stix0065'] = "(لكل المستخدمين) IP Versions"; $lang['stmy0001'] = "العضوية"; $lang['stmy0002'] = "رتبة"; $lang['stmy0003'] = "Database ID:"; @@ -705,4 +706,4 @@ $lang['wiverifydesc'] = "Enter here the channel-ID of the verification channel.

This channel need to be set up manual on your TeamSpeak server. Name, permissions and other properties could be defined for your choice; only user should be possible to join this channel!

The verification is done by the respective user himself on the statistics-page (/stats/). This is only necessary if the website visitor can't automatically be matched/related with the TeamSpeak user.

To verify the TeamSpeak user, he has to be in the verification channel. There he is able to receive a token with which he can verify himself for the statistics page."; $lang['wivlang'] = "Language"; $lang['wivlangdesc'] = "Choose a default language for the Ranksystem.

The language is also selectable on the websites for the users and will be stored for the session."; -?> \ No newline at end of file +?> diff --git "a/languages/core_az_Az\311\231rbaycan_az.php" "b/languages/core_az_Az\311\231rbaycan_az.php" index 4e18c77..be19cd5 100644 --- "a/languages/core_az_Az\311\231rbaycan_az.php" +++ "b/languages/core_az_Az\311\231rbaycan_az.php" @@ -270,6 +270,7 @@ $lang['stix0062'] = "Bütün millətlərə bax"; $lang['stix0063'] = "Bütün platformlara baxın"; $lang['stix0064'] = "Son 3 ay"; +$lang['stix0065'] = "IP Versions (bütün istifadəçilərin)"; $lang['stmy0001'] = "Mənim statistikalarım"; $lang['stmy0002'] = "Dərəcə"; $lang['stmy0003'] = "Database ID:"; @@ -705,4 +706,4 @@ $lang['wiverifydesc'] = "Burada doğrulama kanalının kanal ID daxil edin.

Bu kanalın qurulması lazımdır. Əl ilə qurmalısız. Ad, icazələr və digər xüsusiyyətlər sizin seçiminizlə müəyyənləşdirilə bilər; yalnız istifadəçi bu kanala qoşulmalıdır!

Verifikasiya statistik məlumat səhifəsində müvafiq istifadəçi tərəfindən həyata keçirilir (/stats/). Bu, yalnız veb interfeysin istifadəçisinin, TeamSpeak istifadəçisiyle avtomatik olaraq eşleşmemesi / uyğunlaşmaması lazımdır.

TeamSpeak istifadəçisini yoxlamaq üçün yoxlama kanalında olmalıdır. O, özü statistika səhifəsi üçün özünü təsdiqləyə biləcək bir möcüzə ala bilir."; $lang['wivlang'] = "Dil"; $lang['wivlangdesc'] = "Rank Sistemi üçün standart bir dil seçin.

Dil, həmçinin istifadəçilər üçün saytlarda seçilə bilər və sessiya üçün saxlanacaq."; -?> \ No newline at end of file +?> diff --git "a/languages/core_cz_\304\214e\305\241tina_cz.php" "b/languages/core_cz_\304\214e\305\241tina_cz.php" index 349d9b2..3fd37aa 100644 --- "a/languages/core_cz_\304\214e\305\241tina_cz.php" +++ "b/languages/core_cz_\304\214e\305\241tina_cz.php" @@ -270,6 +270,7 @@ $lang['stix0062'] = "Ukaž všechny národnosti"; $lang['stix0063'] = "Ukaž všechny platformy"; $lang['stix0064'] = "Za poslední čtvrtletí"; +$lang['stix0065'] = "IP Versions (všech Uživatelů)"; $lang['stmy0001'] = "Mé statistiky"; $lang['stmy0002'] = "Moje pořadí"; $lang['stmy0003'] = "Pořadí v databázi (ID):"; @@ -706,4 +707,4 @@ $lang['wiverifydesc'] = "Enter here the channel-ID of the verification channel.

This channel need to be set up manual on your TeamSpeak server. Name, permissions and other properties could be defined for your choice; only user should be possible to join this channel!

The verification is done by the respective user himself on the statistics-page (/stats/). This is only necessary if the website visitor can't automatically be matched/related with the TeamSpeak user.

To verify the TeamSpeak user, he has to be in the verification channel. There he is able to receive a token with which he can verify himself for the statistics page."; $lang['wivlang'] = "Jazyk"; $lang['wivlangdesc'] = "Nastavte hlavní jazyk pro Ranksystem

Jazyk můžete kdykoliv změnit."; -?> \ No newline at end of file +?> diff --git a/languages/core_de_Deutsch_de.php b/languages/core_de_Deutsch_de.php index bd1874f..5c7e7ba 100644 --- a/languages/core_de_Deutsch_de.php +++ b/languages/core_de_Deutsch_de.php @@ -270,6 +270,7 @@ $lang['stix0062'] = "zeige alle Nationen"; $lang['stix0063'] = "zeige alle Plattformen"; $lang['stix0064'] = "letzten 3 Monate"; +$lang['stix0065'] = "IP Versionen (aller User)"; $lang['stmy0001'] = "Meine Statistiken"; $lang['stmy0002'] = "Rank"; $lang['stmy0003'] = "Datenbank-ID:"; @@ -705,4 +706,4 @@ $lang['wiverifydesc'] = "Hier ist die Channel Datenbank-ID des Verifizierungs-Channels zu hinterlegen.

Dieser Channel ist manuell auf dem TeamSpeak Server anzulegen. Name, Berechtigungen und sonstige Eigenschaften können nach Belieben gesetzt werden; lediglich sollten User ihn betreten können! ;-)

Die Verifizierung erfolgt durch den jeweiligen Benutzer selbst auf der Ranksystem Statistik-Seite (/stats/). Sie ist nur dann erforderlich, wenn eine Zuordnung des Webseitenbesuchers mit dem TeamSpeak-User nicht automatisch erfolgen kann.

Für die Verifizierung muss sich der User auf dem TeamSpeak Server in den Verifizierungs-Channel begeben. Dort kann er den Token empfangen, mit welchem er sich für die Statistik-Seite verifiziert."; $lang['wivlang'] = "Sprache"; $lang['wivlangdesc'] = "Wähle die Standard-Sprache des Ranksystems.
Sie ist relevant für das Webinterface, die Statistik-Seite und insbesondere für die Ranksystem-Log.

Die Sprache kann über die Webseite durch jeden Besucher übersteuert werden und wird dann für die laufende Sitzung gespeichert (Session-Cookie)."; -?> \ No newline at end of file +?> diff --git a/languages/core_en_english_gb.php b/languages/core_en_english_gb.php index 0a8834f..f01be60 100644 --- a/languages/core_en_english_gb.php +++ b/languages/core_en_english_gb.php @@ -270,6 +270,7 @@ $lang['stix0062'] = "View all nations"; $lang['stix0063'] = "View all platforms"; $lang['stix0064'] = "Last 3 months"; +$lang['stix0065'] = "IP Versions (all users)"; $lang['stmy0001'] = "My statistics"; $lang['stmy0002'] = "Rank"; $lang['stmy0003'] = "Database ID:"; @@ -705,4 +706,4 @@ $lang['wiverifydesc'] = "Enter here the channel-ID of the verification channel.

This channel needs to be set up manually on your TeamSpeak server. Name, permissions and other properties could be defined of your choice; only the user should be possible to join this channel!

The verification is done by the respective user himself on the statistics-page (/stats/). This is only necessary if the website visitor can't automatically be matched/related to the TeamSpeak user.

To verify the TeamSpeak user, he has to be in the verification channel. There he is able to receive a token with which he can verify himself for the statistics page."; $lang['wivlang'] = "Language"; $lang['wivlangdesc'] = "Choose a default language for the Ranksystem.

The language is also selectable on the websites for the users and will be stored for the session."; -?> \ No newline at end of file +?> diff --git "a/languages/core_es_espa\303\261ol_es.php" "b/languages/core_es_espa\303\261ol_es.php" index 1cfd8ee..1c332bb 100644 --- "a/languages/core_es_espa\303\261ol_es.php" +++ "b/languages/core_es_espa\303\261ol_es.php" @@ -270,6 +270,7 @@ $lang['stix0062'] = "Ver todas las naciones"; $lang['stix0063'] = "Ver todas las plataformas"; $lang['stix0064'] = "Últimos 3 meses"; +$lang['stix0065'] = "IP Versions (de todos los clientes)"; $lang['stmy0001'] = "Mis estadísticas"; $lang['stmy0002'] = "Rango"; $lang['stmy0003'] = "ID de la base de datos:"; @@ -704,4 +705,4 @@ $lang['wiverifydesc'] = "Ingrese aquí el ID de canal del canal de verificación.

Este canal debe ser configurado manualmente en tu servidor TeamSpeak. Nombre, permisos y otras propiedades podrían definirse para su elección; solo el usuario debería ser posible unirse a este canal!

La verificación la realiza el propio usuario en la página de estadísticas.(/stats/). Esto solo es necesario si el visitante del sitio web no puede ser emparejado / relacionado automáticamente con el usuario de TeamSpeak.

To verify the TeamSpeak user, he has to be in the verification channel. Allí puede recibir un token con el que puede verificarse a sí mismo para la página de estadísticas."; $lang['wivlang'] = "Idioma"; $lang['wivlangdesc'] = "Elija un idioma predeterminado para el Ranksystem.

El idioma también se puede seleccionar en los sitios web para los usuarios y se almacenará para la sesión."; -?> \ No newline at end of file +?> diff --git "a/languages/core_fr_fran\303\247ais_fr.php" "b/languages/core_fr_fran\303\247ais_fr.php" index e5d1a47..b676273 100644 --- "a/languages/core_fr_fran\303\247ais_fr.php" +++ "b/languages/core_fr_fran\303\247ais_fr.php" @@ -270,6 +270,7 @@ $lang['stix0062'] = "Voir toutes les nations"; $lang['stix0063'] = "Voir toutes les plateformes"; $lang['stix0064'] = "Last 3 months"; +$lang['stix0065'] = "IP Versions (de tous les clients)"; $lang['stmy0001'] = "Mes statistiques"; $lang['stmy0002'] = "Rang"; $lang['stmy0003'] = "ID dans la base de donnée:"; @@ -703,4 +704,4 @@ $lang['wiverifydesc'] = "Enter here the channel-ID of the verification channel.

This channel need to be set up manual on your TeamSpeak server. Name, permissions and other properties could be defined for your choice; only user should be possible to join this channel!

The verification is done by the respective user himself on the statistics-page (/stats/). This is only necessary if the website visitor can't automatically be matched/related with the TeamSpeak user.

To verify the TeamSpeak user, he has to be in the verification channel. There he is able to receive a token with which he can verify himself for the statistics page."; $lang['wivlang'] = "Langue"; $lang['wivlangdesc'] = "Choisissez une langue par défaut pour le Ranksystem.

La langue est également sélectionnable sur le site web pour les utilisateurs et sera stockée pour sa session."; -?> \ No newline at end of file +?> diff --git a/languages/core_hu_Hungary_hu.php b/languages/core_hu_Hungary_hu.php index 056f9b8..33aa371 100644 --- a/languages/core_hu_Hungary_hu.php +++ b/languages/core_hu_Hungary_hu.php @@ -270,6 +270,7 @@ $lang['stix0062'] = "Minden nemzetiség megtekintése"; $lang['stix0063'] = "Minden platform megtekintése"; $lang['stix0064'] = "Az utolsó 90 napban"; +$lang['stix0065'] = "IP Versions (összesítve)"; $lang['stmy0001'] = "Saját statisztikám"; $lang['stmy0002'] = "Helyezés"; $lang['stmy0003'] = "Adatbázis ID:"; @@ -705,4 +706,4 @@ $lang['wiverifydesc'] = "Írja ide az ellenőrző csatorna csatorna-azonosítóját.

Ezt a szobát manuálisan kell beállítani a TeamSpeak szerveren. A nevet, az engedélyeket és az egyéb tulajdonságokat ön választhatja; csak a felhasználónak kell csatlakoznia ehhez a szobához!!

Az ellenőrzést a megfelelő felhasználó maga végzi a statisztikai oldalon (/ stats /). Ez csak akkor szükséges, ha a webhely látogatóját nem lehet automatikusan egyeztetni / kapcsolatba hozni a TeamSpeak felhasználóval.

A TeamSpeak felhasználó igazolásához a hitelesítési csatornán kell lennie. Ott képes egy tokent kapni, amellyel ellenőrizheti magát a statisztikai oldalon."; $lang['wivlang'] = "Nyelv"; $lang['wivlangdesc'] = "Válasszon alapértelmezett nyelvet a Ranksystem számára.

A nyelv a felhasználók számára a weboldalakon is kiválasztható, és a munkamenet során tárolódik."; -?> \ No newline at end of file +?> diff --git a/languages/core_it_Italiano_it.php b/languages/core_it_Italiano_it.php index 259ff9b..ccec3f6 100644 --- a/languages/core_it_Italiano_it.php +++ b/languages/core_it_Italiano_it.php @@ -270,6 +270,7 @@ $lang['stix0062'] = "Viaualizza tutte le nazionalità"; $lang['stix0063'] = "Visualizza tutte le piattaforme"; $lang['stix0064'] = "Last 3 months"; +$lang['stix0065'] = "IP Versions (di tutti gli utenti)"; $lang['stmy0001'] = "Le mie statistiche"; $lang['stmy0002'] = "Rank"; $lang['stmy0003'] = "Database ID:"; @@ -705,4 +706,4 @@ $lang['wiverifydesc'] = "Inserisci l'ID del canale di verifica.

Questo canale va impostato manualmente nel tuo server Teamspeak. Nome, permessi e altre proprietà possono essere impostati a tua scelta; Solo gli utenti potranno entrare in questo canale!

La verifica va fatta dall'utente nella sua pagina delle informazioni (/stats/). Questo è necessario solo se i visitatori della pagina web non possono essere direttamente associati al profilo del server Teamspeak.

Per essere verificato l'utente deve essere all'interno del canale di verifica sul server Teamspeak. Qui riceverà un token per la sua pagina delle statistiche."; $lang['wivlang'] = "Lingua"; $lang['wivlangdesc'] = "Scegli la lingua di default del Ranksystem.

La lingua è inoltre selezionabile dal sito e viene salvata per tutta la sessione."; -?> \ No newline at end of file +?> diff --git a/languages/core_nl_Nederlands_nl.php b/languages/core_nl_Nederlands_nl.php index 5b7b45a..0d707b7 100644 --- a/languages/core_nl_Nederlands_nl.php +++ b/languages/core_nl_Nederlands_nl.php @@ -270,6 +270,7 @@ $lang['stix0062'] = "View all nations"; $lang['stix0063'] = "View all platforms"; $lang['stix0064'] = "Last 3 months"; +$lang['stix0065'] = "IP Versions (van alle clients)"; $lang['stmy0001'] = "Mijn statistieken"; $lang['stmy0002'] = "Rang"; $lang['stmy0003'] = "Database ID:"; @@ -705,4 +706,4 @@ $lang['wiverifydesc'] = "Enter here the channel-ID of the verification channel.

This channel need to be set up manual on your TeamSpeak server. Name, permissions and other properties could be defined for your choice; only user should be possible to join this channel!

The verification is done by the respective user himself on the statistics-page (/stats/). This is only necessary if the website visitor can't automatically be matched/related with the TeamSpeak user.

To verify the TeamSpeak user, he has to be in the verification channel. There he is able to receive a token with which he can verify himself for the statistics page."; $lang['wivlang'] = "Language"; $lang['wivlangdesc'] = "Choose a default language for the Ranksystem.

The language is also selectable on the websites for the users and will be stored for the session."; -?> \ No newline at end of file +?> diff --git a/languages/core_pl_polski_pl.php b/languages/core_pl_polski_pl.php index 94c1b71..997c6d6 100644 --- a/languages/core_pl_polski_pl.php +++ b/languages/core_pl_polski_pl.php @@ -270,6 +270,7 @@ $lang['stix0062'] = "Zobacz wszystkie narody"; $lang['stix0063'] = "Wyświetl wszystkie platformy"; $lang['stix0064'] = "Ostatnie 3 miesiące"; +$lang['stix0065'] = "IP Versions (wszystkich klientów)"; $lang['stmy0001'] = "Moje statystyki"; $lang['stmy0002'] = "Ranga"; $lang['stmy0003'] = "Database ID:"; diff --git "a/languages/core_pt_Portugu\303\252s_pt.php" "b/languages/core_pt_Portugu\303\252s_pt.php" index a52ad35..f3186d0 100644 --- "a/languages/core_pt_Portugu\303\252s_pt.php" +++ "b/languages/core_pt_Portugu\303\252s_pt.php" @@ -270,6 +270,7 @@ $lang['stix0062'] = "Veja todas as nações"; $lang['stix0063'] = "Ver todas as plataformas"; $lang['stix0064'] = "Last 3 months"; +$lang['stix0065'] = "IP Versions (de todos os clientes)"; $lang['stmy0001'] = "Minhas estatísticas"; $lang['stmy0002'] = "Rank"; $lang['stmy0003'] = "ID da data base:"; @@ -705,4 +706,4 @@ $lang['wiverifydesc'] = "Digite aqui a ID do canal de verificação.

Este canal precisa ser configurado manualmente no seu servidor TeamSpeak. Nome, permissões e outras propriedades podem ser definidos por sua escolha; o usuário deve apenas se juntar a este canal!

A verificação é feita pelo próprio usuário na página de estatísticas (/stats/). Isso só é necessário se o visitante do site não puder ser automaticamente encontrado / relacionado com o usuário do TeamSpeak.

Para verificar-se o usuário do TeamSpeak deve estar dentro do canal de verificação. Lá, ele pode receber o token com o qual ele se verifica para na página de estatísticas."; $lang['wivlang'] = "Tradução"; $lang['wivlangdesc'] = "Escolha um idioma padrão para o Sistema de ranking.

O idioma também é selecionável nos sites para os usuários e será armazenado para as próximas sessões."; -?> \ No newline at end of file +?> diff --git "a/languages/core_ro_Rom\303\242n\304\203_ro.php" "b/languages/core_ro_Rom\303\242n\304\203_ro.php" index daa01f7..2c92a5c 100644 --- "a/languages/core_ro_Rom\303\242n\304\203_ro.php" +++ "b/languages/core_ro_Rom\303\242n\304\203_ro.php" @@ -270,6 +270,7 @@ $lang['stix0062'] = "Vezi natiuni"; $lang['stix0063'] = "Vezi platforme"; $lang['stix0064'] = "Last 3 months"; +$lang['stix0065'] = "IP Versions (tuturor clien?ilor)"; $lang['stmy0001'] = "Statisticile mele"; $lang['stmy0002'] = "Grad"; $lang['stmy0003'] = "ID baza de date:"; @@ -705,4 +706,4 @@ $lang['wiverifydesc'] = "Scrie aici ID-ul canalului pentru verificare.

Acest canal trebuie setat manual pe serverul TeamSpeak. Numele, permisiunile ?i alte proprieta?i ar putea fi definite pentru alegerea dvs.; doar utilizatorul ar trebui sa fie posibil sa se alature acestui canal!

Verificarea se face de catre utilizatorul respectiv ?u?i pe pagina de statistici (/stats/). Acest lucru este necesar doar daca vizitatorul site-ului nu poate fi asociat automat cu utilizatorul TeamSpeak.

Pentru a verifica daca utilizatorul TeamSpeak trebuie sa fie pe canalul de verificare. Acolo el poate primi token-ul cu care se verifica pentru pagina de statistici."; $lang['wivlang'] = "Limba"; $lang['wivlangdesc'] = "Alege limba default pentru web.

Limba se poate schimba din web de fiecare user."; -?> \ No newline at end of file +?> diff --git "a/languages/core_ru_P\321\203\321\201\321\201\320\272\320\270\320\271_ru.php" "b/languages/core_ru_P\321\203\321\201\321\201\320\272\320\270\320\271_ru.php" index 8de620d..516afaa 100644 --- "a/languages/core_ru_P\321\203\321\201\321\201\320\272\320\270\320\271_ru.php" +++ "b/languages/core_ru_P\321\203\321\201\321\201\320\272\320\270\320\271_ru.php" @@ -270,6 +270,7 @@ $lang['stix0062'] = "Показать все страны"; $lang['stix0063'] = "Показать все платформы"; $lang['stix0064'] = "За 3 месяца"; +$lang['stix0065'] = "IP Versions (all users)"; $lang['stmy0001'] = "Моя статистика"; $lang['stmy0002'] = "Ранг"; $lang['stmy0003'] = "ID в базе данных:"; @@ -705,4 +706,4 @@ $lang['wiverifydesc'] = "Здесь необходимо указать ID канала, в котором будет проходить проверка пользователей.

Этот канал необходимо настроить на сервере TS3 вручную. Имя, привилегии и другие настройки могут быть установлены по вашему желанию; необходимо лишь предоставить пользователям возможность входить в данный канал!
Это необходимо только в случае если посетитель не сможет автоматически идентифицироваться системой рангов.

Для проверки пользователь сервера должен быть внутри данного канала. Там он сможет получить ключ, с помощью которого он идентифицирует себя на странице статистики."; $lang['wivlang'] = "Язык"; $lang['wivlangdesc'] = "Выберите язык, используемый системой рангов по умолчанию.

Язык сайта по-прежнему будет доступен для переключения всем пользователям."; -?> \ No newline at end of file +?> diff --git a/libs/statsindex.js b/libs/statsindex.js index 8ad0a22..387e78b 100644 --- a/libs/statsindex.js +++ b/libs/statsindex.js @@ -1 +1 @@ -const donut_time_color_1=window.getComputedStyle(document.getElementById("donut_time_color_1")).getPropertyValue("color"),donut_time_color_2=window.getComputedStyle(document.getElementById("donut_time_color_2")).getPropertyValue("color"),donut_version_color_1=window.getComputedStyle(document.getElementById("donut_version_color_1")).getPropertyValue("color"),donut_version_color_2=window.getComputedStyle(document.getElementById("donut_version_color_2")).getPropertyValue("color"),donut_version_color_3=window.getComputedStyle(document.getElementById("donut_version_color_3")).getPropertyValue("color"),donut_version_color_4=window.getComputedStyle(document.getElementById("donut_version_color_4")).getPropertyValue("color"),donut_version_color_5=window.getComputedStyle(document.getElementById("donut_version_color_5")).getPropertyValue("color"),donut_version_color_6=window.getComputedStyle(document.getElementById("donut_version_color_6")).getPropertyValue("color"),donut_nation_color_1=window.getComputedStyle(document.getElementById("donut_nation_color_1")).getPropertyValue("color"),donut_nation_color_2=window.getComputedStyle(document.getElementById("donut_nation_color_2")).getPropertyValue("color"),donut_nation_color_3=window.getComputedStyle(document.getElementById("donut_nation_color_3")).getPropertyValue("color"),donut_nation_color_4=window.getComputedStyle(document.getElementById("donut_nation_color_4")).getPropertyValue("color"),donut_nation_color_5=window.getComputedStyle(document.getElementById("donut_nation_color_5")).getPropertyValue("color"),donut_nation_color_6=window.getComputedStyle(document.getElementById("donut_nation_color_6")).getPropertyValue("color"),donut_platform_color_1=window.getComputedStyle(document.getElementById("donut_platform_color_1")).getPropertyValue("color"),donut_platform_color_2=window.getComputedStyle(document.getElementById("donut_platform_color_2")).getPropertyValue("color"),donut_platform_color_3=window.getComputedStyle(document.getElementById("donut_platform_color_3")).getPropertyValue("color"),donut_platform_color_4=window.getComputedStyle(document.getElementById("donut_platform_color_4")).getPropertyValue("color"),donut_platform_color_5=window.getComputedStyle(document.getElementById("donut_platform_color_5")).getPropertyValue("color"),donut_platform_color_6=window.getComputedStyle(document.getElementById("donut_platform_color_6")).getPropertyValue("color"),graph_lineColors_1=window.getComputedStyle(document.getElementById("graph_lineColors_1")).getPropertyValue("color"),graph_lineColors_2=window.getComputedStyle(document.getElementById("graph_lineColors_2")).getPropertyValue("color"),graph_pointFillColors_1=window.getComputedStyle(document.getElementById("graph_pointFillColors_1")).getPropertyValue("color"),graph_pointFillColors_2=window.getComputedStyle(document.getElementById("graph_pointFillColors_2")).getPropertyValue("color"),graph_pointStrokeColors_1=window.getComputedStyle(document.getElementById("graph_pointStrokeColors_1")).getPropertyValue("color"),graph_pointStrokeColors_2=window.getComputedStyle(document.getElementById("graph_pointStrokeColors_2")).getPropertyValue("color"),graph_fillOpacity=window.getComputedStyle(document.getElementById("graph_fillOpacity")).getPropertyValue("opacity");for(var m,tsn=new Array,i=1;i<36;i++)tsn[i]=document.getElementById("tsn"+i).value;m="0"===tsn[35]||"2"===tsn[35]?[0,0,tsn[34]]:0,Morris.Donut({element:"time-gap-donut",data:[{label:tsn[1],value:tsn[4]},{label:tsn[2],value:tsn[5]}],colors:[donut_time_color_1,donut_time_color_2]}),Morris.Donut({element:"client-version-donut",data:[{label:tsn[6],value:tsn[11]},{label:tsn[7],value:tsn[12]},{label:tsn[8],value:tsn[13]},{label:tsn[9],value:tsn[14]},{label:tsn[10],value:tsn[15]},{label:tsn[3],value:tsn[16]}],colors:[donut_version_color_1,donut_version_color_2,donut_version_color_3,donut_version_color_4,donut_version_color_5,donut_version_color_6]}),Morris.Donut({element:"user-descent-donut",data:[{label:tsn[17],value:tsn[22]},{label:tsn[18],value:tsn[23]},{label:tsn[19],value:tsn[24]},{label:tsn[20],value:tsn[25]},{label:tsn[21],value:tsn[26]},{label:tsn[3],value:tsn[27]}],colors:[donut_nation_color_1,donut_nation_color_2,donut_nation_color_3,donut_nation_color_4,donut_nation_color_5,donut_nation_color_6]}),Morris.Donut({element:"user-platform-donut",data:[{label:"Windows",value:tsn[28]},{label:"iOS",value:tsn[29]},{label:"Linux",value:tsn[30]},{label:"Android",value:tsn[31]},{label:"OSX",value:tsn[32]},{label:tsn[3],value:tsn[33]}],colors:[donut_platform_color_1,donut_platform_color_2,donut_platform_color_3,donut_platform_color_4,donut_platform_color_5,donut_platform_color_6]}),$(function(){var e="0"===tsn[35]||"1"===tsn[35]?Morris.Area({element:"serverusagechart",behaveLikeLine:!0,data:[],xkey:"y",ykeys:["a","b"],hideHover:"auto",fillOpacity:graph_fillOpacity,hoverCallback:function(o,e,t,l){return""+l.y+"
Clients: "+l.a+"
Channel: "+l.b+"
"},labels:["Clients","Channel"],goals:m,lineColors:[graph_lineColors_1,graph_lineColors_2],pointFillColors:[graph_pointFillColors_1,graph_pointFillColors_2],pointStrokeColors:[graph_pointStrokeColors_1,graph_pointStrokeColors_2],resize:!0}):Morris.Area({element:"serverusagechart",behaveLikeLine:!0,data:[],xkey:"y",ykeys:["a"],hideHover:"auto",fillOpacity:graph_fillOpacity,hoverCallback:function(o,e,t,l){return""+l.y+"
Clients: "+l.a+"
"},labels:["Clients"],goals:m,resize:!0});$("#period").on("change",function(){var o=$(this).val();$.ajax({type:"POST",url:"update_graph.php?serverusagechart="+o,data:0,dataType:"json",success:function(o){e.setData(o)}})})}),$(document).ready(function(o){$("#period").trigger("change")});var a=document.getElementById("days"),b=document.getElementById("hours"),c=document.getElementById("minutes"),d=document.getElementById("seconds"),e=document.getElementById("sut").value;function setTime(){++e,d.innerHTML=pad(e%60),c.innerHTML=pad(parseInt(e/60)%60),b.innerHTML=pad(parseInt(e/3600)%24),a.innerHTML=pad(parseInt(e/86400))}function pad(o){o+="";return o.length<2?"0"+o:o}setInterval(setTime,1e3); \ No newline at end of file +const donut_time_color_1=window.getComputedStyle(document.getElementById("donut_time_color_1")).getPropertyValue("color"),donut_time_color_2=window.getComputedStyle(document.getElementById("donut_time_color_2")).getPropertyValue("color"),donut_version_color_1=window.getComputedStyle(document.getElementById("donut_version_color_1")).getPropertyValue("color"),donut_version_color_2=window.getComputedStyle(document.getElementById("donut_version_color_2")).getPropertyValue("color"),donut_version_color_3=window.getComputedStyle(document.getElementById("donut_version_color_3")).getPropertyValue("color"),donut_version_color_4=window.getComputedStyle(document.getElementById("donut_version_color_4")).getPropertyValue("color"),donut_version_color_5=window.getComputedStyle(document.getElementById("donut_version_color_5")).getPropertyValue("color"),donut_version_color_6=window.getComputedStyle(document.getElementById("donut_version_color_6")).getPropertyValue("color"),donut_nation_color_1=window.getComputedStyle(document.getElementById("donut_nation_color_1")).getPropertyValue("color"),donut_nation_color_2=window.getComputedStyle(document.getElementById("donut_nation_color_2")).getPropertyValue("color"),donut_nation_color_3=window.getComputedStyle(document.getElementById("donut_nation_color_3")).getPropertyValue("color"),donut_nation_color_4=window.getComputedStyle(document.getElementById("donut_nation_color_4")).getPropertyValue("color"),donut_nation_color_5=window.getComputedStyle(document.getElementById("donut_nation_color_5")).getPropertyValue("color"),donut_nation_color_6=window.getComputedStyle(document.getElementById("donut_nation_color_6")).getPropertyValue("color"),donut_platform_color_1=window.getComputedStyle(document.getElementById("donut_platform_color_1")).getPropertyValue("color"),donut_platform_color_2=window.getComputedStyle(document.getElementById("donut_platform_color_2")).getPropertyValue("color"),donut_platform_color_3=window.getComputedStyle(document.getElementById("donut_platform_color_3")).getPropertyValue("color"),donut_platform_color_4=window.getComputedStyle(document.getElementById("donut_platform_color_4")).getPropertyValue("color"),donut_platform_color_5=window.getComputedStyle(document.getElementById("donut_platform_color_5")).getPropertyValue("color"),donut_platform_color_6=window.getComputedStyle(document.getElementById("donut_platform_color_6")).getPropertyValue("color"),donut_ip_version_color_1=window.getComputedStyle(document.getElementById("donut_ip_version_color_1")).getPropertyValue("color"),donut_ip_version_color_2=window.getComputedStyle(document.getElementById("donut_ip_version_color_2")).getPropertyValue("color"),graph_lineColors_1=window.getComputedStyle(document.getElementById("graph_lineColors_1")).getPropertyValue("color"),graph_lineColors_2=window.getComputedStyle(document.getElementById("graph_lineColors_2")).getPropertyValue("color"),graph_pointFillColors_1=window.getComputedStyle(document.getElementById("graph_pointFillColors_1")).getPropertyValue("color"),graph_pointFillColors_2=window.getComputedStyle(document.getElementById("graph_pointFillColors_2")).getPropertyValue("color"),graph_pointStrokeColors_1=window.getComputedStyle(document.getElementById("graph_pointStrokeColors_1")).getPropertyValue("color"),graph_pointStrokeColors_2=window.getComputedStyle(document.getElementById("graph_pointStrokeColors_2")).getPropertyValue("color"),graph_fillOpacity=window.getComputedStyle(document.getElementById("graph_fillOpacity")).getPropertyValue("opacity");for(var m,tsn=[],i=1;i<38;i++)tsn[i]=document.getElementById("tsn"+i).value;m="0"===tsn[37]||"2"===tsn[37]?[0,0,tsn[34]]:0,Morris.Donut({element:"time-gap-donut",data:[{label:tsn[1],value:tsn[4]},{label:tsn[2],value:tsn[5]}],colors:[donut_time_color_1,donut_time_color_2]}),Morris.Donut({element:"client-version-donut",data:[{label:tsn[6],value:tsn[11]},{label:tsn[7],value:tsn[12]},{label:tsn[8],value:tsn[13]},{label:tsn[9],value:tsn[14]},{label:tsn[10],value:tsn[15]},{label:tsn[3],value:tsn[16]}],colors:[donut_version_color_1,donut_version_color_2,donut_version_color_3,donut_version_color_4,donut_version_color_5,donut_version_color_6]}),Morris.Donut({element:"user-descent-donut",data:[{label:tsn[17],value:tsn[22]},{label:tsn[18],value:tsn[23]},{label:tsn[19],value:tsn[24]},{label:tsn[20],value:tsn[25]},{label:tsn[21],value:tsn[26]},{label:tsn[3],value:tsn[27]}],colors:[donut_nation_color_1,donut_nation_color_2,donut_nation_color_3,donut_nation_color_4,donut_nation_color_5,donut_nation_color_6]}),Morris.Donut({element:"user-platform-donut",data:[{label:"Windows",value:tsn[28]},{label:"iOS",value:tsn[29]},{label:"Linux",value:tsn[30]},{label:"Android",value:tsn[31]},{label:"OSX",value:tsn[32]},{label:tsn[3],value:tsn[33]}],colors:[donut_platform_color_1,donut_platform_color_2,donut_platform_color_3,donut_platform_color_4,donut_platform_color_5,donut_platform_color_6]}),$(function(){var o="0"===tsn[35]||"1"===tsn[35]?Morris.Area({element:"serverusagechart",behaveLikeLine:!0,data:[],xkey:"y",ykeys:["a","b"],hideHover:"auto",fillOpacity:graph_fillOpacity,hoverCallback:function(o,t,l,r){return""+r.y+"
Clients: "+r.a+"
Channel: "+r.b+"
"},labels:["Clients","Channel"],goals:m,lineColors:[graph_lineColors_1,graph_lineColors_2],pointFillColors:[graph_pointFillColors_1,graph_pointFillColors_2],pointStrokeColors:[graph_pointStrokeColors_1,graph_pointStrokeColors_2],resize:!0}):Morris.Area({element:"serverusagechart",behaveLikeLine:!0,data:[],xkey:"y",ykeys:["a"],hideHover:"auto",fillOpacity:graph_fillOpacity,hoverCallback:function(o,t,l,r){return""+r.y+"
Clients: "+r.a+"
"},labels:["Clients"],goals:m,resize:!0});$("#period").on("change",function(){var t=$(this).val();$.ajax({type:"POST",url:"update_graph.php?serverusagechart="+t,data:0,dataType:"json",success:function(t){o.setData(t)}})})}),Morris.Donut({element:"user-ip-version-donut",data:[{label:"IPv4",value:tsn[36]},{label:"IPv6",value:tsn[37]}],colors:[donut_ip_version_color_1,donut_ip_version_color_2]}),$(document).ready(function(o){$("#period").trigger("change")});var a=document.getElementById("days"),b=document.getElementById("hours"),c=document.getElementById("minutes"),d=document.getElementById("seconds"),e=document.getElementById("sut").value;function setTime(){++e,d.innerHTML=pad(e%60),c.innerHTML=pad(parseInt(e/60)%60),b.innerHTML=pad(parseInt(e/3600)%24),a.innerHTML=pad(parseInt(e/86400))}function pad(o){return(o+="").length<2?"0"+o:o}setInterval(setTime,1e3); diff --git a/stats/index.php b/stats/index.php index 6e556f2..eb17b6d 100644 --- a/stats/index.php +++ b/stats/index.php @@ -219,6 +219,18 @@ +
+
+
+
+

+
+
+
+
+
+
+
@@ -502,4 +514,4 @@ \ No newline at end of file +?>