From 6e74557fdbbdf041d2624b57da1964cf4998929c Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Mon, 13 Nov 2023 10:52:38 +0100 Subject: [PATCH 1/7] clickable name --- last_stats.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/last_stats.php b/last_stats.php index 87993c9..c934a50 100644 --- a/last_stats.php +++ b/last_stats.php @@ -99,7 +99,7 @@ error_reporting(E_ALL); echo " - $player_name +

$winratio $KD_H $KD_ALL From ff906d4b5fa779982197e6ae58b91194de0ca5f9 Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Mon, 13 Nov 2023 10:53:31 +0100 Subject: [PATCH 2/7] btn_table --- last_stats.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/last_stats.php b/last_stats.php index c934a50..db406c1 100644 --- a/last_stats.php +++ b/last_stats.php @@ -99,7 +99,7 @@ error_reporting(E_ALL); echo " -

+

$winratio $KD_H $KD_ALL From 9586d935b34f2fb5cd026d97ad57877b339a63e8 Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Mon, 13 Nov 2023 10:55:35 +0100 Subject: [PATCH 3/7] buyttable --- includes/styles.css | 27 ++++++++++++++++++++++++--- last_stats.php | 2 +- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/includes/styles.css b/includes/styles.css index 85055a8..de8b21b 100644 --- a/includes/styles.css +++ b/includes/styles.css @@ -223,6 +223,29 @@ a { color: #000; /* Dark text on hover */ cursor: pointer; } +.btn:active { + transform: translateY(1px); /* Slight Pressed-In effect on Click */ +} + + +.btn_table { + font-family: 'Courier New', monospace; + background: #222; /* Dark background for buttons */ + color: #33ff33; /* Bright green text */ + border: 1px solid #33ff33; /* Border to match text color */ + padding: 0px 0pxpx; + text-transform: uppercase; + transition: background-color 0.3s ease, color 0.3s ease; +} + +.btn_table:hover { + background: #33ff33; /* Bright green background on hover */ + color: #000; /* Dark text on hover */ + cursor: pointer; +} +.btn_table:active { + transform: translateY(1px); /* Slight Pressed-In effect on Click */ +} /* Responsive button sizing for mobile for .btn class*/ @media (max-width: 768px) { @@ -231,9 +254,7 @@ a { font-size: 14px; /* Adjust font size for mobile readability */ } } -.btn:active { - transform: translateY(1px); /* Slight Pressed-In effect on Click */ -} + /* Container for tables to manage overflow */ .table-container { overflow-x: auto; diff --git a/last_stats.php b/last_stats.php index db406c1..eba4d26 100644 --- a/last_stats.php +++ b/last_stats.php @@ -99,7 +99,7 @@ error_reporting(E_ALL); echo " -

+

$winratio $KD_H $KD_ALL From 8bdcf5352d06a3eba4e8b713a237b04c61d81956 Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Mon, 13 Nov 2023 10:56:46 +0100 Subject: [PATCH 4/7] button padding --- includes/styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/styles.css b/includes/styles.css index de8b21b..22d58ed 100644 --- a/includes/styles.css +++ b/includes/styles.css @@ -233,7 +233,7 @@ a { background: #222; /* Dark background for buttons */ color: #33ff33; /* Bright green text */ border: 1px solid #33ff33; /* Border to match text color */ - padding: 0px 0pxpx; + padding: 0px 0px 0px 0px; text-transform: uppercase; transition: background-color 0.3s ease, color 0.3s ease; } From 5062ceb36192d3b29492ac4b140d8c45662bd1df Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Mon, 13 Nov 2023 10:59:01 +0100 Subject: [PATCH 5/7] buttonfix --- includes/styles.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/styles.css b/includes/styles.css index 22d58ed..2a8c9a4 100644 --- a/includes/styles.css +++ b/includes/styles.css @@ -236,6 +236,9 @@ a { padding: 0px 0px 0px 0px; text-transform: uppercase; transition: background-color 0.3s ease, color 0.3s ease; + max-width: 100px; /* Max width of the button */ + max-height: 30px; /* Max height of the button */ + box-sizing: border-box; /* Include padding and border in width/height */ } .btn_table:hover { @@ -243,10 +246,10 @@ a { color: #000; /* Dark text on hover */ cursor: pointer; } + .btn_table:active { transform: translateY(1px); /* Slight Pressed-In effect on Click */ } - /* Responsive button sizing for mobile for .btn class*/ @media (max-width: 768px) { .btn { From b44c11109af4e0f00ad074c904e54937f4974d09 Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Mon, 13 Nov 2023 11:01:14 +0100 Subject: [PATCH 6/7] revert --- includes/styles.css | 30 +++--------------------------- last_stats.php | 2 +- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/includes/styles.css b/includes/styles.css index 2a8c9a4..85055a8 100644 --- a/includes/styles.css +++ b/includes/styles.css @@ -223,33 +223,7 @@ a { color: #000; /* Dark text on hover */ cursor: pointer; } -.btn:active { - transform: translateY(1px); /* Slight Pressed-In effect on Click */ -} - -.btn_table { - font-family: 'Courier New', monospace; - background: #222; /* Dark background for buttons */ - color: #33ff33; /* Bright green text */ - border: 1px solid #33ff33; /* Border to match text color */ - padding: 0px 0px 0px 0px; - text-transform: uppercase; - transition: background-color 0.3s ease, color 0.3s ease; - max-width: 100px; /* Max width of the button */ - max-height: 30px; /* Max height of the button */ - box-sizing: border-box; /* Include padding and border in width/height */ -} - -.btn_table:hover { - background: #33ff33; /* Bright green background on hover */ - color: #000; /* Dark text on hover */ - cursor: pointer; -} - -.btn_table:active { - transform: translateY(1px); /* Slight Pressed-In effect on Click */ -} /* Responsive button sizing for mobile for .btn class*/ @media (max-width: 768px) { .btn { @@ -257,7 +231,9 @@ a { font-size: 14px; /* Adjust font size for mobile readability */ } } - +.btn:active { + transform: translateY(1px); /* Slight Pressed-In effect on Click */ +} /* Container for tables to manage overflow */ .table-container { overflow-x: auto; diff --git a/last_stats.php b/last_stats.php index eba4d26..87993c9 100644 --- a/last_stats.php +++ b/last_stats.php @@ -99,7 +99,7 @@ error_reporting(E_ALL); echo " -

+ $player_name $winratio $KD_H $KD_ALL From e1b379780e546a65fe9bf9426fe3e67fe722c805 Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Mon, 13 Nov 2023 19:38:34 +0100 Subject: [PATCH 7/7] get matches from cache and lock fix --- config/clanmembers.json | 13 +++++++++++++ update/get_matches.ps1 | 25 +++++++++++++------------ 2 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 config/clanmembers.json diff --git a/config/clanmembers.json b/config/clanmembers.json new file mode 100644 index 0000000..1c44a5d --- /dev/null +++ b/config/clanmembers.json @@ -0,0 +1,13 @@ +{ + "clanMembers": [ + "Lanta01", + "Petje1972", + "TaGMoM", + "r00tger", + "Masistuta", + "RalphNorris", + "Jimbo_The_One", + "SquadKiller101", + "Pettie1972" + ] +} diff --git a/update/get_matches.ps1 b/update/get_matches.ps1 index 769dbf5..c85b08d 100644 --- a/update/get_matches.ps1 +++ b/update/get_matches.ps1 @@ -1,7 +1,3 @@ -. .\..\includes\ps1\lockfile.ps1 - -new-lock - if ($PSScriptRoot.length -eq 0) { $scriptroot = Get-Location } @@ -9,7 +5,8 @@ else { $scriptroot = $PSScriptRoot } - +. $scriptroot\..\includes\ps1\lockfile.ps1 +new-lock # Read the content of the file as a single string $fileContent = Get-Content -Path "$scriptroot/../config/config.php" -Raw @@ -22,12 +19,9 @@ else { Write-Output "API Key not found" } -if ($fileContent -match "\`$clanmembers\s*=\s*array\(([^)]+)\)") { - # Remove quotes and split by comma to get individual members - $clanMembers = ($matches[1] -replace '"|\'', '' -split ","').replace(" ", "") - $clanMembersArray = $clanMembers.split(",").trim() - Write-Output "Clan Members: $($clanMembersArray -join ', ')" -} +$clanMembersArray = (Get-Content "$scriptroot/../config/clanmembers.json" | convertfrom-json).clanmembers +Write-Output "Clan Members: $($clanMembersArray -join ', ')" + else { Write-Output "Clan members not found" } @@ -49,7 +43,14 @@ foreach ($player in $player_data) { $playermatches = @() foreach ($match in $lastMatches) { Write-Host "Getting match for $($player.attributes.name) match: $match " - $stats = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/matches/$match" -Method GET -Headers $headers + if(Test-Path "$scriptroot/../data/matches/$match.json"){ + write-output "Getting $match from cache" + $stats = get-content "$scriptroot/../data/matches/$match.json" | convertfrom-json + }else{ + $stats = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/matches/$match" -Method GET -Headers $headers + $stats | ConvertTo-Json -Depth 100 | Out-File "$scriptroot/../data/matches/$match.json" + } + $playermatches += [PSCustomObject]@{ stats = $stats.included.ATTRIBUTES.stats | where-object { $_.name -eq $player.attributes.name } matchType = $stats.data.attributes.matchtype