diff --git a/index.php b/index.php index bd01169..162cc99 100644 --- a/index.php +++ b/index.php @@ -1,8 +1,8 @@ generate(); - header("Location: " . $_SERVER["REQUEST_SCHEME"] . "://" . $_SERVER["HTTP_HOST"] . dirname($_SERVER["DOCUMENT_URI"]) . "/" . $grid->toString()); + header("Location: ".$_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"].dirname($_SERVER["DOCUMENT_URI"])."/".$grid->toString()); exit(); ?> diff --git a/manifest.json.php b/manifest.json.php index 157b635..12385e9 100644 --- a/manifest.json.php +++ b/manifest.json.php @@ -1,32 +1,33 @@ { "short_name": "Sudoku", "name": "Sudoku", "description": "Remplissez la grille de sorte que chaque ligne, colonne et région (carré de 3×3 cases) contienne tous les chiffres de 1 à 9.", "icons": [{ - "src": "thumbnail.png?grid=&size=48", + "src": "thumbnail.png?size=48", "sizes": "48x48", "type": "image/png" }, { - "src": "thumbnail.png?grid=&size=72", + "src": "thumbnail.png?size=72", "sizes": "72x72", "type": "image/png" }, { - "src": "thumbnail.png?grid=&size=96", + "src": "thumbnail.png?size=96", "sizes": "96x96", "type": "image/png" }, { - "src": "thumbnail.png?grid=&size=144", + "src": "thumbnail.png?size=144", "sizes": "144x144", "type": "image/png" }, { - "src": "thumbnail.png?grid=&size=168", + "src": "thumbnail.png?size=168", "sizes": "168x168", "type": "image/png" }, { - "src": "thumbnail.png?grid=&size=192", + "src": "thumbnail.png?size=192", "sizes": "192x192", "type": "image/png" }], @@ -41,29 +42,29 @@ "name": "Sudoku : cette grille", "short_name": "Ce sudoku", "description": "Continuer cette grille de sudoku", - "url": "", + "url": "", "icons": [{ - "src": "thumbnail.png?grid=&size=48", + "src": "thumbnail.png?size=48", "sizes": "48x48", "type": "image/png" }, { - "src": "thumbnail.png?grid=&size=72", + "src": "thumbnail.png?size=72", "sizes": "72x72", "type": "image/png" }, { - "src": "thumbnail.png?grid=&size=96", + "src": "thumbnail.png?size=96", "sizes": "96x96", "type": "image/png" }, { - "src": "thumbnail.png?grid=&size=144", + "src": "thumbnail.png?size=144", "sizes": "144x144", "type": "image/png" }, { - "src": "thumbnail.png?grid=&size=168", + "src": "thumbnail.png?size=168", "sizes": "168x168", "type": "image/png" }, { - "src": "thumbnail.png?grid=&size=192", + "src": "thumbnail.png?size=192", "sizes": "192x192", "type": "image/png" }] @@ -74,27 +75,27 @@ "description": "Grille de sudoku vierge", "url": ".................................................................................", "icons": [{ - "src": "thumbnail.png?grid=.................................................................................&size=48", + "src": "thumbnail.png?size=48", "sizes": "48x48", "type": "image/png" }, { - "src": "thumbnail.png?grid=.................................................................................&size=72", + "src": "thumbnail.png?size=72", "sizes": "72x72", "type": "image/png" }, { - "src": "thumbnail.png?grid=.................................................................................&size=96", + "src": "thumbnail.png?size=96", "sizes": "96x96", "type": "image/png" }, { - "src": "thumbnail.png?grid=.................................................................................&size=144", + "src": "thumbnail.png?size=144", "sizes": "144x144", "type": "image/png" }, { - "src": "thumbnail.png?grid=.................................................................................&size=168", + "src": "thumbnail.png?size=168", "sizes": "168x168", "type": "image/png" }, { - "src": "thumbnail.png?grid=.................................................................................&size=192", + "src": "thumbnail.png?size=192", "sizes": "192x192", "type": "image/png" }] @@ -105,27 +106,27 @@ "description": "Nouvelle grille de sudoku", "url": ".", "icons": [{ - "src": "thumbnail.png?grid=.528.3....4.9.1...39.562......73.129...1.64.7...42.3656.13.5...28.6.4...4.5287...&size=48", + "src": "thumbnail.png?size=48", "sizes": "48x48", "type": "image/png" }, { - "src": "thumbnail.png?grid=.528.3....4.9.1...39.562......73.129...1.64.7...42.3656.13.5...28.6.4...4.5287...&size=72", + "src": "thumbnail.png?size=72", "sizes": "72x72", "type": "image/png" }, { - "src": "thumbnail.png?grid=.528.3....4.9.1...39.562......73.129...1.64.7...42.3656.13.5...28.6.4...4.5287...&size=96", + "src": "thumbnail.png?size=96", "sizes": "96x96", "type": "image/png" }, { - "src": "thumbnail.png?grid=.528.3....4.9.1...39.562......73.129...1.64.7...42.3656.13.5...28.6.4...4.5287...&size=144", + "src": "thumbnail.png?size=144", "sizes": "144x144", "type": "image/png" }, { - "src": "thumbnail.png?grid=.528.3....4.9.1...39.562......73.129...1.64.7...42.3656.13.5...28.6.4...4.5287...&size=168", + "src": "thumbnail.png?size=168", "sizes": "168x168", "type": "image/png" }, { - "src": "thumbnail.png?grid=.528.3....4.9.1...39.562......73.129...1.64.7...42.3656.13.5...28.6.4...4.5287...&size=192", + "src": "thumbnail.png?size=192", "sizes": "192x192", "type": "image/png" }] diff --git a/nginx-example.conf b/nginx-example.conf index 7b82650..5dda4bd 100644 --- a/nginx-example.conf +++ b/nginx-example.conf @@ -13,7 +13,7 @@ location /sudoku/ { try_files $uri =404; fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php7.3-fpm-sudoku.sock; - fastcgi_index gen-grid.php; + fastcgi_index index.php; include fastcgi_params; fastcgi_param REMOTE_USER $remote_user; fastcgi_param PATH_INFO $fastcgi_path_info; @@ -32,4 +32,4 @@ location ~ "^/sudoku/([1-9.]{81})$" { location @add-php-extention { rewrite ^([^?#]*)(\?.*)?(#.*)?$ $1.php$2$3 last; -} \ No newline at end of file +} diff --git a/service-worker.js.php b/service-worker.js.php index 37ede2c..4198d9a 100644 --- a/service-worker.js.php +++ b/service-worker.js.php @@ -1,5 +1,6 @@ /* @@ -20,7 +21,7 @@ Copyright 2015, 2019, 2020 Google LLC. All Rights Reserved. const OFFLINE_VERSION = 1; const CACHE_NAME = "offline"; // Customize this with a different URL if needed. -const OFFLINE_URL = ""; +const OFFLINE_URL = ""; self.addEventListener("install", (event) => { event.waitUntil( diff --git a/sudoku.php b/sudoku.php index 466828a..7ffd66e 100644 --- a/sudoku.php +++ b/sudoku.php @@ -1,7 +1,8 @@ @@ -11,24 +12,24 @@ Sudoku - - - - - - - - - - - - - - + + + + + + + + + + + + + + - "/> - /thumbnail.png?grid=&size=200"/> + "/> + /thumbnail.png?size=200"/> @@ -48,7 +49,7 @@ diff --git a/thumbnail.png.php b/thumbnail.png.php index acbebd4..2a7fb49 100644 --- a/thumbnail.png.php +++ b/thumbnail.png.php @@ -1,7 +1,8 @@ $value) { + foreach(str_split($_SESSION["currentGrid"]) as $i => $value) { if ($i % 3 == 0) $x++; if ($i % 27 == 0) $y++; if ($value == UNKNOWN) { @@ -58,7 +59,7 @@ $x = $start + 1; $y = $start + 1; $boxSizeMinusTwo = $boxSize - 2; - foreach(str_split($gridStr) as $i => $value) { + foreach(str_split($_SESSION["currentGrid"]) as $i => $value) { if ($value == UNKNOWN) { $bgColor = $white; } else { @@ -93,7 +94,7 @@ $x = $start + 1; $y = $start + 1; $boxSizeMinusTwo = $boxSize - 2; - foreach(str_split($gridStr) as $i => $value) { + foreach(str_split($_SESSION["currentGrid"]) as $i => $value) { if ($value == UNKNOWN) { $bgColor = $white; } else {