From 2e6d45375a748140f5bfebe2a9471369b1bcd8ff Mon Sep 17 00:00:00 2001 From: Zemill <33404722+Zemill@users.noreply.github.com> Date: Mon, 6 May 2024 07:40:32 -0400 Subject: [PATCH 1/3] Update README.md Removes references to rewrite --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index c9d044b1..c35e3d18 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # Heroes Profile [Master Heroes Profile](https://www.heroesprofile.com/)(master branch) -This public repository is the site re-write for [Heroes Profile](https://www.heroesprofile.com/) and is not currently in production. - # Cloning the Heroes Profile repository - `git clone --recursive https://github.com/Heroes-Profile/heroesprofile.git` From 6a9a53d0249a79fa42d9be66e3bcec9891fd9738 Mon Sep 17 00:00:00 2001 From: Zemill <33404722+Zemill@users.noreply.github.com> Date: Mon, 13 May 2024 13:06:50 -0400 Subject: [PATCH 2/3] Adds a manual override for ad free --- app/Http/Middleware/CheckIfPatreonSupporter.php | 4 ++++ app/Http/Middleware/LogIPAndUserAgent.php | 6 ++++++ app/Models/BattlenetAccount.php | 1 + 3 files changed, 11 insertions(+) diff --git a/app/Http/Middleware/CheckIfPatreonSupporter.php b/app/Http/Middleware/CheckIfPatreonSupporter.php index d83eb1f4..4db0adcd 100644 --- a/app/Http/Middleware/CheckIfPatreonSupporter.php +++ b/app/Http/Middleware/CheckIfPatreonSupporter.php @@ -35,6 +35,10 @@ public function handle(Request $request, Closure $next): Response } } + if($user->flair_adfree_override == 1){ + session(['patreonSubscriberAdFree' => true]); + session(['patreonSubscriberSiteFlair' => true]); + } } return $next($request); diff --git a/app/Http/Middleware/LogIPAndUserAgent.php b/app/Http/Middleware/LogIPAndUserAgent.php index 2dd1b4ac..81629dd1 100644 --- a/app/Http/Middleware/LogIPAndUserAgent.php +++ b/app/Http/Middleware/LogIPAndUserAgent.php @@ -7,6 +7,8 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Cookie; use Symfony\Component\HttpFoundation\Response; +use Illuminate\Support\Facades\Auth; +use App\Models\BattlenetAccount; class LogIPAndUserAgent { @@ -17,6 +19,10 @@ class LogIPAndUserAgent */ public function handle(Request $request, Closure $next): Response { + + //$user = BattlenetAccount::find(1); + //Auth::login($user); + try { Cookie::queue(Cookie::forget('additional-battletags')); $ip = ''; diff --git a/app/Models/BattlenetAccount.php b/app/Models/BattlenetAccount.php index 029d9f73..d5fe1d5c 100644 --- a/app/Models/BattlenetAccount.php +++ b/app/Models/BattlenetAccount.php @@ -28,6 +28,7 @@ class BattlenetAccount extends Authenticatable 'updated_at', 'created_at', 'private', + 'flair_adfree_override', ]; public function patreonAccount() From bb894d69ba6f72c78fabad19f0bbc57874563e19 Mon Sep 17 00:00:00 2001 From: Zemill <33404722+Zemill@users.noreply.github.com> Date: Thu, 16 May 2024 07:34:29 -0400 Subject: [PATCH 3/3] Fixes issue with +1 min games played being shown --- app/Http/Controllers/Player/PlayerHeroesMapsRolesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Player/PlayerHeroesMapsRolesController.php b/app/Http/Controllers/Player/PlayerHeroesMapsRolesController.php index 9b1dc73b..9bcff171 100644 --- a/app/Http/Controllers/Player/PlayerHeroesMapsRolesController.php +++ b/app/Http/Controllers/Player/PlayerHeroesMapsRolesController.php @@ -782,7 +782,7 @@ public function getData(Request $request) if ($minimum_games && $minimum_games > 0) { $filteredData = array_filter($returnData, function ($item) use ($minimum_games) { - return $item['games_played'] > $minimum_games; + return $item['games_played'] >= $minimum_games; }); $returnData = array_values($filteredData);