From 599c997d2b44537ebec5a4472c853a453ec18a24 Mon Sep 17 00:00:00 2001 From: "Mr. Snowy" Date: Sat, 25 Nov 2023 20:10:29 +0100 Subject: [PATCH] massive code changes :3 rewrote all scripts and added homebrew support. --- .gitattributes | 2 - .gitignore | 19 +- document_errors/403.html | 119 +++ document_errors/404.html | 12 + document_errors/410.html | 119 +++ document_errors/50x.html | 122 +++ private_html | Bin 34 -> 0 bytes public_html/400.shtml | 301 -------- public_html/401.shtml | 89 --- public_html/403.shtml | 257 ------- public_html/404.php | 12 - public_html/500.shtml | 216 ------ .../arrow_back.svg => _images/arrow.svg} | 0 .../{parts/images => _images}/boosty.svg | 7 +- public_html/_images/close.svg | 1 + .../{parts/images => _images}/dark_mode.svg | 0 public_html/_images/discord.svg | 1 + public_html/{images => _images}/fpPS4Logo.png | Bin .../{images => _images}/fpPS4Logo1080.png | Bin .../{images => _images}/fpPS4Logo512.png | Bin .../{parts/images => _images}/github.svg | 2 +- .../{parts/images => _images}/light_mode.svg | 0 public_html/_images/menu.svg | 1 + public_html/{parts => _parts}/footer.html | 0 public_html/{parts => _parts}/navbar.html | 12 +- public_html/_parts/required.js | 104 +++ public_html/{scripts => _scripts}/api.php | 30 +- public_html/{scripts => _scripts}/search.php | 141 ++-- public_html/_scripts/updater.php | 336 +++++++++ public_html/compatibility/app.js | 693 +++++++----------- public_html/compatibility/index.html | 22 +- public_html/compatibility/styles.css | 36 +- public_html/images/NA.avif | Bin 998 -> 0 bytes public_html/images/NA.jpg | Bin 1839 -> 0 bytes public_html/images/NA.png | Bin 1457 -> 0 bytes public_html/images/arrow_forward.svg | 1 - public_html/images/fpPS4-icon.png | Bin 1486 -> 0 bytes public_html/index.html | 165 ++--- public_html/parts/images/boostySmol.svg | 12 - public_html/parts/images/close.svg | 1 - public_html/parts/images/discord.svg | 1 - public_html/parts/images/menu.svg | 1 - public_html/parts/images/unused/close.svg | 1 - public_html/parts/images/unused/dark_mode.svg | 1 - .../unused/discord-mark-black-crop-opti.svg | 1 - .../parts/images/unused/github-mark-black.svg | 1 - public_html/parts/images/unused/menu.svg | 1 - public_html/scripts/issue_fetcher.php | 496 ------------- public_html/sizes.css | 4 +- public_html/style.css | 28 +- public_html/styles.css | 0 51 files changed, 1268 insertions(+), 2100 deletions(-) delete mode 100644 .gitattributes create mode 100644 document_errors/403.html create mode 100644 document_errors/404.html create mode 100644 document_errors/410.html create mode 100644 document_errors/50x.html delete mode 120000 private_html delete mode 100644 public_html/400.shtml delete mode 100644 public_html/401.shtml delete mode 100644 public_html/403.shtml delete mode 100644 public_html/404.php delete mode 100644 public_html/500.shtml rename public_html/{images/arrow_back.svg => _images/arrow.svg} (100%) rename public_html/{parts/images => _images}/boosty.svg (93%) create mode 100644 public_html/_images/close.svg rename public_html/{parts/images => _images}/dark_mode.svg (100%) create mode 100644 public_html/_images/discord.svg rename public_html/{images => _images}/fpPS4Logo.png (100%) rename public_html/{images => _images}/fpPS4Logo1080.png (100%) rename public_html/{images => _images}/fpPS4Logo512.png (100%) rename public_html/{parts/images => _images}/github.svg (86%) rename public_html/{parts/images => _images}/light_mode.svg (100%) create mode 100644 public_html/_images/menu.svg rename public_html/{parts => _parts}/footer.html (100%) rename public_html/{parts => _parts}/navbar.html (75%) create mode 100644 public_html/_parts/required.js rename public_html/{scripts => _scripts}/api.php (89%) rename public_html/{scripts => _scripts}/search.php (54%) create mode 100644 public_html/_scripts/updater.php delete mode 100644 public_html/images/NA.avif delete mode 100644 public_html/images/NA.jpg delete mode 100644 public_html/images/NA.png delete mode 100644 public_html/images/arrow_forward.svg delete mode 100644 public_html/images/fpPS4-icon.png delete mode 100644 public_html/parts/images/boostySmol.svg delete mode 100644 public_html/parts/images/close.svg delete mode 100644 public_html/parts/images/discord.svg delete mode 100644 public_html/parts/images/menu.svg delete mode 100644 public_html/parts/images/unused/close.svg delete mode 100644 public_html/parts/images/unused/dark_mode.svg delete mode 100644 public_html/parts/images/unused/discord-mark-black-crop-opti.svg delete mode 100644 public_html/parts/images/unused/github-mark-black.svg delete mode 100644 public_html/parts/images/unused/menu.svg delete mode 100644 public_html/scripts/issue_fetcher.php create mode 100644 public_html/styles.css diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index dfe0770..0000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto diff --git a/.gitignore b/.gitignore index 5c55c2b..73cd475 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,7 @@ -/.htpasswd +/_config /.vscode -/config -/logs -/public_ftp -/stats -public_html/beta -public_html/cgi-bin -public_html/.htaccess -public_html/ads.txt -public_html/images/Thumbs.db -public_html/images/CUSA -public_html/images/HOMEBREW -public_html/scripts/HBstore.db \ No newline at end of file +/public_html/_images/CUSA +/public_html/_images/HB +/public_html/_images/TEST +/public_html/.htaccess +/public_html/.user.ini \ No newline at end of file diff --git a/document_errors/403.html b/document_errors/403.html new file mode 100644 index 0000000..2c045f4 --- /dev/null +++ b/document_errors/403.html @@ -0,0 +1,119 @@ + + + + + + Access Denied + + + +
+
+
+
+ + + +
+

Access Denied

+
+

You do not have permission to view this page.

+

Please check your credentials and try again.

+ +
+
+
+
+ + diff --git a/document_errors/404.html b/document_errors/404.html new file mode 100644 index 0000000..d536dfb --- /dev/null +++ b/document_errors/404.html @@ -0,0 +1,12 @@ + + +404 :/ + + + + +

404: Not Found :/

+The requested URL was not found on this server. +
+

fpPS4.net

+ \ No newline at end of file diff --git a/document_errors/410.html b/document_errors/410.html new file mode 100644 index 0000000..515d849 --- /dev/null +++ b/document_errors/410.html @@ -0,0 +1,119 @@ + + + + + + Resource is Gone + + + +
+
+
+
+ + + +
+

Resource is Gone

+
+

Oops! The requested resource is no longer available.

+

Please check the address and try again.

+ +
+
+
+
+ + diff --git a/document_errors/50x.html b/document_errors/50x.html new file mode 100644 index 0000000..b8f51ba --- /dev/null +++ b/document_errors/50x.html @@ -0,0 +1,122 @@ + + + + + + Internal Server Error + + + +
+
+
+
+ + + +
+

Internal Server Error

+
+

Oops! Something went wrong.

+

+ The server encountered an internal error or misconfiguration and was unable to + complete your request. +

+ +
+
+
+
+ + diff --git a/private_html b/private_html deleted file mode 120000 index 6993f280376f8bece2fbadbb4dd77060d1a66124..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 34 pcmeawE2;4D^Jdgz&}S%MC}l`u$YIE2NM?v<$Y3a8$Ysc30056K2YLVi diff --git a/public_html/400.shtml b/public_html/400.shtml deleted file mode 100644 index e72a137..0000000 --- a/public_html/400.shtml +++ /dev/null @@ -1,301 +0,0 @@ - - -400 Bad Request - -

Bad Request

-There was an error in your request. -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public_html/401.shtml b/public_html/401.shtml deleted file mode 100644 index ef995a6..0000000 --- a/public_html/401.shtml +++ /dev/null @@ -1,89 +0,0 @@ - - -401 Authorization Required - -

Authorization Required

-This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required. -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public_html/403.shtml b/public_html/403.shtml deleted file mode 100644 index 71f9b2f..0000000 --- a/public_html/403.shtml +++ /dev/null @@ -1,257 +0,0 @@ - - -403 Forbidden - -

Forbidden

-You don't have permission to access on this server. -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public_html/404.php b/public_html/404.php deleted file mode 100644 index 814f13a..0000000 --- a/public_html/404.php +++ /dev/null @@ -1,12 +0,0 @@ - - -404 :/ - - - - -

404: Not Found :/

-The requested URL was not found on this server. -
-

fpPS4.net

- \ No newline at end of file diff --git a/public_html/500.shtml b/public_html/500.shtml deleted file mode 100644 index 9289ca9..0000000 --- a/public_html/500.shtml +++ /dev/null @@ -1,216 +0,0 @@ - - -500 Internal Server Error - -

Internal Server Error

-The server encountered an internal error or misconfiguration and was unable to complete your request -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public_html/images/arrow_back.svg b/public_html/_images/arrow.svg similarity index 100% rename from public_html/images/arrow_back.svg rename to public_html/_images/arrow.svg diff --git a/public_html/parts/images/boosty.svg b/public_html/_images/boosty.svg similarity index 93% rename from public_html/parts/images/boosty.svg rename to public_html/_images/boosty.svg index e7e2f39..b1aadf2 100644 --- a/public_html/parts/images/boosty.svg +++ b/public_html/_images/boosty.svg @@ -1,10 +1,11 @@ + - + - - + + diff --git a/public_html/_images/close.svg b/public_html/_images/close.svg new file mode 100644 index 0000000..8e41956 --- /dev/null +++ b/public_html/_images/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public_html/parts/images/dark_mode.svg b/public_html/_images/dark_mode.svg similarity index 100% rename from public_html/parts/images/dark_mode.svg rename to public_html/_images/dark_mode.svg diff --git a/public_html/_images/discord.svg b/public_html/_images/discord.svg new file mode 100644 index 0000000..d92bd39 --- /dev/null +++ b/public_html/_images/discord.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public_html/images/fpPS4Logo.png b/public_html/_images/fpPS4Logo.png similarity index 100% rename from public_html/images/fpPS4Logo.png rename to public_html/_images/fpPS4Logo.png diff --git a/public_html/images/fpPS4Logo1080.png b/public_html/_images/fpPS4Logo1080.png similarity index 100% rename from public_html/images/fpPS4Logo1080.png rename to public_html/_images/fpPS4Logo1080.png diff --git a/public_html/images/fpPS4Logo512.png b/public_html/_images/fpPS4Logo512.png similarity index 100% rename from public_html/images/fpPS4Logo512.png rename to public_html/_images/fpPS4Logo512.png diff --git a/public_html/parts/images/github.svg b/public_html/_images/github.svg similarity index 86% rename from public_html/parts/images/github.svg rename to public_html/_images/github.svg index 486f196..bc3b562 100644 --- a/public_html/parts/images/github.svg +++ b/public_html/_images/github.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/public_html/parts/images/light_mode.svg b/public_html/_images/light_mode.svg similarity index 100% rename from public_html/parts/images/light_mode.svg rename to public_html/_images/light_mode.svg diff --git a/public_html/_images/menu.svg b/public_html/_images/menu.svg new file mode 100644 index 0000000..a4abdfe --- /dev/null +++ b/public_html/_images/menu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public_html/parts/footer.html b/public_html/_parts/footer.html similarity index 100% rename from public_html/parts/footer.html rename to public_html/_parts/footer.html diff --git a/public_html/parts/navbar.html b/public_html/_parts/navbar.html similarity index 75% rename from public_html/parts/navbar.html rename to public_html/_parts/navbar.html index 94f673c..de6746c 100644 --- a/public_html/parts/navbar.html +++ b/public_html/_parts/navbar.html @@ -64,17 +64,17 @@ \ No newline at end of file diff --git a/public_html/_parts/required.js b/public_html/_parts/required.js new file mode 100644 index 0000000..0f00cd1 --- /dev/null +++ b/public_html/_parts/required.js @@ -0,0 +1,104 @@ +let lightTheme = false; + +const lightThemeCookie = checkCookies("lightTheme", "false"); +if (lightThemeCookie === "true") { + lightTheme = true; + document.body.classList.toggle("lightMode"); +} +//- Checks cookies + +function LightModeIconChange() { + if (lightTheme === true) { + document.getElementById("lightModeIcon").style.display = "flex"; + document.getElementById("darkModeIcon").style.display = "none"; + } else { + document.getElementById("darkModeIcon").style.opacity = "1"; + } +} + +// Cookies +function setCookie(name, value) { + var date = new Date(); + date.setMonth(date.getMonth() + 3); + var expires = "; expires=" + date.toUTCString(); + document.cookie = name + "=" + value + expires + "; path=/"; + } + +function checkCookies(name, defaultValue) { + return document.cookie.split("; ").find(c => c.startsWith(name + "="))?.split("=")[1] ?? defaultValue; // if cookie doesnt exist use the default value +} + +function toggleLightMode() { + lightTheme = !lightTheme; + setCookie("lightTheme", lightTheme); + document.body.classList.toggle("lightMode"); + var x = document.getElementById("darkModeIcon") + var y = document.getElementById("lightModeIcon") + if (y.style.display === "none" || y.style.display == '') { + y.style.display = "flex"; + x.style.display = "none"; + } else { + x.style.opacity = "1"; + x.style.display = "flex"; + y.style.display = "none"; + }; + }; + +function toggleMenu() { + // var x = document.getElementById("overlay"); + var y = document.getElementById("close-icon") + var z = document.getElementById("menu-icon") + console.log('pretend like you see a menu') + if (y.style.display === "none" || y.style.display == '') { + // x.style.display = "flex"; + y.style.display = "flex"; + z.style.display = "none"; + setTimeout(function() { + // x.style.opacity = 1; + }, 50); + } else { + // x.style.opacity = 0; + y.style.display = "none"; + z.style.display = "flex"; + setTimeout(function() { + // x.style.display = "none"; + }, 300); + }; +}; + +// update footer position +function updateFooter() { + const viewportHeight = window.innerHeight; + const bodyHeight = document.body.clientHeight; + if (bodyHeight < viewportHeight) { + document.getElementById('footer').style.position = 'fixed'; + } else { + document.getElementById('footer').style = ''; + } +} + +// Adjust screen size for mobile and 4k monitors for some reason +function adjustScreenSize() { + var screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; + var referenceWidth = 2000; + var referenceFontSize = 16; + var phoneReferenceWidth = 550; + + if (screenWidth >= referenceWidth) { // 2000 ++ + var fontSize = (screenWidth / referenceWidth) * referenceFontSize; + document.documentElement.style.width = ""; + document.documentElement.style.fontSize = fontSize + 'px'; + + } else if (screenWidth >= phoneReferenceWidth) { // 550 - 2000 + document.documentElement.style.fontSize = referenceFontSize + 'px'; + document.documentElement.style.width = ""; + + } else { // -- 550 + var fontSize = (screenWidth / phoneReferenceWidth) * referenceFontSize; + document.documentElement.style.width = screenWidth + "px"; + var viewport = document.querySelector('meta[name="viewport"]'); + viewport.content = "initial-scale=1"; + document.documentElement.style.zoom = "1"; + document.documentElement.style.fontSize = fontSize + 'px'; + } +} \ No newline at end of file diff --git a/public_html/scripts/api.php b/public_html/_scripts/api.php similarity index 89% rename from public_html/scripts/api.php rename to public_html/_scripts/api.php index 8b2cc9a..aab7eb8 100644 --- a/public_html/scripts/api.php +++ b/public_html/_scripts/api.php @@ -3,53 +3,33 @@ $serverUsername = getenv('USERNAME'); require_once "/home/{$serverUsername}/domains/fpps4.net/config/config.php"; // import config file $validSecret = API_ACCESS_SECRET; $validArgument = API_ARGUMENT_SECRET; - $headers = apache_request_headers(); -// foreach ($headers as $header => $value) { - -// if ($header === "Token") { - -// if ($value === $validSecret) { -// die('yeey you got in !'); -// } -// } -// } - - /// makes it so the api is accessible by: headers, browser query and by command line arguments :3 if ((isset($_GET[$validArgument]) && $_GET[$validArgument] === $validSecret) || (isset($argv[1]) && $argv[1] === $validSecret) || isset($_SERVER['HTTP_AUTHORIZATION']) === $validSecret) { - /// processing user input $cusaCodes = isset($_GET['cusa']) ? $_GET['cusa'] : ''; $homebrews = isset($_GET['homebrew']) ? $_GET['homebrew'] : ''; - $cusaCodes = filter_var($cusaCodes, FILTER_SANITIZE_STRING); $homebrews = filter_var($homebrews, FILTER_SANITIZE_STRING); - - if ($cusaCodes || $homebrews) { - /// make connection to database $host = DATABASE_HOST; $database = DATABASE_NAME; $username = DATABASE_USERNAME; $password = DATABASE_PASSWORD; - try { $conn = new PDO("mysql:host=$host;dbname=$database", $username, $password); } catch (PDOException $e) { die("The server got itself into trouble, sorry for that."); } - /// variables $cusacodeArray = array(); $homebrewArray = array(); $cusacode = explode(',', $cusaCodes); $homebrew = explode(',', $homebrews); - /// handles cusa codes and gets status if ($cusaCodes) { foreach ($cusacode as $code) { @@ -58,7 +38,6 @@ if ($cusaCodes || $homebrews) { $stmt->bindParam(':cusacode', $code, PDO::PARAM_STR); $stmt->execute(); $result = $stmt->fetchAll(PDO::FETCH_ASSOC); - // print_r($result); // debug if ($result) { $tag = $result["0"]["tags"]; @@ -66,14 +45,12 @@ if ($cusaCodes || $homebrews) { $tag = "N/A"; } - // echo "$tag"; // debug $cusacodeArray[] = array( "id" => $code, "tag" => $tag ); } } - if ($homebrews) { foreach ($homebrew as $code) { $query = "SELECT tags FROM issues WHERE title = :homebrew"; @@ -81,35 +58,30 @@ if ($cusaCodes || $homebrews) { $stmt->bindParam(':homebrew', $code, PDO::PARAM_STR); $stmt->execute(); $HBresult = $stmt->fetchAll(PDO::FETCH_ASSOC); - // print_r($HBresult); // debug if ($HBresult) { $tag = $HBresult["0"]["tags"]; } else { $tag = "N/A"; } - $homebrewArray[] = array( "title" => $code, "tag" => $tag ); } } - $data = array( "cusacode" => $cusacodeArray, "homebrew" => $homebrewArray ); - /// end header('Content-Type: application/json'); $jsonData = json_encode($data); //$jsonData = json_encode($data, JSON_PRETTY_PRINT); + echo $jsonData; $conn = null; //exit connection } - - } else { http_response_code(404); include("/home/{$serverUsername}/domains/fpps4.net/public_html/404.php"); diff --git a/public_html/scripts/search.php b/public_html/_scripts/search.php similarity index 54% rename from public_html/scripts/search.php rename to public_html/_scripts/search.php index 6d92436..5f6da34 100644 --- a/public_html/scripts/search.php +++ b/public_html/_scripts/search.php @@ -1,40 +1,32 @@ "; } - - + /// processing user input - $searchQuery = isset($_GET['q']) ? $_GET['q'] : ''; - $tags = isset($_GET['tag']) ? $_GET['tag'] : ''; - $page = isset($_GET['page']) ? $_GET['page'] : 1; - $oldest = isset($_GET['oldest']) ? $_GET['oldest'] : false; - $giveStats = isset($_GET['stats']) ? true : false; - - $searchQuery = filter_var($searchQuery, FILTER_SANITIZE_STRING); - $tags = filter_var($tags, FILTER_SANITIZE_STRING); - $page = filter_var($page, FILTER_VALIDATE_INT); - $oldest = filter_var($oldest, FILTER_VALIDATE_BOOLEAN); - $giveStats = filter_var($giveStats, FILTER_VALIDATE_BOOLEAN); - + $searchQuery = htmlspecialchars(isset($_GET['q']) ? $_GET['q'] : ""); + $tags = htmlspecialchars(isset($_GET['tag']) ? $_GET['tag'] : ""); + $page = filter_var(isset($_GET['page']) ? $_GET['page'] : 1, FILTER_VALIDATE_INT); + $oldest = filter_var(isset($_GET['oldest']) ? $_GET['oldest'] : false, FILTER_VALIDATE_BOOLEAN); + $giveStats = filter_var(isset($_GET['stats']) ? true : false, FILTER_VALIDATE_BOOLEAN); + + if ($page < 0 || $page === 0) { + $page = 1; + } /// defining stuff lmao $maxResults = (!empty($searchQuery)) ? 10 : 20; @@ -48,7 +40,7 @@ if (!empty($searchQuery)) { $searchQuery = strtolower($searchQuery); if (strpos($searchQuery, 'cusa') !== false) { - $conditions[] = "cusaCode LIKE :searchQuery"; + $conditions[] = "code LIKE :searchQuery"; } else { $conditions[] = "title LIKE :searchQuery"; } @@ -74,13 +66,11 @@ } } - -/// im too lazy to write a comment if (!empty($conditions)) { $sqlQuery .= " WHERE " . implode(" AND ", $conditions); } - + /// gets the total amount of issues based on the search query $sqlQueryForTotal = "SELECT COUNT(*) AS total FROM ($sqlQuery) AS totalIssues"; $stmtTotal = $conn->prepare($sqlQueryForTotal); @@ -92,11 +82,7 @@ $stmtTotal->execute(); $totalIssuesAmount = $stmtTotal->fetch(PDO::FETCH_ASSOC)['total']; $totalPages = ceil($totalIssuesAmount / $maxResults); - echo "
"; - if ($totalIssuesAmount < 1) { - echo "

No results found based on your query

"; - echo "

¯\_(ツ)_/¯

"; - } + /// forming and executing sql query $sqlQuery .= " ORDER BY id " . ($oldest ? "ASC" : "DESC"); @@ -119,43 +105,40 @@ /// Outputing results - foreach ($result as $row) { - $id = $row['id']; - $cusaCode = $row['cusaCode']; - $clean_title = $row['title']; - $tags = $row['tags']; - $updatedAt = $row['updatedDate']; - - $dataCusa = ''; - $avifIconURL = "../images/CUSA/{$cusaCode}.avif"; - if (!file_exists($avifIconURL)) { - $dataCusa = null; // Skip image - } else { - $dataCusa = $cusaCode; - } - - echo "
"; - echo ""; - echo "$clean_title"; - echo ""; - echo "
"; - echo "
"; - echo "

$clean_title

"; - echo "

$cusaCode

"; - echo "

$tags

"; - echo "
"; - echo "
"; +header('Content-Type: application/json'); + +$games = array(); +$stats = array(); + + foreach ($result as $game) { + $cusaCode = $game['code']; + $image = $game['type'] === "HB" ? (file_exists("$dir/public_html/_images/HB/{$game['title']}.avif") ? true : false) : (file_exists("$dir/public_html/_images/CUSA/{$cusaCode}.avif") ? true : false); + $games[] = array( + "id" => $game['id'], + "title" => $game['title'], + "code" => $game['code'], + "type" => $game['type'], + "tag" => $game['tags'], + "upDate" => $game['updatedDate'], + "image" => $image + ); } - -/// stats on the compatibility list + /// stats on the compatibility list if ($giveStats === true) { - $availableTags = ['N/A', 'Nothing', 'Boots', 'Menus', 'Ingame', 'Playable']; + $availableTags = ['Nothing', 'Boots', 'Menus', 'Ingame', 'Playable']; $tagPercentages = []; - $stmt = $conn->prepare("SELECT COUNT(*) AS total FROM issues"); + $naTag = "N/A"; + $stmt = $conn->prepare("SELECT COUNT(*) AS count FROM issues WHERE tags = :tag"); + $stmt->bindParam(':tag', $naTag, PDO::PARAM_STR); $stmt->execute(); - $total = $stmt->fetch(PDO::FETCH_ASSOC)['total']; + $naCount = $stmt->fetch(PDO::FETCH_ASSOC)['count']; + + $result = $conn->query("SELECT COUNT(*) FROM issues"); + $total = $result->fetchColumn(); + + $totalIssuesWithoutNA = $total - $naCount; foreach ($availableTags as $tag) { $stmt = $conn->prepare("SELECT COUNT(*) AS count FROM issues WHERE tags = :tag"); @@ -170,17 +153,37 @@ $amount = (100 - array_sum($tagPercentages)) / count($tagPercentages); - foreach ($tagPercentages as $tag => $percentage) { + foreach ($availableTags as $tag) { + $percentage = $tagPercentages[$tag]; + $count = $tagCount[$tag]; $percentage += $amount; $percentage = round($percentage, 2); - echo "
"; + $stats[] = array( + "tag" => $tag, + "percent" => $percentage, + "count" => $count + ); } } + $executionTime = round((microtime(true) - $startTime) * 1000, 2); // Convert to milliseconds + + $info = array( + "issues" => $totalIssuesAmount, + "pages" => $totalPages, + "time" => $executionTime + ); + + $data = array( + "info" => $info, + "games" => $games, + "stats" => $stats, + ); + -/// end + /// end + $jsonData = json_encode($data); + // $jsonData = json_encode($data, JSON_PRETTY_PRINT); + echo $jsonData; $conn = null; //exit connection - $endTime = microtime(true); - $executionTime = round(($endTime - $startTime) * 1000, 2); // Convert to milliseconds - echo "

$totalIssuesAmount results in {$executionTime}ms

"; -?> \ No newline at end of file +?> diff --git a/public_html/_scripts/updater.php b/public_html/_scripts/updater.php new file mode 100644 index 0000000..2058e22 --- /dev/null +++ b/public_html/_scripts/updater.php @@ -0,0 +1,336 @@ +
"; + $dir = dirname(__DIR__, 2); + require_once "$dir/_config/config.php"; // import config file + + if ((isset($_GET[ARGUMENT_SECRET]) && $_GET[ARGUMENT_SECRET] === ACCESS_SECRET) || (isset($argv[1]) && $argv[1] === ARGUMENT_SECRET)) { + // echo""; + function ErrorHandler($errLvl, $errMesg, $errFile, $errLine) { + $position = strpos($errMesg, "/"); + $errMesg = $position !== false ? substr($errMesg,0, $position) : $errMesg; // check for an "/" and remove stuff + + switch ($errLvl) { + case E_ERROR || E_USER_ERROR: + $error = "Error: $errMesg [line: $errLine]"; + break; + case E_WARNING || E_USER_WARNING: + $error = "Warning: $errMesg [line: $errLine]"; + break; + case E_NOTICE || E_USER_NOTICE: + $error = "Notice: $errMesg [line: $errLine]"; + break; + default: + $error = "Unknown error: $errMesg [line: $errLine]"; + break; + } + $fullError = "Something went wrong => $error
"; + throw new Exception("$fullError"); + } + set_error_handler("ErrorHandler"); + + $host = DATABASE_HOST; + $database = DATABASE_NAME; + $username = DATABASE_USERNAME; + $password = DATABASE_PASSWORD; + + $githubToken = GITHUB_TOKEN; + $tmdbHash = TMDB_HASH; + $HBheader = stream_context_create(["http" => ["header" => "User-Agent: " . HB_USERAGENT ."\r\n"]]); + + // get homebrew db for images + try { + if (date("i") > 58 || date("i") < 3) { + $response = file_get_contents("https://api.pkg-zone.com/api.php?db_check_hash=true", false, $HBheader); + $hash = json_decode($response)->hash; //get hash from json + $md5Hash = file_exists("$dir/_config/HBstore.db") ? md5_file("$dir/_config/HBstore.db") : "0"; + + if ($hash !== $md5Hash) { + $fileContent = file_get_contents("https://api.pkg-zone.com/store.db", false, $HBheader); + file_put_contents("$dir/_config/HBstore.db", $fileContent); + } + } + } catch (Exception $e) { + print($e); + file_exists("$dir/_config/HBstore.db") ? print("Ignoring for now
") : die("Critical error, stopping
"); + + } finally {print("Homebrew database download task "); date("i") > 58 || date("i") < 3 ? print("completed!
") : print("skipped!
");} + + + // database connection and table creation + try { + $homebrewDB = new PDO("sqlite:$dir/_config/HBstore.db"); + $conn = new PDO("mysql:host=$host;dbname=$database", $username, $password); + $conn->query("DROP TABLE IF EXISTS newIssues"); + + // creating tables + $sqlQuerys = [ + "CREATE TABLE IF NOT EXISTS issues ( + id INT(5) PRIMARY KEY, + code VARCHAR(10), + title VARCHAR(130), + tags VARCHAR(200), + type VARCHAR(6), + updatedDate VARCHAR(12), + createdDate VARCHAR(12) + )", + "CREATE TABLE IF NOT EXISTS newIssues ( + id INT(5) PRIMARY KEY, + code VARCHAR(10), + title VARCHAR(130), + tags VARCHAR(200), + type VARCHAR(6), + updatedDate VARCHAR(12), + createdDate VARCHAR(12) + )", + "CREATE TABLE IF NOT EXISTS GameSkips ( + code VARCHAR(130) PRIMARY KEY + )" + ]; + + foreach ($sqlQuerys as $sql) { + $conn->exec($sql); + } + + } catch (Exception $e) { + print($e); + die("Critical error, stopping
"); + } finally {echo"Database connection and table creation task completed!
";} + + + function githubRequest(string $token, int $count, string $url) { + $curl_handle = curl_init(); + curl_setopt($curl_handle, CURLOPT_URL, $url); + curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('Accept: application/vnd.github+json', 'Authorization: Bearer '.$token)); + curl_setopt($curl_handle, CURLOPT_USERAGENT, "fpPS4.net"); + curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); + $data = curl_exec($curl_handle); + curl_close($curl_handle); + + $count++; + return json_decode($data, true); + } + + function imageDownloader(string $url, $header, string $location) { + $httpsUrl = str_replace('http://', 'https://', $url); + $imageData = file_get_contents($httpsUrl, false, $header); + + $imagick = new Imagick(); + if ($imagick->readImageBlob($imageData)) { + $imageFormat = $imagick->getImageFormat(); + if ($imageFormat == 'JPEG' || $imageFormat == 'PNG') { + $imagick->setImageFormat('avif'); + $imagick->setCompressionQuality(75); + $imagick->setImageProperty('avif:effort', '10'); + $imagick->setImageProperty('avif:speed', '1'); + $imagick->thumbnailImage(256, 256, true); + $imagick->stripImage(); + $imagick->writeImage($location); // save the image + } + } + $imagick->clear(); + $imagick->destroy(); + } + + try { + $ghRequests = 0; + $issueCount = githubRequest($githubToken, $ghRequests, "https://api.github.com/repos/red-prig/fpps4-game-compatibility")['open_issues_count']; + $pageCount = ceil($issueCount / 100); + echo "Total Issues: " . $issueCount . "
"; + echo "Total Pages: " . $pageCount . "

"; + $issuesProcessed = 0; + $noImage = 0; + + for ($page = 1; $page <= $pageCount; $page++) { + $issues = githubRequest($githubToken, $ghRequests, "https://api.github.com/repos/red-prig/fpps4-game-compatibility/issues?page=$page&per_page=100&state=open&direction=ASC"); + + foreach ($issues as $issue) { + $id = filter_var($issue['number'], FILTER_VALIDATE_INT); + $title = htmlspecialchars($issue['title']); + $tags = htmlspecialchars(implode(', ', array_column($issue['labels'], 'name'))); + $createdDate = htmlspecialchars(date('d/m/Y', strtotime($issue['created_at']))); + $updatedDate = htmlspecialchars(date('d/m/Y', strtotime($issue['updated_at']))); + $code = ""; + $type = ""; + + // skip invalid issues + if (str_contains($tags,"question") || str_contains($tags,"invalid")) { + continue; + } + + // look for an code in the title, for example: CUSA12345 or NPXS00000 and do some processing + preg_match('/[a-zA-Z]{4}[0-9]{5}/', $title, $matches); + if ($matches) { + str_starts_with($matches[0], "CUSA") ? ($code = $matches[0]) && ($type = "CUSA") : ""; + str_contains($tags, "app-homebrew") ? ($code = $matches[0]) && ($type = "HB") : ""; + str_contains($tags, "app-system-fw505") ? ($code = $matches[0]) && ($type = "SYS") : ""; + str_contains($tags, "app-ps2game") ? ($code = "PS2 GAME") : ""; + $title = str_replace(["- " . $matches[0], "-" . $matches[0], $matches[0]], "", $title); + } else { + str_contains($tags, "app-homebrew") ? ($code = "HOMEBREW") && ($type = "HB") : ""; + } + + $title = str_ireplace(["(Homebrew)", "- HOMEBREW", "Homebrew", "[]"], "", $title); + $title = rtrim($title, " -"); + + // if (empty($code)) { + // echo "skipping: $title
"; + // continue; + // } + $issuesProcessed++; + + // Now put it into a database :3 + try { + + // tag bullshit AHHHHH + if ($tags) { + $tags = str_ireplace(["status-", "app-homebrew", "app-system-fw505", "app-ps2game"], '', $tags); + + $priority = [ + 'playable', + 'ingame', + 'menus', + 'boots', + 'nothing' + ]; + + $tagArray = array_map('trim', explode(', ', $tags)); + + // headache, prioritizes tags + usort($tagArray, function ($a, $b) use ($priority) { + $priorityA = array_search($a, $priority); + $priorityB = array_search($b, $priority); + + $priorityA = ($priorityA === false) ? 0 : $priorityA; + $priorityB = ($priorityB === false) ? 0 : $priorityB; + + return $priorityB <=> $priorityA; + }); + + // Take the best tag and capitalize it + // $highestPriority = ucfirst($tagArray[0]); + $tagArray = array_slice($tagArray, 0, 1); + + // // Remove tags that are in the priority array + // $tagArray = array_filter($tagArray, function ($tag) use ($priority) { + // return !in_array($tag, $priority); + // }); + + // // Add the best tag to the beginning of the array + // array_unshift($tagArray, $highestPriority); + + $tags = ucfirst(implode(', ', $tagArray)); + + } else {$tags = "N/A";} + + + $insertQuery = "INSERT INTO newIssues (id, code, title, tags, type, updatedDate, createdDate) VALUES (?, ?, ?, ?, ?, ?, ?)"; + $stmt = $conn->prepare($insertQuery); + + $stmt->execute([$id, $code, $title, $tags, $type, $updatedDate, $createdDate]); + } catch (Exception $e) { + echo("Error inserting issue: $e"); + } + + + // Now download images :3 + try { + $cusaDir = "$dir/public_html/_images/CUSA/$code.avif"; + $hbDir = "$dir/public_html/_images/HB/$title.avif"; + + if ($type === "CUSA" && !file_exists($cusaDir)) { + $stmt = $conn->prepare('SELECT * FROM GameSkips WHERE code = :code COLLATE utf8mb4_general_ci'); // check if it needs to be skipped + $stmt->execute(['code' => $code]); + $result = $stmt->fetch(PDO::FETCH_ASSOC); + + if(!$result) + { + $key = hex2bin($tmdbHash); + $hash = strtoupper(hash_hmac("sha1", "{$code}_00", $key)); + $url = "https://tmdb.np.dl.playstation.net/tmdb2/{$code}_00_{$hash}/{$code}_00.json"; + $userAgent = "Mozilla/5.0 (PlayStation; PlayStation 4/11.00) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15"; + $PS4header = stream_context_create(["http" => ["header" => "User-Agent: $userAgent\r\n"]]); // ps4 useragent cuz im silly + $response = file_get_contents($url, false, $PS4header); + $data = json_decode($response, true); + $url = $data['icons'][0]['icon']; + + usleep(rand(200000, 500000)); // delay between 200 - 500 ms + imageDownloader($url, $PS4header, $cusaDir); + } + } else if ($type === "HB" && !file_exists($hbDir)) { + $stmt = $conn->prepare('SELECT * FROM GameSkips WHERE code = :title COLLATE utf8mb4_general_ci'); // check if it needs to be skipped + $stmt->execute(['title' => $title]); + $result = $stmt->fetch(PDO::FETCH_ASSOC); + + if(!$result) { + $stmt = $homebrewDB->prepare('SELECT image FROM homebrews WHERE name = :title COLLATE NOCASE'); + $stmt->execute(['title' => $title]); + $url = $stmt->fetch()[0]; + + usleep(rand(200000, 500000)); // delay between 200 - 500 ms + imageDownloader($url, $HBheader, $hbDir); + } + } + } catch (Exception $e) { + $noImage++; + echo "No image found for: $title
"; + + // insert issue in database to be skipped. + $insertQuery = "INSERT INTO GameSkips (code) VALUES (:value1)"; + $stmt = $conn->prepare($insertQuery); + + if ($type === "CUSA") { + $stmt->execute(['value1' => $code]); + } else if ($type === "HB") { + $stmt->execute(['value1' => $title]); + } + } + } + } + } catch (Exception $e) { + echo $e; + } finally { + print("
$issuesProcessed issues processed!
"); + print("$noImage images not found!
"); + print("Issue processing, Image downloading and Database insertion task completed!
"); + } + + // Move newIssues table to normal issues table + try { + // Check the newIssues table + $result = $conn->query("SELECT COUNT(*) FROM newIssues"); + $newTotal = $result->fetchColumn(); + + $result2 = $conn->query("SELECT COUNT(*) FROM issues"); + $oldTotal = $result2->fetchColumn(); + + // remove 5% from old issue cound + $minNumber = $oldTotal - (0.05 * $oldTotal); + + if ($newTotal > $minNumber) { + // empty issues table + $conn->query("DELETE FROM issues"); + + // copy newIssues to issues table + $conn->query("INSERT INTO issues (id, code, title, tags, type, updatedDate, createdDate) SELECT id, code, title, tags, type, updatedDate, createdDate FROM newIssues"); + + // drop newIssues table + $conn->query("DROP TABLE IF EXISTS newIssues"); + } else { + print "
Something is wrong with newIssues, skipping update."; + } + + } catch (Exception $e) { + echo $e; + } finally {print("Database transfer task completed!
");} + + + $conn = null; + $homebrewDB = null; + echo "
" . round((microtime(true) - $startTime) * 1000, 2) . "ms"; + + } else { + http_response_code(404); + include("$dir/document_errors/404.html"); + } +?> \ No newline at end of file diff --git a/public_html/compatibility/app.js b/public_html/compatibility/app.js index 5f258ee..de7f321 100644 --- a/public_html/compatibility/app.js +++ b/public_html/compatibility/app.js @@ -1,97 +1,25 @@ -let imageLoading = true; +// this is my attempt on rewriting this... thing let avifSupport = false; -let sTimer; -let iTimer; -let pTimer; -let pbTimer; -let pfTimer; -let pmaxTimer; -let pminTimer; -let skeletonTimeout; -let tagFilter = []; +let imageLoading = true; let oldestFilter = false; let datesButton = false; -let lightTheme = false; +let tagFilter = []; let pageNumber = 1; -let inputValue = 1; -let updatePageValue = false; -let noImagesLocked = false; -let maxValue; - -var urlParams = new URLSearchParams(window.location.search); -var tagParam = urlParams.get('tag'); -if (tagParam) { - tagFilter.push(tagParam); - tagElementForFilter = document.getElementById(tagParam + 'Bar'); - tagParentForFilter = tagElementForFilter.parentElement; - tagParentForFilter.classList.toggle('selected'); -} - - -function setCookie(name, value) { - var date = new Date(); - date.setMonth(date.getMonth() + 1); - var expires = "; expires=" + date.toUTCString(); - document.cookie = name + "=" + value + expires + "; path=/"; -} - -// Checks cookies -function checkCookies(name, defaultValue) { - return document.cookie.split("; ").find(c => c.startsWith(name + "="))?.split("=")[1] ?? defaultValue; // if cookie doesnt exist use the default value -} - -const imageLoadingCookie = checkCookies("imageLoading", "true"); -if (imageLoadingCookie === "false") { - imageLoading = false; - document.getElementById("imageButton").classList.add('selected'); -} - -const dateCookie = checkCookies("datesButton", "false"); -if (dateCookie === "true") { - datesButton = true; - document.getElementById("datesButton").classList.add('selected'); -} +let Timer; +let totalPages; +let totalTime; +let totalIssues; +let fancyJsonData; // :3 -const lightThemeCookie = checkCookies("lightTheme", "false"); -if (lightThemeCookie === "true") { - lightTheme = true; - document.body.classList.toggle("lightMode"); -} -//- Checks cookies -function LightModeIconChange() { - if (lightTheme === true) { - document.getElementById("lightModeIcon").style.display = "flex"; - document.getElementById("darkModeIcon").style.display = "none"; - } else { - document.getElementById("darkModeIcon").style.opacity = "1"; - } +// Fetch html for footer and header +async function fetchHtml(path, target){ + fetch(path).then(response => response.text()).then(data => { + document.querySelector(target).innerHTML = data; + }).catch(console.error); } -function adjustFontSize() { - var screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; - var referenceWidth = 2000; - var referenceFontSize = 16; - var phoneReferenceWidth = 550; - - if (screenWidth >= referenceWidth) { - // if its larger then 2000px - var fontSize = (screenWidth / referenceWidth) * referenceFontSize; - document.documentElement.style.fontSize = fontSize + 'px'; - } else if (screenWidth >= phoneReferenceWidth) { - // if its higer then 550 but under 2000 then set it as default - document.documentElement.style.fontSize = referenceFontSize + 'px'; - } else { - // if the width is lower then 550 - var fontSize = (screenWidth / phoneReferenceWidth) * referenceFontSize; - document.documentElement.style.fontSize = fontSize + 'px'; - } -} - -// resize on load and when rezsizing the window -window.addEventListener('load', adjustFontSize); -window.addEventListener('resize', adjustFontSize); // Check Avif Support console.log(`Hey there! I've implemented an avif support check to spare browsers like Edge from having a stroke :D!`); @@ -104,148 +32,170 @@ avif.onload = function() { avif.onerror = function() { console.log('AVIF IS NOT SUPPORTED D:'); avifSupport = false; - noImagesLocked = true; - window.alert("Hey! Your browser doesnt support avif, avif is an image format that has low file sizes while having high quality images. I will give you an N/A jpeg instead."); - imageButton(); + // window.alert("Hey! Your browser doesnt support avif, avif is an image format that has low file sizes while having high quality images. You won't get any game images"); + const iButton = document.getElementById('imageButton'); + console.log(iButton); + iButton.classList.add('selected'); + iButton.style.cursor = 'default'; + iButton.removeAttribute("onclick"); }; -// Page Load + + +// game cards and stats handler and other onload stuff document.addEventListener('DOMContentLoaded', function() { - fetch('https://fpps4.net/scripts/search.php?q=&stats&tag='+ tagFilter) - .then(response => response.text()) - .then(data => { - document.querySelector('#gameWrapper').innerHTML = data; - applyMods(); - gameStats(); - filter(); + // + check cookies + const imageLoadingCookie = checkCookies("imageLoadingSetting", "true"); + const datesSetting = checkCookies("datesSetting", "false"); + + if (imageLoadingCookie === "false") { + imageLoading = false; + document.getElementById("imageButton").classList.add('selected'); + } + + if (datesSetting === "true") { + datesButton = true; + document.getElementById('datesButton').classList.toggle('selected'); + } + + // Adjust screen size for mobile and 4k monitors for some reason + window.addEventListener('load', adjustScreenSize); + window.addEventListener('resize', adjustScreenSize); + + + // + fetch issues and set the tag bars + fetch('/_scripts/search.php?q=&stats') + .then(response => response.json()) + .then(jsonData => { + gameCardHandler(jsonData); + fancyJsonData = jsonData; + pageButtonHandler(); + + totalPages = jsonData.info.pages; + totalTime = jsonData.info.time; + totalIssues = jsonData.info.issues; + console.log("\nCOMPATIBILITY STATS"); + + // stats & tag filter + jsonData.stats.forEach(stat => { + var tag = stat.tag; + var percent = stat.percent; + var element = document.getElementById(tag + 'Bar'); + var textElement = document.getElementById(tag + 'Info') + var parentElement = element.parentElement; + console.log(`${tag} = ${percent}% [${stat.count}]`); + element.style.width = percent + '%'; + textElement.textContent = percent + '% - ' + stat.count; + + parentElement.addEventListener('click', function() { + parentElement.classList.toggle('selected'); + tagFilter.includes(tag) ? tagFilter.splice(tagFilter.indexOf(tag), 1) : tagFilter.push(tag); + pageNumber = 1; + updateSearchResults(); + }); + }); + console.log("\n"); }) .catch(console.error); }); -// Game Stats -function gameStats() { - var labelData = []; - var tempPercentage = 0; - var tempTotal = 0; - var labels = ['N/A', 'Nothing', 'Boots', 'Menus', 'Ingame', 'Playable']; - console.log("\nCOMPATIBILITY STATS"); - - labels.forEach(label => { - var div = document.getElementById(label).getAttribute('data').split('+'); - var percentage = div[0]; - var total = div[1]; - labelData[label] = [percentage, total]; - console.log(label + ' = ' + percentage + '% ['+ total +']'); - }); - console.log("\n"); - - for (var label in labelData) { - var data = labelData[label]; - var percentage = data[0]; - var total = data[1]; - if (label === 'N/A' || label === 'Nothing') { //combine N/A & Nothing - tempPercentage = (parseFloat(percentage) + parseFloat(tempPercentage)); - tempTotal = (parseFloat(total) + parseFloat(tempTotal)); - percentage = tempPercentage.toFixed(2); - total = tempTotal.toFixed(0); - element = document.getElementById('NothingBar'); - text = document.getElementById('NothingInfo') - } else { - element = document.getElementById(label + 'Bar'); - text = document.getElementById(label + 'Info') - } - element.style.width = percentage + '%'; - text.textContent = percentage + '% - ' + total; - } -}; -// Header Load -fetch('https://fpps4.net/parts/navbar.html') -.then(response => response.text()) -.then(data => { - document.querySelector('#header').innerHTML = data; - LightModeIconChange(); -}) -.catch(console.error); +// Header & Footer Load +fetchHtml("/_parts/navbar.html", "#header"); +fetchHtml("/_parts/footer.html", "#footer"); + // Searching document.querySelector('#search').addEventListener('input', function() { - updatePageValue = true; pageNumber = 1; - UpdateSearchResults() + updateSearchResults(); }); -function UpdateSearchResults() { - clearTimeout(sTimer); - +async function updateSearchResults() { + clearTimeout(Timer); const gameWrapper = document.querySelector('#gameWrapper'); + const searchQuery = document.querySelector('#search').value; + pageButtonHandler(); + gameWrapper.querySelectorAll('.gameContainer').forEach(container => { const skeletonDiv = document.createElement('div'); skeletonDiv.classList.add('gameContainer', 'skeletonAnimation'); gameWrapper.replaceChild(skeletonDiv, container); }); - sTimer = setTimeout(() => { - const searchQuery = document.querySelector('#search').value; - fetch('https://fpps4.net/scripts/search.php?q=' + searchQuery + '&tag=' + tagFilter + '&page=' + pageNumber + '&oldest=' + oldestFilter) - .then(response => response.text()) - .then(data => { - document.querySelector('#gameWrapper').innerHTML = data; - applyMods(); - }) - .catch(console.error); + Timer = setTimeout(() => { + fetch('/_scripts/search.php?q=' + searchQuery + '&tag=' + tagFilter + '&page=' + pageNumber + '&oldest=' + oldestFilter) + .then(response => response.json()) + .then(jsonData => { + fancyJsonData = jsonData; + gameCardHandler(jsonData); + }) + .catch(console.error); }, 300); } -// Filters -function filter() { - var ids = ['Nothing', 'Boots', 'Menus', 'Ingame', 'Playable']; - ids.forEach(id => { - element = document.getElementById(id + 'Bar'); - parent = element.parentElement; - parent.addEventListener('click', function() { - this.classList.toggle('selected'); - - tagFilter.includes(id) ? tagFilter.splice(tagFilter.indexOf(id), 1) : tagFilter.push(id); - console.log('Tag Filter has been updated to: ' + tagFilter); - updatePageValue = true; - pageNumber = 1; - UpdateSearchResults(); - }); - }); -}; +// Game Card handler +async function gameCardHandler(jsonData) { + const gameWrapper = document.getElementById("gameWrapper"); + gameWrapper.innerHTML = ""; + + jsonData.games.forEach(game => { + // game image URL + let imageSource = ""; + let imageText = "N/A"; + let imageTextSize = 1.38; + + switch(true) { + case game.image && imageLoading && avifSupport && game.type === "HB": + imageSource = "/_images/HB/" + game.title + ".avif"; + break; + case game.image && imageLoading && avifSupport: + imageSource = "/_images/CUSA/" + game.code +".avif"; + break; + case game.type === "SYS": + imageText = "SYSTEM"; + imageTextSize = 1.13; + break + } -// Image Handler -function imageHandler() { - document.querySelectorAll('.gameImage').forEach(gameImage => { - gameImage.setAttribute("loading", "lazy"); - const data = gameImage.dataset.cusa; - gameImage.src = data.includes('CUSA') && imageLoading ? (avifSupport ? "https://fpps4.net/images/CUSA/" + data + ".avif" : "https://fpps4.net/images/NA.jpg") : (avifSupport ? "https://fpps4.net/images/NA.avif" : "https://fpps4.net/images/NA.jpg"); - }); -} + if (game.type === "HB") { // needs to be applied to all homebrews + imageText = "HOME
BREW"; + imageTextSize = 1.25; + } -// Link Handler -function linkHandler() { - document.querySelectorAll('.gameImageLink').forEach(link => { - link.setAttribute("target", "_blank"); - link.href = "https://github.com/red-prig/fpps4-game-compatibility/issues/" + link.dataset.id; - link.removeAttribute('data-id'); + let imageTextEnabled = game.image && imageLoading && avifSupport ? "none" : "flex"; + + // game cards + const gameElementHTML = ` +
+ +

${imageText}

+ ${imageSource ? `${game.title} - ${game.code} game image` : "" } +
+
+
+

${game.title}

+

${game.code}

+

${game.tag}

+
+
`; + + const tempContainer = document.createElement('div'); + tempContainer.innerHTML = gameElementHTML; + const gameContainer = tempContainer.querySelector('.gameContainer'); + gameWrapper.appendChild(gameContainer); }); -} -// Game Status Colors -function gameColors() { - document.querySelectorAll('.gameContainer').forEach(game => { - const status = game.querySelector('.gameStatus').textContent; - const statusClass = (['Nothing', 'Boots', 'Ingame', 'Menus', 'Playable'].includes(status) ? status : 'Nothing'); - game.querySelector('.gameStatus').classList.add(statusClass); - game.querySelector('.gameSeparator').classList.add(statusClass); - }); -} + const statContainer = document.createElement('h4'); + const stat = `

${jsonData.info.issues} results in ${jsonData.info.time}ms

`; + statContainer.innerHTML = stat; + gameWrapper.appendChild(statContainer); + if (datesButton) { + dateButtonHandler(); + } -// Image Effect -function imageEffect() { - document.querySelectorAll('.gameImage').forEach(image => { + // Image Effect + document.querySelectorAll('.gameImage, .gameImageText').forEach(image => { image.addEventListener('mousemove', e => { const r = image.getBoundingClientRect(); const x = e.clientX - r.left; @@ -257,291 +207,144 @@ function imageEffect() { image.style.transform = 'scale(1)'; }); }); + // functions in required.js + updateFooter(); + LightModeIconChange(); } -function applyMods() { - gameColors(); - imageHandler(); - linkHandler(); - imageEffect(); - dateHandler(); - updatePageSelector(); - updateFooter() -} - -// update footer position -function updateFooter() { - const viewportHeight = window.innerHeight; - const bodyHeight = document.body.clientHeight; - if (bodyHeight < viewportHeight) { - document.getElementById('footer').style.position = 'fixed'; - } else { - document.getElementById('footer').style = ''; - } -} // NoImage button -function imageButton() { - e = document.getElementById('imageButton'); - if (noImagesLocked === true) { - e.classList.add('selected'); - e.style.cursor = 'default'; - } else { - clearTimeout(iTimer); - e.classList.toggle('selected'); - - imageLoading = !imageLoading; - setCookie("imageLoading", imageLoading); - iTimer = setTimeout(imageHandler, 450); - } +function imageButton(button) { + imageLoading = !imageLoading; + setCookie("imageLoadingSetting", imageLoading); + button.classList.toggle('selected'); + imageButtonHandler(); } -// show last updated dates button -function dateButton() { + +// Date Button +function dateButton(button) { datesButton = !datesButton; - setCookie("datesButton", datesButton); - dateHandler(); + setCookie("datesSetting", datesButton); + button.classList.toggle('selected'); + dateButtonHandler(); } -function dateHandler() { - var gameCusaText = document.querySelectorAll(".gameCusa"); - var button = document.getElementById('datesButton'); - datesButton ? button.classList.add('selected') : button.classList.remove('selected'); - - gameCusaText.forEach(element => { - var currentText = element.textContent; - var date = element.getAttribute('data'); - if (datesButton === true) { - element.dataset.status = currentText; - element.textContent = date; - } else if (currentText === date) { - element.textContent = element.dataset.status; - } - }); -} - -// Sorting Button -function sortButton(e) { - clearTimeout(iTimer); +// Oldes/Newest Button +function sortButton(button) { oldestFilter = !oldestFilter; - e.classList.toggle('selected'); - iTimer = setTimeout(UpdateSearchResults, 450); + button.classList.toggle('selected'); + updateSearchResults(); } -function toggleLightMode() { - lightTheme = !lightTheme; - setCookie("lightTheme", lightTheme); - document.body.classList.toggle("lightMode"); - var x = document.getElementById("darkModeIcon") - var y = document.getElementById("lightModeIcon") - if (y.style.display === "none" || y.style.display == '') { - y.style.display = "flex"; - x.style.display = "none"; - } else { - x.style.opacity = "1"; - x.style.display = "flex"; - y.style.display = "none"; - }; -}; - -function toggleMenu() { - // var x = document.getElementById("overlay"); - var y = document.getElementById("close-icon") - var z = document.getElementById("menu-icon") - console.log('pretend like you see a menu') - if (y.style.display === "none" || y.style.display == '') { - // x.style.display = "flex"; - y.style.display = "flex"; - z.style.display = "none"; - setTimeout(function() { - // x.style.opacity = 1; - }, 50); - } else { - // x.style.opacity = 0; - y.style.display = "none"; - z.style.display = "flex"; - setTimeout(function() { - // x.style.display = "none"; - }, 300); - }; -}; - -const inputElement = document.getElementById('search2'); -function updatePageSelector() { - search3.classList.add('selected'); - maxValue = document.getElementById("totalPages").getAttribute('data'); - if (updatePageValue === true) { - inputValue = 1; - updatePageValue = false; - document.getElementById('pageBarMin').classList.add('selected'); - } - - if (inputValue == 1) { - document.getElementById('pageBarMin').classList.add('selected'); - search3.placeholder = '...'; - search3.classList.remove('selected'); - } else { - document.getElementById('pageBarMin').classList.remove('selected'); - } - if (inputValue == maxValue) { - document.getElementById('pageBarMax').classList.add('selected'); - search3.placeholder = '...'; - search3.classList.remove('selected'); +async function imageButtonHandler() { + if (imageLoading === false) { + document.querySelectorAll(".gameImageText").forEach(imageText => { + imageText.style.display = "flex"; + }); } else { - document.getElementById('pageBarMax').classList.remove('selected'); + gameCardHandler(fancyJsonData); } +} - document.getElementById('pageBarMax').textContent = maxValue; - inputElement.placeholder = inputValue + "/" + maxValue; - - inputElement.addEventListener('input', function(event) { - clearTimeout(pTimer); - inputValue = parseInt(inputElement.value, 10); - if (isNaN(parseFloat(inputValue))) { - inputValue = 1; - } - if (inputValue > maxValue) { - inputValue = maxValue; - } else if (inputValue < 1) { - inputValue = 1; +async function dateButtonHandler() { + document.querySelectorAll(".gameCusa").forEach(element => { + if (datesButton === true) { + element.textContent = element.dataset.date; + } else { + element.textContent = element.dataset.cusa; } - - inputElement.placeholder = inputValue + "/" + maxValue; - search3.placeholder = inputValue; - pTimer = setTimeout(() => { - if (inputValue > 9) { - inputElement.style.padding = "0 0.3rem 0 0.7rem"; - } else if (inputValue < 10) { - inputElement.style.padding = ""; - } - inputElement.value = ""; - search3.value = ""; - pageNumber = inputValue; - UpdateSearchResults(); - }, 500); }); } -function pageBarBack() { - if (pageNumber > 1) { - clearTimeout(pbTimer); - inputValue--; - pageNumber--; - document.getElementById('pageBarMax').classList.remove('selected'); - if (pageNumber == 1) { - search3.placeholder = '...'; - search3.classList.remove('selected'); - document.getElementById('pageBarMin').classList.add('selected'); - } else { - search3.placeholder = pageNumber; - search3.classList.add('selected'); +function pageButtonHandler(type) { + // maybe make it handle everything in once? + const maxNumber = fancyJsonData.info.pages; + const searchBar = document.getElementById("search3"); + const minButton = document.getElementById("pageBarMin"); + const maxButton = document.getElementById("pageBarMax"); + + if (pageNumber != maxNumber) { + if (type === "forward") { + pageNumber += 1; + updateSearchResults(); + } else if (type === "max") { + pageNumber = maxNumber; + updateSearchResults(); } - pbTimer = setTimeout(() => { - UpdateSearchResults(); - }, 500); } -} -function pageBarForward() { - maxValue = document.getElementById("totalPages").getAttribute('data'); - if (inputValue < maxValue) { - clearTimeout(pfTimer); - inputValue++; - pageNumber++; - document.getElementById('pageBarMin').classList.remove('selected'); - if (pageNumber == maxValue) { - search3.placeholder = '...'; - search3.classList.remove('selected'); - document.getElementById('pageBarMax').classList.add('selected'); - } else { - search3.placeholder = inputValue; - search3.classList.add('selected'); + if (pageNumber != 1) { + if (type === "back") { + pageNumber -= 1; + updateSearchResults(); + } else if (type === "min") { + pageNumber = 1; + updateSearchResults(); } - pfTimer = setTimeout(() => { - UpdateSearchResults(); - }, 500); } -} -function pageBarMax() { - clearTimeout(pmaxTimer); - document.getElementById('pageBarMax').classList.add('selected'); - document.getElementById('pageBarMin').classList.remove('selected'); - inputValue = maxValue; - search3.placeholder = '...'; - search3.classList.remove('selected'); - pageNumber = maxValue; - pmaxTimer = setTimeout(() => { - UpdateSearchResults(); - }, 400); -} + if (type === "input") { + clearTimeout(Timer); + inputValue = parseInt(search3.value, 10); + Timer = setTimeout(() => { + + console.log(inputValue); + pageNumber = inputValue; + updateSearchResults(); + searchBar.value = ""; + // if (inputValue > maxNumber) { + // pageNumber = inputValue; + // updateSearchResults(); + // searchBar.value = ""; + // } else { + // pageNumber = maxNumber; + // updateSearchResults(); + // searchBar.value = ""; + // } + }, 600); + } -function pageBarMin() { - clearTimeout(pminTimer); - document.getElementById('pageBarMin').classList.add('selected'); - document.getElementById('pageBarMax').classList.remove('selected'); - search3.placeholder = '...'; - search3.classList.remove('selected'); - inputValue = 1; - pageNumber = 1; - pminTimer = setTimeout(() => { - UpdateSearchResults(); - search3.placeholder = '...'; - }, 400); + maxButton.textContent = maxNumber; + // searchBar.value = ""; + + if (pageNumber != 1 && pageNumber != maxNumber) { + searchBar.placeholder = pageNumber; + searchBar.classList.add("selected"); + maxButton.classList.remove("selected"); + minButton.classList.remove("selected"); + } else if (pageNumber === 1) { + minButton.classList.add("selected"); + maxButton.classList.remove("selected"); + searchBar.classList.remove("selected"); + searchBar.placeholder = "..."; + searchBar.value = ""; + } else if (pageNumber === maxNumber) { + minButton.classList.remove("selected"); + maxButton.classList.add("selected"); + searchBar.classList.remove("selected"); + searchBar.placeholder = "..."; + searchBar.value = ""; + } } -const search3 = document.getElementById("search3"); - -search3.addEventListener("click", function() { +search3.addEventListener("click", async function() { if (search3.placeholder == '...') { search3.placeholder = ''; } }); -search3.addEventListener("blur", function() { +search3.addEventListener("blur", async function() { if (search3.placeholder == '') { search3.placeholder = '...'; } }); -search3.addEventListener('input', function(event) { - clearTimeout(pTimer); - inputValue = parseInt(search3.value, 10); - document.getElementById('pageBarMax').classList.remove('selected'); - document.getElementById('pageBarMin').classList.remove('selected'); - - if (isNaN(parseFloat(inputValue))) { - inputValue = 1; - } - if (inputValue > maxValue) { - inputValue = maxValue; - } else if (inputValue < 1) { - inputValue = 1; - } - - inputElement.placeholder = inputValue + "/" + maxValue; - search3.placeholder = inputValue; - pTimer = setTimeout(() => { - if (inputValue > 9) { - inputElement.style.padding = "0 0.3rem 0 0.7rem"; - } else if (inputValue < 10) { - inputElement.style.padding = ""; - } - inputElement.value = ""; - search3.value = ""; - search3.classList.add('selected'); - pageNumber = inputValue; - UpdateSearchResults(); - }, 500); -}); - -// Footer Load -fetch('https://fpps4.net/parts/footer.html') -.then(response => response.text()) -.then(data => { - document.querySelector('#footer').innerHTML = data; -}) -.catch(console.error); \ No newline at end of file +// search3.addEventListener('input', async function() { +// clearTimeout(Timer); +// inputValue = parseInt(search3.value, 10); +// console.log(inputValue); +// }); \ No newline at end of file diff --git a/public_html/compatibility/index.html b/public_html/compatibility/index.html index abb2383..40c816f 100644 --- a/public_html/compatibility/index.html +++ b/public_html/compatibility/index.html @@ -3,7 +3,7 @@ - + fpPS4 - Compatibility List @@ -17,7 +17,7 @@ - + - + + \ No newline at end of file diff --git a/public_html/compatibility/styles.css b/public_html/compatibility/styles.css index a10516a..551a65d 100644 --- a/public_html/compatibility/styles.css +++ b/public_html/compatibility/styles.css @@ -41,7 +41,7 @@ background-color: yellow; } */ -.Nothing {--status-color: #1F2325;} +.Nothing, .N\/A {--status-color: #1F2325;} .Boots {--status-color: #F2766E;} .Menus {--status-color: #4288B7;} .Ingame {--status-color: #fabb44;} @@ -163,34 +163,24 @@ body{ font-size: 0.9rem; transition: opacity 0.15s ease-in-out; } +.selected .progressBarInfo{opacity: 1;} .selected, .selected:hover {background: var(--selected) !important;} /*- PROGRESS BAR*/ .searchBarContainer {display: flex;} -.searchBar, -.pageSelector { +.searchBar { padding-left: 1rem; - /* width: 19.4rem; */ + width: 18.4rem; height: 2.15rem; margin: 1.9rem 0 0.3rem; background: var(--main1); border: 0.05rem solid var(--border); - /* border-radius: 0.6rem; */ + border-radius: 0.6rem; line-height: 0; font-size: 0.9rem; } -.searchBar { - width: 14.3rem; - border-radius: 0.6rem 0rem 0rem 0.6rem; -} - -.pageSelector { - width: 3rem; - border-radius: 0rem 0.6rem 0.6rem 0rem; - font-weight: 500; -} input[type="number"] { -moz-appearance: textfield; @@ -277,13 +267,26 @@ input[type="number"]::-webkit-outer-spin-button { border-radius: 0.6rem 0.4rem 0.4rem 0.6rem; overflow: hidden; } - +.gameImageText, .gameImage { width: 5.3rem; height: 5.3rem; max-width: 5.3rem; border-radius: 0.5rem 0.4rem 0.4rem 0.5rem; transition: transform 0.2s ease-in-out; + image-rendering: -webkit-optimize-contrast; +} + +.gameImageText { + background: #1F2325; + font-weight: 500; + /* display: flex; */ + align-content: center; + text-align: center; + flex-wrap: wrap; + justify-content: center; + color: white; + user-select: none; } .gameSeparator { @@ -409,7 +412,6 @@ input[type="number"]::-webkit-outer-spin-button { @media screen and (max-width: 550px) { .optionButton:hover {background: var(--main1);} .progressWrap:hover, .progressWrapb:hover {background: var(--main1);} - .selected .progressBarInfo{opacity: 1;} .menu-icon:hover, .gh-logo:hover, .dc-logo:hover, .lightModeButton:hover, .logo:hover {background-color: #00000000 !important;} .pageBarImage:hover {background-color: transparent !important;} .gameDetails:hover .gameName {width: 23rem !important;} diff --git a/public_html/images/NA.avif b/public_html/images/NA.avif deleted file mode 100644 index 73ef871626150d1688fee268ca78dfd2f3e308d5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 998 zcmZQzV30{GsVqn=%S>ZnU|;~zxtVE(xtWP+3=E7ja#KqZLE;Py42l^kIYm%5LqTS8 z35*S+`3f>ia={!%1_lO`%$)pW5YNSdfr)_$#A4jT0FnVQB_J%uD-fE2fk}vgfx#j( zGY{+xuzJzVytGt^Mv%h{3_%(Zf=md(>zM^b1q=)f8#4=%^BEWzgp>1git>_kD!?|g zH83zR@FbQQIyW-NfXoodEG|d|F&G#aKyo0=SCCne2@+%E068SFw89z0D=o^i$}LDu z2NOhUYC8@c^R*9t*nK_w>MU_^GIRzQuV1nAh1Ja7k76F(o%p4pbd*m_; za={uI7#Nrs7+D(I*gF`QSelqyS{WD^q%wU^vXc$m!t1vc;?GoBpGy z@1K4>QBFGIrgZi*ulv%P*)Lb!D>FEhy)Sy9W6DF7iQgvlEWg!Q#=pii%mHXP4&f zJL7ZVYTVtJ<@co??RGz;^pG|CUx?h|H)n0#LtVEPCTHG0n?7%zZAIRMD=}QxHILr^ zYMcBrKG3DR^~&UPY5fB0bYGvHd{6F6vdXh5kD{I!@>xm$ZQmml_S>!b_O>JLQ_j9r zKGEvc@qs;{HN%?u<vb24b<30&b;ruxIbU*F zk+)PmJT8*^N~~;v<$jK+qB|K|I%3W+Pl{LXm3(}3OIUhVUB{EzNAweKaM-NfHT5rN z(~`2ijNi?-9rd0UAnN(=IMeA56BnP}Z2XtMU|OoWSaa9`>tsjfYZH7gEC{!Ke#`H? zk?b$|*p|G$Lr42KQvX*Udg<1DXqNVuw^J3yBhzSCiS(!nAjfI7om7R^99fUbJ zxj8vFxH#C^xp=v_xOsSZc-T4l_<4EwKx~j9j7&^S%*@Pe%*<>&9PAt*6{O++2N(o7 z7#bKFm>HEAm;@P_1sVSzVUT8EWMF0lIhO$j*f==ZS(&;1A7L;NU|<9}m5GI!gBdK% z#K6eR!pg?ZA;>ADC~PR=7?{WHiT1agcG0VC67^iIL_15e9id zMn(ok7G_3-B%>gckW!$c<3U5C|F;-;m>C(E1epaH>={mNaf#(K6ci8?WF`e8T! z{#I+{uCu)n?=3~|E%11>aO;KB(V+_6MSg}yRPxT;i@mwWeAnmf6=~bT&iV%PZ24+( zNhH`+!$QVQ?~#+!zlfPPZ{GZ~dGjXzNlFSzN=#5)F^@Zv-tIYZfS# z^)0fmlRuu>u74xR_w@Gcy}f@-c+ZFBME|P#{I4NwTYIqKx$W0-18=J>jmgNhy1VSA z>9^HBpQ;)YwOegWi}??G9xn0|Y&fpLKe@#zEZxHM%Ij^Bef!qCOpEz;cHInXjYY2n z_hgGryZ*#<#$MA$ZM!zCGug5*SjXR=f5o8#d57M_o%{16W`1nRD_!~PJm&@5)`sZ`v#_v5J<7-L zEi+3un811BkmV_hyJu%lGt=kUeE4RzxX-`EQ*J+arMdQp-143CSa)+(&Cb;obu`c2 z7LjQ2LP@TMbFZ{b&GzZjEau-$TlTbs@B7xdb*I0)R$|XSCR;M=rscN}SC#nB6!-s2 z?LFl7TUvA4^YhzYO_sA&T{Cn2#(pt@LzMeMankQ7me{KFV|M2GB_B!uQnQqTLnfBZ7Dp$^BfBnyoEp26O zu57q|n8kR4tHy>CwwoH8zZ;wH_;g=SBwpuKp5(RAl6|qO{I!<1OG{T)s*{|#=SNy({mQEO(fZQz3-hK|EnIdtbZa`pof=*D?$_t0M{60bd3N1f z+N69&mgXr7EsN*#{dZ69__Jg4Y0lysd^an%&RzYl(CR~Mp;TAd%1uG9d|&;p63TOY zk+DwLFDX8gC#n0-s=#gBG(oPKX|Q}ua_Y1nzw_42zN{h0$VoD2#&9U5%;y_0du zGa+Ml>Fpm}_Y^-i?A}$f_U7#T4E1o^tJ^;8YRyW^>l-1aCe+tT=xJ)`Rx!3oIh?+V88o9M^k7ytJm%x{MCF|7ljvz`W%aYIHQzlePhGM5 z#1)C6wZ5lTZ@T@}R3Q4{s+CMR&02!_Th`L`}Ud5 z7i?8G2k3rG{u!$=*`w^%kKMP#Cd}^h;80&y^l;~w1t0F7+4Q&MOn$|#=^by^eP8@V zGBzYCdtzu!?x8~^S3Vsyx%+Yc3YEe=6Q|b%PJdze$>#U&PrD*b%bsQQ{n@4E(b2)t L(Lgp~|NkZc^&bh~ diff --git a/public_html/images/NA.png b/public_html/images/NA.png deleted file mode 100644 index b0474b0a8403b8375b8a4ab387e2238bd403972b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1457 zcmeAS@N?(olHy`uVBq!ia0y~yU}ykg4kiW$2A`O3a~K#HI14-?iy0X7ltGxWVyS%@ z0|RTar;B4q#hkZu4Sl4;C633h@@qd*Cd;sL+9W@})Z@Jh0ZJ2e+r`+Ln&-GR@lBYp z)_1a7R%j!ShS!viRo<&D9NLmr>UuHrTv*0&g{QS)(yGwIJ?$-gawjI-yYq0#>&G?e zd+*HsYyRc`?0cK{RoCshf4BU7ZTiXfdp3WjDOkig`#<>4$J(%v!9awejp;xDg9I0Y zGh>1V0}mYqD`jmP4`i%ZpPgx!xb6BidE4rJ&2#&e*xenz&0c@_;f9;@PCjijPQLL| zqsSpBz({cWxqSkU)-U&OoLs4@Rl8P)wRy8_^S&Q{HZN$aTEF;k*8fd=-bfUG{iNzW>CDM%*A^^$$UCDUK*MC7f#uDgy~dMoZ;snj_4Jf>Z1c89=f7{>+?VLw%={^KlU}H&`1HC-%Db(s zukN>XNYKo%FrIe)`Py~sUeAyF=km88`s4AnOD1=`k9>T3WqoC8=sBl_0Vn>?y1{%R z{lM1O=1<xxB4TY1gx+xGnvm+;yqSL?|+5hPL6Fb+2FE zo07z6qwyjC$hz45hBNoBm0KV2r_)v0Y_3+B^`zxmIt=^yHT+zb25SD}SkJk4=TDbb zbCwFmMH#LkOwk{oAGf@|`f9Y(b(6J+q?u~Ci~@aJwms^P-X$R=GvV?Sfkj7r#jMMG z?geexzICVV)zgk!IShm+{<(EYaO$Ieja6@Ra&o5qnCN08IQ?$>;fE0>kEY#ZTCNo| z!LzK$>z<^jvUoku;R5Y{H_A8t_#fzi?0<=!b;-EW>u z`O~#**)q4>eT)Se`~S>-Rq}1y*Ts|8u3fwCo!pz6rbWBnF_`CM{=MGL-#D3bT2>_M z)Mvc0_wU^^yR9GpFZg6?($1UanlBb?vJbkzI4~v5nf>oXYGQMZHeF_5U|{fc^>bP0 Hl+XkKDHn;A diff --git a/public_html/images/arrow_forward.svg b/public_html/images/arrow_forward.svg deleted file mode 100644 index b40e6e9..0000000 --- a/public_html/images/arrow_forward.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public_html/images/fpPS4-icon.png b/public_html/images/fpPS4-icon.png deleted file mode 100644 index cdaa1c06b12b475a69dbae0d3efe59d46f158881..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1486 zcmeAS@N?(olHy`uVBq!ia0y~yU}OMc4rT@hhU_&FAq)%*u>n3Iu3BDgZb|LEbGvpN z=stF)=l}1%gm3X&U!)x*+ zi(Boxx4k%Qana-Z>BJ-d_cRj0V)gG6XFjo)q}FoH*c0clX?pYY zbK9nu=!u4R*&Z~sedLdTtLWislSYi7zlzJKC}x&5C>evFxMy}h@N&HUaI zn;g^6^hCDc=ga9D8{N#m`2I`aRO8BDBgg8J^Y7Q2sZ9HhF#Y&Ay~A7k`^JQoab-JM zo@7mnPLXrl=6hj7<`)eIk%O1*SYL?8y<<_DyY$w)>FaxDC&c-kj8l5>qx;EyMF+zV zHy&J@woq5bD}MEKjvr^=T~~GRtoUC2;L6O8C95P8fBY9#*#77DNe?})k40nw>lB^5mQ`euME=Hy~ENI#k%83gH<|9 zsL=<7goW}m`m#2@&~wmamN~aCRP3g<e;?5@lu1X+RV@LZxy%NoVq3MSj%y%|DNswy@|{3KPx=c;M<_{TTato|MjH} zs^aUW+}y`<r5kPy5$dA9?n9gQMfxS4;fgxF1L@a&@!Q+%bbiWbLGjKfQmZmR4nP zotU0A=g|V`BW}zq_o-en_r79qy}yA;us?`%71OfRr=J(T;Ybym(3rBl%;7PMzPw-r zkIKYd9Itk%f7f%c(fBb#I!z^Z#om1n66BW7>EFupBJ@C5*uG5~I`13T{Yd`HX1{bU z+bY*7Qz!rB{4qsdXNjaaW1;auR_(_pv~IYuebI8z{gbLBvzw!%r#fbz(b}d>$n-2W?5VCVCo2J6<`0DGg8JTqD?-kuUr~0pvt03pAmWDs~;rf7v zoH9|*gd0pLLOJi4?1eU5J0!J@VJC0iFF^yT9SmRh9$dd{)_y&Q%m%$9l^bkSzE*Pc z7;@I#w$tF}JkMbe>Sn}w?^kkVhLZ^U(er=z1U^%8s8b3~n8`FxaDw_vul#1M+Y9!( zzuK%AbeH9nb?fm@+xNf*p>>)H9uH`?`LQ(nA@SXs#2xezD70 zJEiCH=4{=bdFOxk?q=OT?{=L__s;pabLzwF{1Y~zT+b6PJ62hg`c}_mkp5LzQCRQ( z%Hp@p|8J|;AB~rA>o1u1V(#AQ)A}y#XJis+U|>;TVB~OM05gB=6C - - - - - fpPS4 - Compatibility List - - - - - - - - - - - - - - - - - -
-

Game Compatibility List

-

These are the games that have been tested with fpPS4.
Click on an image to view the game's GitHub issue.
The database is updated every 20 minutes.

-
-
Playable
-
-
Menus
-
Ingame
-
-
-
Nothing
-
Boots
-
-
-
- - -
- -
-
Oldest
-
No Images
-
Dates
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

0 results in 0ms

-
-
- -

1

- -

1

- -
-
Trademarks and logos displayed on this website are the property of their respective owners.
The use of any third-party trademarks, brand names, product names, and logos is for
informational purposes only and does not imply endorsement or sponsorship.
-
-
-
- -
- - + + + + + fpPS4 + + + + + + + + + + + + + + + +
+
+

Work In Progress

+

fpPS4

+

The offical website for the open-source
compatibility layer fpPS4

+ +
+
+
+
+

fpPS4

+

An open-source PS4 compatibility layer (emulator) written with Free Pascal

+
+ Github + Discord +
+
+ +
+ + \ No newline at end of file diff --git a/public_html/parts/images/boostySmol.svg b/public_html/parts/images/boostySmol.svg deleted file mode 100644 index 2b03934..0000000 --- a/public_html/parts/images/boostySmol.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/public_html/parts/images/close.svg b/public_html/parts/images/close.svg deleted file mode 100644 index 0de3701..0000000 --- a/public_html/parts/images/close.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public_html/parts/images/discord.svg b/public_html/parts/images/discord.svg deleted file mode 100644 index 4b74773..0000000 --- a/public_html/parts/images/discord.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public_html/parts/images/menu.svg b/public_html/parts/images/menu.svg deleted file mode 100644 index 40fb047..0000000 --- a/public_html/parts/images/menu.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public_html/parts/images/unused/close.svg b/public_html/parts/images/unused/close.svg deleted file mode 100644 index 53d7b96..0000000 --- a/public_html/parts/images/unused/close.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public_html/parts/images/unused/dark_mode.svg b/public_html/parts/images/unused/dark_mode.svg deleted file mode 100644 index 9607b1b..0000000 --- a/public_html/parts/images/unused/dark_mode.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public_html/parts/images/unused/discord-mark-black-crop-opti.svg b/public_html/parts/images/unused/discord-mark-black-crop-opti.svg deleted file mode 100644 index 53245ae..0000000 --- a/public_html/parts/images/unused/discord-mark-black-crop-opti.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/public_html/parts/images/unused/github-mark-black.svg b/public_html/parts/images/unused/github-mark-black.svg deleted file mode 100644 index 25f4962..0000000 --- a/public_html/parts/images/unused/github-mark-black.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public_html/parts/images/unused/menu.svg b/public_html/parts/images/unused/menu.svg deleted file mode 100644 index 0f2bb38..0000000 --- a/public_html/parts/images/unused/menu.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public_html/scripts/issue_fetcher.php b/public_html/scripts/issue_fetcher.php deleted file mode 100644 index 013498c..0000000 --- a/public_html/scripts/issue_fetcher.php +++ /dev/null @@ -1,496 +0,0 @@ - ["header" => "User-Agent: $homebrewUseragent\r\n"]]); - $response = file_get_contents("https://api.pkg-zone.com/api.php?db_check_hash=true", false, $header); - if ($response !== false) { - $data = json_decode($response); - $hash = $data->hash; - $md5Hash = md5_file("/home/{$serverUsername}/domains/fpps4.net/public_html/scripts/HBstore.db"); // will give warning on first download - if ($hash === $md5Hash) { - echo("the db is the same! response: $hash local: $md5Hash
"); - } else { - echo("the db is diffrent! response: $hash local: $md5Hash downloading db
"); - $fileContent = file_get_contents("https://api.pkg-zone.com/store.db", false, $header); - if ($fileContent !== false) { - file_put_contents("/home/{$serverUsername}/domains/fpps4.net/public_html/scripts/HBstore.db", $fileContent) !== false ? die("DB downloaded and saved successfully.
") : die("Error saving the downloaded DB.
"); - } else { - die("Error downloading the DB from the URL."); - } - } - } else { - echo("Error verifying hash, ignoring for now."); - } - - $dbFile = "/home/{$serverUsername}/domains/fpps4.net/public_html/scripts/HBstore.db"; - try { - $homebrewDB = new PDO("sqlite:$dbFile"); - echo "Connected to the database successfully!
"; - } catch (PDOException $e) { - echo "Connection failed: " . $e->getMessage() . "
"; - } - - $conn = new PDO("mysql:host=$host;dbname=$database", $username, $password); - $conn->query("DROP TABLE IF EXISTS newIssues"); - - // creating tables - $sqlOld = "CREATE TABLE IF NOT EXISTS issues ( - id INT(5) PRIMARY KEY, - cusaCode VARCHAR(10), - title VARCHAR(130), - tags VARCHAR(12), - updatedDate VARCHAR(12) - )"; - - $sqlNew = "CREATE TABLE IF NOT EXISTS newIssues ( - id INT(5) PRIMARY KEY, - cusaCode VARCHAR(10), - title VARCHAR(130), - tags VARCHAR(12), - updatedDate VARCHAR(12) - )"; - - $sqlSkips = "CREATE TABLE IF NOT EXISTS GameSkips ( - code VARCHAR(130) PRIMARY KEY - )"; - - $conn->exec($sqlOld); - $conn->exec($sqlNew); - $conn->exec($sqlSkips); - echo "Tables created successfully.
"; - // die("Tables created successfully.
"); - -} catch (PDOException $e) { - die("Error creating tables: " . $e->getMessage()); -} -//- creating tables - -function get_open_issues_count() { - global $githubToken; - global $gh_api_total; - - $curl_handle = curl_init(); - curl_setopt($curl_handle, CURLOPT_URL, 'https://api.github.com/repos/red-prig/fpps4-game-compatibility'); - curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('Accept: application/vnd.github+json', 'Authorization: Bearer '.$githubToken)); - curl_setopt($curl_handle, CURLOPT_USERAGENT, "php/curl"); - curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2); - curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); - $buffer = curl_exec($curl_handle); - curl_close($curl_handle); - $data = json_decode($buffer, true); - - $gh_api_total++; - echo "Open issues counted successfully.
"; - return $data['open_issues_count']; -} - -function get_open_issues($page) { - global $githubToken; - global $gh_api_total; - - $curl_handle = curl_init(); - curl_setopt($curl_handle, CURLOPT_URL, 'https://api.github.com/repos/red-prig/fpps4-game-compatibility/issues?page='.$page.'&per_page=100&state=open&direction=ASC'); - curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('Accept: application/vnd.github+json', 'Authorization: Bearer '.$githubToken)); - curl_setopt($curl_handle, CURLOPT_USERAGENT, "php/curl"); - curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2); - curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); - $buffer = curl_exec($curl_handle); - curl_close($curl_handle); - - // echo "processed page $page.
"; - $gh_api_total++; - return $buffer; -} - -function insert_issue($issue, $conn) { - $id = $issue['number']; - $title = $issue['title']; - $cusaCode = extract_cusaCode($title); - $tags = implode(', ', array_column($issue['labels'], 'name')); - $updatedDate = date('d/m/Y', strtotime($issue['updated_at'])); - - $id = filter_var($id, FILTER_VALIDATE_INT); - $title = filter_var($title, FILTER_SANITIZE_STRING); - $cusaCode = filter_var($cusaCode, FILTER_SANITIZE_STRING); - $tags = filter_var($tags, FILTER_SANITIZE_STRING); - $updatedDate = filter_var($updatedDate, FILTER_SANITIZE_STRING); - - // Handle homebrews and remove CUSA code from the title - if (in_array("app-homebrew", array_column($issue['labels'], 'name'))) { - $cusaCode = "HOMEBREW"; - $clean_title = preg_replace('/\s-\s.*$/', '', $title); - $clean_title = trim(explode('(Homebrew)', $clean_title)[0]); - $clean_title = trim(explode('Homebrew', $clean_title)[0]); - //$clean_title = trim(explode('Game', $clean_title)[0]); - $clean_title = rtrim($clean_title, ' '); - } else if (in_array("app-system-fw505", array_column($issue['labels'], 'name'))){ - $cusaCode = "SYSTEM APP"; - $clean_title = preg_replace('/\s-\s.*$/', '', $title); - } else if (in_array("app-ps2game", array_column($issue['labels'], 'name'))){ - $cusaCode = "PS2 GAME"; - $clean_title = preg_replace('/\s-\s.*$/', '', $title); - } else { - $clean_title = preg_replace('/\b' . preg_quote($cusaCode, '/') . '\b/', '', $title); - $clean_title = preg_replace('/\s+-\s+/', ' - ', $clean_title); - $clean_title = rtrim($clean_title, '- '); - $clean_title = rtrim($clean_title, ' '); - $clean_title = rtrim($clean_title, '[]'); - } - - // Filter labels and give them the correct names - $filteredTags = array_filter($issue['labels'], function ($label) { - return in_array($label['name'], ['status-nothing', 'status-boots', 'status-ingame', 'status-menus', 'status-playable']); - }); - - $tagNames = array_map(function ($label) { - return ucwords(str_replace('status-', '', $label['name'])); - }, $filteredTags); - - if (empty($tagNames)) { - $tagNames = ['N/A']; - } else { - // Define the order of the tags - $tagOrder = [ - 'status-playable', - 'status-ingame', - 'status-menus', - 'status-boots', - 'status-nothing' - ]; - - // Sort the tags - usort($tagNames, function ($a, $b) use ($tagOrder) { - return array_search($a, $tagOrder) <=> array_search($b, $tagOrder); - }); - - // Take the best tag - $tagNames = array_slice($tagNames, 0, 1); - } - - $tags = implode(', ', $tagNames); - - // Use prepared statement to insert data into the database - $insert_query = "INSERT INTO newIssues (id, cusaCode, title, tags, updatedDate) VALUES (:id, :cusaCode, :clean_title, :tags, :updatedDate)"; - $stmt = $conn->prepare($insert_query); - $stmt->bindParam(':id', $id, PDO::PARAM_INT); - $stmt->bindParam(':cusaCode', $cusaCode, PDO::PARAM_STR); - $stmt->bindParam(':clean_title', $clean_title, PDO::PARAM_STR); - $stmt->bindParam(':tags', $tags, PDO::PARAM_STR); - $stmt->bindParam(':updatedDate', $updatedDate, PDO::PARAM_STR); - - if (!$stmt->execute()) { - die("Error inserting issue: " . $stmt->errorInfo()[2]); - } -} - -function extract_cusaCode($title) { - preg_match('/CUSA[0-9]{5,}/', $title, $matches); - if (!empty($matches)) { - return $matches[0]; - } - - return null; -} - -// Images logic -function get_image($cusaCode, $homebrewDB) { - global $issue; - global $serverUsername; - global $conn; - global $homebrewUseragent; - //global $homebrewDB; - $iconUrl = ''; - $avifIconURL = ''; - echo " DEBUG: $cusaCode"; - - try { - if (in_array("app-homebrew", array_column($issue['labels'], 'name'))) { - - $query = "SELECT image FROM homebrews WHERE name = :name"; - $statement = $homebrewDB->prepare($query); - $statement->bindParam(':name', $cusaCode); - $statement->execute(); - $result = $statement->fetch(PDO::FETCH_ASSOC); - //var_dump("image link: $result
"); - //echo "image link: $result
" ; -// if ($result !== false) { - if (!empty($result)) { - $iconUrl = $result['image']; - //echo "Image link: $iconUrl
"; - var_dump("image link: $iconUrl
"); - $avifIconURL = "/home/{$serverUsername}/domains/fpps4.net/public_html/images/HOMEBREW/{$cusaCode}.avif"; - $header = stream_context_create(["http" => ["header" => "User-Agent: $homebrewUseragent\r\n"]]); - $httpsIconUrl = str_replace('http://', 'https://', $iconUrl); - $imageData = file_get_contents($httpsIconUrl, false, $header); - } else { - echo "No record found for the given name.
"; - throw new Exception(); - } -// } else {throw new Exception();} - } else { - global $tmdbHash; - $key = hex2bin($tmdbHash); - $hashme = $cusaCode . '_00'; - $hash = strtoupper(hash_hmac('sha1', $hashme, $key)); - $url = "https://tmdb.np.dl.playstation.net/tmdb2/{$cusaCode}_00_{$hash}/{$cusaCode}_00.json"; - $userAgent = 'Mozilla/5.0 (PlayStation; PlayStation 4/10.71) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15'; - $PS4header = stream_context_create(["http" => ["header" => "User-Agent: $userAgent\r\n"]]); // ps4 useragent cuz im silly - $headers = get_headers($url, false, $PS4header); - if ($headers !== false && strpos($headers[0], '200') !== false) { - $response = file_get_contents($url, false, $PS4header); - if ($response !== false) { - $data = json_decode($response, true); - if (isset($data['icons']) && is_array($data['icons']) && count($data['icons']) > 0) { - $iconUrl = $data['icons'][0]['icon']; - $avifIconURL = "/home/{$serverUsername}/domains/fpps4.net/public_html/images/CUSA/{$cusaCode}.avif"; - $httpsIconUrl = str_replace('http://', 'https://', $iconUrl); - $imageData = file_get_contents($httpsIconUrl, false, $PS4header); - } else {throw new Exception();} - } else {throw new Exception();} - } else {throw new Exception();} - } - - - $imagick = new Imagick(); - if ($imagick->readImageBlob($imageData)) { - $imageFormat = $imagick->getImageFormat(); - if ($imageFormat == 'JPEG' || $imageFormat == 'PNG') { - $imagick->setImageFormat('avif'); - $imagick->setCompressionQuality(75); - $imagick->setImageProperty('avif:effort', '10'); - $imagick->setImageProperty('avif:speed', '8'); - $imagick->thumbnailImage(128, 128, true); - $imagick->setImageProperty('avif:strip', ''); - $imagick->writeImage($avifIconURL); // save the image - } - } - $imagick->clear(); - $imagick->destroy(); - - } catch (Exception $e) { - echo "

$cusaCode got an error while downloading, $e


"; - $columnName = "code"; - $insertQuery = "INSERT INTO GameSkips ($columnName) VALUES (:value1)"; - $stmt = $conn->prepare($insertQuery); - $stmt->bindParam(':value1', $cusaCode, PDO::PARAM_STR); - if (!$stmt->execute()) { - die("Error inserting issue: " . $stmt->errorInfo()[2]); - } - } -} -//- Images logic - -$gh_api_total = 0; -$open_issues_count = get_open_issues_count(); -$total_pages = ceil($open_issues_count / 100); -$total_processed = 0; -$total_skipped = 0; -$CUSA_total_skipped = 0; -$images_downloaded = 0; -$images_skiped = 0; -$homebrewProcessed = 0; -$systemProcessed = 0; -$ps2Processed = 0; -$HB_images_downloaded = 0; -$HB_images_skiped = 0; - -for ($page = 1; $page <= $total_pages; $page++) { - $issues_data = get_open_issues($page); - $issues_array = json_decode($issues_data, true); - - foreach ($issues_array as $issue) { - $title = $issue['title']; - $cusaCode = extract_cusaCode($title); - $avifIconURL = "/home/{$serverUsername}/domains/fpps4.net/public_html/images/CUSA/{$cusaCode}.avif"; - - // Check if cusa code is not empty - if ($cusaCode) { - $query = "SELECT cusaCode FROM newIssues WHERE cusaCode = :cusaCode"; - $stmt = $conn->prepare($query); - $stmt->bindParam(':cusaCode', $cusaCode, PDO::PARAM_STR); - $stmt->execute(); - $check_result = $stmt->fetchAll(PDO::FETCH_ASSOC); - - if (count($check_result) > 0) { - $total_skipped++; - // echo "Duplicate found: " . $cusaCode . "
"; // echo duplicates - continue; - } - $total_processed++; - insert_issue($issue, $conn); - - if (!file_exists($avifIconURL)) { // check for images - // ECHO "
DEBUG: I AM GETTING CHECKED. $cusaCode
"; - $query = "SELECT code FROM GameSkips WHERE code = :code"; - $stmt = $conn->prepare($query); - $stmt->bindParam(':code', $cusaCode, PDO::PARAM_STR); - $stmt->execute(); - // ECHO "
DEBUG: I HAVE BEEN CHECKED. $cusaCode
"; - - if ($stmt->rowCount() > 0) { - $images_skiped++; - continue; - // ECHO "
DEBUG: I HAVE BEEN SKIPPED. $cusaCode
"; - } else { - get_image($cusaCode, $homebrewDB); // Download image - $images_downloaded++; - // ECHO "
DEBUG: I HAVE BEEN DOWNLOADED. $cusaCode
"; - } - } else { - $images_skiped++; - } - - // HOMEBREW GAMES/APPS - } else if (in_array("app-homebrew", array_column($issue['labels'], 'name'))) { - $hb_title = preg_replace('/\s-\s.*$/', '', $title); - $hb_title = trim(explode('(Homebrew)', $hb_title)[0]); - $hb_title = trim(explode('Homebrew', $hb_title)[0]); - //$hb_title = trim(explode('Game', $hb_title)[0]); - $hb_title = rtrim($hb_title, ' '); - - $query = "SELECT title FROM newIssues WHERE title = :title"; - $stmt = $conn->prepare($query); - $stmt->bindParam(':title', $hb_title, PDO::PARAM_STR); - $stmt->execute(); - $checkTitle = $stmt->fetchAll(PDO::FETCH_ASSOC); - if (count($checkTitle) > 0) { - $total_skipped++; - continue; - } - - if (!file_exists("/home/{$serverUsername}/domains/fpps4.net/public_html/images/HOMEBREW/{$hb_title}.avif")) { // check for images - // $query = "SELECT cusaCode FROM GameSkips WHERE homeBrew = :homeBrew"; - $query = "SELECT code FROM GameSkips WHERE code = :code"; - $stmt = $conn->prepare($query); - $stmt->bindParam(':code', $hb_title, PDO::PARAM_STR); - $stmt->execute(); - $check_result = $stmt->fetchAll(PDO::FETCH_ASSOC); - - if (count($check_result) > 0) { - $HB_images_skiped++; - // echo "$hb_title is skipped
"; - } else { - get_image($hb_title, $homebrewDB); // Download image - $HB_images_downloaded++; - // echo "$hb_title getting downloaded
"; - } - } else { - $HB_images_skiped++; - // echo "$hb_title exists
"; - } - - insert_issue($issue, $conn); - $total_processed++; - $homebrewProcessed++; - - } else if (in_array("app-system-fw505", array_column($issue['labels'], 'name'))){ - $query = "SELECT title FROM newIssues WHERE title = :title"; - $stmt = $conn->prepare($query); - $stmt->bindParam(':title', $title, PDO::PARAM_STR); - $stmt->execute(); - $checkTitle = $stmt->fetchAll(PDO::FETCH_ASSOC); - - if (count($checkTitle) > 0) { - $total_skipped++; - continue; - } - $total_processed++; - $systemProcessed++; - insert_issue($issue, $conn); - - } else if (in_array("app-ps2game", array_column($issue['labels'], 'name'))){ - $query = "SELECT title FROM newIssues WHERE title = :title"; - $stmt = $conn->prepare($query); - $stmt->bindParam(':title', $title, PDO::PARAM_STR); - $stmt->execute(); - $checkTitle = $stmt->fetchAll(PDO::FETCH_ASSOC); - - if (count($checkTitle) > 0) { - $total_skipped++; - continue; - } - $total_processed++; - $ps2Processed++; - insert_issue($issue, $conn); - } else { - $CUSA_total_skipped++; - //echo "https://github.com/red-prig/fpps4-game-compatibility/issues/" . $issue['number'] . "
"; - continue; - } - } -} - -// Check if newIssues table is empty -$result = $conn->query("SELECT COUNT(*) as count FROM newIssues"); -if ($result === false) { - die("Error checking table: " . $conn->errorInfo()[2]); -} -echo "newIssues checked succesfully
"; - -$data_count = $result->fetchColumn(); -if ($data_count > 0) { - echo "newIssues is full
"; - - $dropOldTable = $conn->query("DELETE FROM issues"); - if ($dropOldTable === false) { - die("Error dropping table: " . $conn->errorInfo()[2]); - } - echo "oldIssues emptied succesfully
"; - - // move new issues to old issues + cleanup - $moveResult = $conn->query("INSERT INTO issues (id, cusaCode, title, tags, updatedDate) SELECT id, cusaCode, title, tags, updatedDate FROM newIssues"); - if ($moveResult === false) { - die("Error moving data to issues table: " . $conn->errorInfo()[2]); - } - echo "Moved all issues succesfully
"; - - // drop newIssues table - $dropNewTable = $conn->query("DROP TABLE IF EXISTS newIssues"); - if ($dropNewTable === false) { - die("Error dropping table: " . $conn->errorInfo()[2]); - } - echo "newIssues emptied succesfully
"; -} else { - print "
error: No issues found in newIssues. "; -} -$conn = null; - -// print debug stuff -print "
done :D"; -print "
Total pages: " . $total_pages; -print "
Total open issues: " . $open_issues_count; -print "
Total issues without CUSA: " . $CUSA_total_skipped; -print "
Total issues processed: " . $total_processed; -print "
Homebrew's processed: " . $homebrewProcessed; -print "
System Apps processed: " . $systemProcessed; -print "
PS2 Games processed: " . $ps2Processed; -print "
Total duplicates: " . $total_skipped; -print "
Total images downloaded: " . $images_downloaded; -print "
Total images skipped: " . $images_skiped; -print "
Total homebrew images downloaded: " . $HB_images_downloaded; -print "
Total homebrew images skipped: " . $HB_images_skiped; -print "
Total github api requests: " . $gh_api_total; - -// Fake 404 page vv -} else { - http_response_code(404); - include("/home/{$serverUsername}/domains/fpps4.net/public_html/404.php"); -}?> \ No newline at end of file diff --git a/public_html/sizes.css b/public_html/sizes.css index 72a6b1c..54d35e9 100644 --- a/public_html/sizes.css +++ b/public_html/sizes.css @@ -87,7 +87,7 @@ padding: 9px 0; width: 116px; height: 42px; - font-size: 14px; + font-size: 16px; } .bottom-top-text { @@ -207,7 +207,7 @@ padding: 7px 0; width: 100px; height: 34px; - font-size: 12px; + font-size: 14px; } .bottom-desc-text { diff --git a/public_html/style.css b/public_html/style.css index f658d93..bead553 100644 --- a/public_html/style.css +++ b/public_html/style.css @@ -1,3 +1,4 @@ +@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500&display=swap'); /*+ scrollbar */ ::-webkit-scrollbar { width: 0.57rem;} @@ -25,12 +26,13 @@ margin: 0; padding: 0; box-sizing: border-box; - font-family: 'Montserrat', sans-serif; + font-family: 'Rubik', sans-serif; color: var(--text); text-decoration: none; scrollbar-color: var(--main1) #ffffff00; /* - FF scrollbar */ text-rendering: optimizeLegibility; -webkit-tap-highlight-color: transparent; + font-weight: 400; } html {scroll-behavior: smooth; transition: all ease 0.4s;} @@ -69,6 +71,7 @@ body{ position: absolute; top: 16%; font-size:32px; + font-weight: 500; } .main-text { @@ -76,6 +79,7 @@ body{ position: absolute; top: 35%; font-size: 42px; + font-weight: 500; } @@ -87,15 +91,18 @@ body{ } .button { - cursor: pointer; - position: relative; - width: 130px; - height: 50px; - padding: 12px 0; - text-align: center; - border-radius: 8px; - font-size: 16px; - border: 2px solid var(--solidBorder); + cursor: pointer; + position: relative; + width: 130px; + height: 50px; + padding: 12px 0; + border-radius: 8px; + font-size: 16px; + border: 2px solid var(--solidBorder); + display: flex; + align-content: center; + flex-wrap: wrap; + justify-content: center; } .topButtonContainer { @@ -150,6 +157,7 @@ body{ position: absolute; top: 20%; font-size: 39px; + font-weight: 500; } .bottom-desc-text { diff --git a/public_html/styles.css b/public_html/styles.css new file mode 100644 index 0000000..e69de29 -- 2.51.2