Skip to content
This repository has been archived by the owner on May 15, 2019. It is now read-only.

Commit

Permalink
Overhaul to support time format
Browse files Browse the repository at this point in the history
Removed configuration options for pagination and skull, data fetching uses a central function, search can be used for IP addresses, updated themes and languages to support new format
  • Loading branch information
mathhulk committed Jul 22, 2018
1 parent aeb85d0 commit 0046234
Show file tree
Hide file tree
Showing 52 changed files with 31,176 additions and 222 deletions.
54 changes: 54 additions & 0 deletions include/languages/de_DE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "Deutsch",
"author": "derrodirik",
"terms": {
"punishments": "Strafen",
"support": "Support",
"contact": "Kontakt",
"appeal": "Entbannungs antrag",
"credits": "Credit",
"themes": "Themes",
"default": "Standaard",
"languages": "Sprachen",
"players": "Spieler",
"search": "Suchen...",
"submit": "Senden",
"permanently_banned": "Permanent gebannt",
"until": "Gebannt bis: ",
"not_banned": "Nicht gebannt",
"inactive": "Inaktiv",
"active": "Aktiv",
"graphs": "Grafiken",
"graph_title": "Strafen der letzten 7 Tage",
"first": "Erste",
"previous": "Vorherige",
"next": "Nächste",
"last": "Letzte",
"username": "Username",
"reason": "Grund",
"operator": "Operator",
"date": "Datum",
"expires": "Vervalt",
"type": "Typ",
"status": "Status",
"ban": "Ban",
"temp_ban": "Temp. Ban",
"ip_ban": "IP Ban",
"mute": "Mute",
"temp_mute": "Temp. Mute",
"warning": "Verwarnung",
"temp_warning": "Temp. Verwarnung",
"kick": "Kick",
"all": "Alle",
"bans": "Bans",
"temp_bans": "Temp. Bans",
"ip_bans": "IP Bans",
"mutes": "Mutes",
"temp_mutes": "Temp. Mutes",
"warnings": "Verwarnungen",
"temp_warnings": "Temp. verwarnungen",
"kicks": "Kicks",
"error_no_punishments": "Es gibt keine verwarnungen auf dieser seite.",
"error_not_evaluated": "N/A"
}
}
2 changes: 1 addition & 1 deletion include/languages/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"reason": "Reason",
"operator": "Operator",
"date": "Date",
"end": "End",
"expires": "Expires",
"type": "Type",
"status": "Status",
"ban": "Ban",
Expand Down
54 changes: 54 additions & 0 deletions include/languages/fr_FR.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "French",
"author": "lucas2107",
"terms": {
"punishments": "Sanctions",
"support": "Support",
"contact": "Contact",
"appeal": "Contester",
"credit": "Crédit",
"themes": "Thèmes",
"default": "Défaut",
"languages": "Langages",
"players": "Joueurs",
"search": "Rechercher...",
"submit": "Envoyer",
"permanently_banned": "Bannissement Permanent",
"until": "Banni jusqu'au ",
"not_banned": "Non Banni",
"inactive": "Terminé",
"active": "Actif",
"graphs": "Graphique",
"graph_title": "Graphique des sanctions",
"first": "Premier",
"previous": "Précédent",
"next": "Suivant",
"last": "Dernier",
"username": "Pseudo",
"reason": "Raison",
"operator": "Staff",
"date": "Date",
"expires": "Expire",
"type": "Type",
"status": "Status",
"ban": "Ban",
"temp_ban": "Ban Temporaire",
"ip_ban": "Ban IP",
"mute": "Mute",
"temp_mute": "Mute Temporaire",
"warning": "Avertissement",
"temp_warning": "Avertissement Temporaire",
"kick": "Kick",
"all": "Tous",
"bans": "Bans",
"temp_bans": "Bans Temporaires",
"ip_bans": "Bans IP",
"mutes": "Mutes",
"temp_mutes": "Mutes Temporaires",
"warnings": "Avertissements",
"temp_warnings": "Avertissements Temporaires",
"kicks": "Kicks",
"error_no_punishments": "Aucune sanction",
"error_not_evaluated": "N/A"
}
}
54 changes: 54 additions & 0 deletions include/languages/hu_HU.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "Hungarian",
"author": "montlikadani",
"terms": {
"punishments": "Büntetések",
"support": "Támogatás",
"contact": "Kapcsolatba lépés",
"appeal": "Fellebbezés",
"credit": "Hitel",
"themes": "Témák",
"default": "Alapértelmezett",
"languages": "Nyelvek",
"players": "Játékosok",
"search": "Keresés...",
"submit": "Beküldés",
"permanently_banned": "Tartósan tiltva",
"until": "Betiltottáig ",
"not_banned": "Nem tiltva",
"inactive": "Tétlen",
"active": "Aktív",
"graphs": "Grafikonok",
"graph_title": "7 büntetés nap",
"first": "Első",
"previous": "Előző",
"next": "Következő",
"last": "Utolsó",
"username": "Felhasználónév",
"reason": "Oka",
"operator": "Operátor",
"date": "Dátum",
"expires": "Lejár",
"type": "Típus",
"status": "Állapot",
"ban": "Kitiltva",
"temp_ban": "Tartós kitiltás",
"ip_ban": "IP tiltás",
"mute": "Némítás",
"temp_mute": "Tartós némítás",
"warning": "Figyelem",
"temp_warning": "Tartós figyelmeztetés",
"kick": "Kirúgás",
"all": "Minden",
"bans": "Kitiltások",
"temp_bans": "Tartós kitiltások",
"ip_bans": "IP kitiltások",
"mutes": "Némítások",
"temp_mutes": "Tartós némítások",
"warnings": "Figyelmeztetések",
"temp_warnings": "Tartós figyelmeztetések",
"kicks": "Kirúgások",
"error_no_punishments": "Ezen az oldalon semmilyen büntetést nem lehet felsorolni.",
"error_not_evaluated": "N/A"
}
}
54 changes: 54 additions & 0 deletions include/languages/pl_PL.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "Polish",
"author": "artur9010",
"terms": {
"punishments": "Kary",
"support": "Wsparcie",
"contact": "Kontakt",
"appeal": "Odwołaj się",
"credit": "Kredyt",
"themes": "Motywy",
"default": "Domyślna",
"languages": "Język",
"players": "graczy",
"search": "Szukaj...",
"submit": "Szukaj",
"permanently_banned": "Zbanowany permanentnie",
"until": "Zbanowany do ",
"not_banned": "Nie zbanowany",
"inactive": "Nieaktywny",
"active": "Aktywny",
"graphs": "Wykresy",
"graph_title": "Kary z ostatnich 7 dni",
"first": "Pierwsza",
"previous": "Poprzednia",
"next": "Następna",
"last": "Ostatnia",
"username": "Nick",
"reason": "Powód",
"operator": "Moderator",
"date": "Data",
"expires": "Wygasa",
"type": "Typ",
"status": "Status",
"ban": "Ban",
"temp_ban": "Tymczas. Ban",
"ip_ban": "Ban IP",
"mute": "Wyciszenie",
"temp_mute": "Tymczas. Wyciszenie",
"warning": "Ostrzeżenie",
"temp_warning": "Tymczas. Wyciszenie",
"kick": "Wyrzucenie",
"all": "Wszystko",
"bans": "Bany",
"temp_bans": "Tymczas. Bany",
"ip_bans": "Bany na IP",
"mutes": "Wyciszenia",
"temp_mutes": "Tymczas. Wyciszenia",
"warnings": "Ostrzeżenia",
"temp_warnings": "Tymczas. Ostrzeżenia",
"kicks": "Wyrzucenia",
"error_no_punishments": "Brak kar które mogłby się pojawić na tej stronie.",
"error_not_evaluated": "N/A"
}
}
7 changes: 1 addition & 6 deletions include/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"language": "en_US",
"time_zone": "America/Los_Angeles"
},
"skull": false,
"compact": false,
"ip_ban": true,
"messages": {
Expand All @@ -24,9 +23,5 @@
"enabled": true,
"link": "http://example.com/appeal"
}
},
"pagination": {
"per": 25,
"length": 9
}
}
}
23 changes: 6 additions & 17 deletions include/require/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function convertDateTime($time, $format) {
}

function getCategories( ) {
if($GLOBALS["__public"]["compact"] === true) $punishments = array("all", "ban", "mute", "warning", "kick");
if($GLOBALS["__public"]["compact"] === true) return array("all", "ban", "mute", "warning", "kick");
else if($GLOBALS["__public"]["ip_ban"] === true) return array("all", "ban", "temp_ban", "mute", "temp_mute", "warning", "temp_warning", "kick", "ip_ban");
return array("all", "ban", "temp_ban", "mute", "temp_mute", "warning", "temp_warning", "kick");
}
Expand All @@ -21,7 +21,7 @@ function getLocale($index, $default) {
return isset($GLOBALS["__language"]["terms"][$index]) ? $GLOBALS["__language"]["terms"][$index] : $default;
}

function fetchResult($category, $username, $day) {
function fetchResult($category, $username, $day, $page) {
$query = "SELECT * FROM " . $GLOBALS["__private"]["connection"]["table"]["log"];

if($username || $category || $day || $GLOBALS["__public"]["ip_ban"] === false) $query .= " WHERE 1 = 1";
Expand All @@ -31,27 +31,16 @@ function fetchResult($category, $username, $day) {
else if($category) $query .= " AND punishmentType = '" . strtoupper($category) . "'";
if($day) $query .= " AND start BETWEEN FROM_UNIXTIME(" . strtotime("-" . $day . " days") . ") AND FROM_UNIXTIME(" . strtotime("-" . ($day - 1) . " days") . ")";
if($GLOBALS["__public"]["ip_ban"] === false) $query .= " AND punishmentType != 'IP_BAN'";
$query .= " ORDER BY id DESC";
if($page) $query .= " LIMIT " . 25 * ($page - 1) . ", 25";

return mysqli_query($GLOBALS["__connection"], $query . " ORDER BY id DESC");
}

function getUuid($username) {
$api = json_decode(file_get_contents("https://mcapi.cloudprotected.net/uuid/" . $username), true);
return isset($api["result"][0]["uuid"]) ? $api["result"][0]["uuid"] : "8667ba71b85a4004af54457a9734eed7";
}

function getSkull($uuid, $size) {
return "https://mc-heads.net/head/" . $uuid . "/" . $size;
}

function getBody($uuid) {
return "https://mc-heads.net/body/" + $uuid;
return mysqli_query($GLOBALS["__connection"], $query);
}

function isActive($start, $end) {
if(!isset($GLOBALS["__log"])) $GLOBALS["__log"] = mysqli_fetch_all(mysqli_query($GLOBALS["__connection"], "SELECT * FROM " . $GLOBALS["__private"]["connection"]["table"]["punishment"]), MYSQLI_ASSOC);
foreach($GLOBALS["__log"] as $index => $value) {
if($value["start"] === $start && $value["end"]) return true;
if($value["start"] === $start && $value["end"] === $end) return true;
}
return false;
}
4 changes: 4 additions & 0 deletions include/themes/america/configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "America",
"author": "GlareMasters"
}
Loading

0 comments on commit 0046234

Please sign in to comment.