From 4d4ee0d73d08718ee1577d4623f103621eca6765 Mon Sep 17 00:00:00 2001 From: Astu04 Date: Tue, 25 Jul 2023 11:31:51 +0200 Subject: [PATCH 01/12] Add a place holder for when there is no group --- modal/areas_modal.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modal/areas_modal.php b/modal/areas_modal.php index 4ac194f1..4a31abea 100644 --- a/modal/areas_modal.php +++ b/modal/areas_modal.php @@ -56,13 +56,15 @@ echo "
"; foreach ($areas as $group => $areaList) { + // Check if $group is empty or null, and set the default text accordingly + $buttonText = !empty($group) ? $group : "No group"; $updatedGroup = str_replace(' ', '_', $group); echo "
From d70a749911e7d0ecb1630b479c6d009277e2bd1e Mon Sep 17 00:00:00 2001 From: TMH Date: Fri, 18 Aug 2023 00:53:38 +0200 Subject: [PATCH 02/12] update Dockerfile, build and push Image --- .github/workflows/publish.yml | 35 +++++++++++++++++++++++++++++++++++ Dockerfile | 8 ++++---- discord_auth.php | 3 ++- include/functions.php | 4 +++- 4 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..2215d080 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +name: publish + +on: [push] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build and push Docker image + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 5b689081..05ab6bca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,19 @@ -FROM php:7-apache +FROM php:8.1-apache RUN rm -rf /var/www/html/* WORKDIR /var/www/html/ # Install Node RUN apt-get update && apt-get -y install curl gnupg -RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - +RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - RUN apt-get update && apt-get -y install nodejs # Install PHP modules RUN docker-php-ext-install mysqli # Install Node depdencies -COPY package.json . +COPY package.json . COPY config.env.php config.php RUN npm install # Install PoracleWeb -COPY . . +COPY . . diff --git a/discord_auth.php b/discord_auth.php index 33f2a541..2c3cbbb4 100644 --- a/discord_auth.php +++ b/discord_auth.php @@ -6,6 +6,7 @@ error_reporting(E_ALL); include_once "./config.php"; +include_once "include/defaults.php"; define('OAUTH2_CLIENT_ID', $discordBotClientId); //Your client Id define('OAUTH2_CLIENT_SECRET', $discordBotClientSecret); //Your secret client code @@ -67,7 +68,7 @@ { header("Location: $redirect_url?type=display&page=server_settings"); } - else if ( version_compare($_SESSION['poracleVersion'], @$min_poracle_version) < 0 ) + else if ( version_compare($_SESSION['poracleVersion'], $min_poracle_version) < 0 ) { header("Location: $redirect_url?type=display&page=server_settings"); } diff --git a/include/functions.php b/include/functions.php index f9afa9af..58a42267 100644 --- a/include/functions.php +++ b/include/functions.php @@ -356,7 +356,9 @@ function get_gym_color($id) { function set_locale() { global $conn; - $_SESSION['locale'] = $_SESSION['server_locale']; + if (isset($_SESSION['server_locale'])) { + $_SESSION['locale'] = $_SESSION['server_locale']; + } if (isset($_SESSION['id'])) { include_once "./config.php"; From 98e5b213d890fed6ff66ba64da7e7a57f4e718f4 Mon Sep 17 00:00:00 2001 From: TMH Date: Wed, 23 Aug 2023 20:01:46 +0200 Subject: [PATCH 03/12] update the docker-compose file --- docker-compose.example.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/docker-compose.example.yml b/docker-compose.example.yml index f2bba93a..5be87906 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -1,27 +1,28 @@ version: '3.1' services: poracle-web: - build: ./poracleWeb # folder or subfolder where poracle-web is located + image: docker pull ghcr.io/bbdoc/poracleweb:main container_name: poracle-web restart: unless-stopped tty: true - environment: - PORACLE_DB_HOST: poracle-db - PORACLE_DB_DATABASE: poracledb - PORACLE_DB_USERNAME: poracleuser - PORACLE_DB_PASSWORD: dbPassword - PORACLE_DB_PORT: 3306 - ADMIN_ID: 123456789123456 - REDIRECT_URL: https://poracle.map.com # - DISCORD_BOT_CLIENT_ID: 123456789123456789 - DISCORD_BOT_CLIENT_SECRET: abcdefghijklmnopqrstuvwxyz - MAP_URL: https://tiles.map.com/staticmap/poracle-web?img=https://raw.githubusercontent> - MAP_PORACLE_WEB: https://tiles.map.com/staticmap/poracle-web +# for the configuration you can work with environment variables or bind config.php into container +# environment: +# PORACLE_DB_HOST: poracle-db +# PORACLE_DB_DATABASE: poracledb +# PORACLE_DB_USERNAME: poracleuser +# PORACLE_DB_PASSWORD: dbPassword +# PORACLE_DB_PORT: 3306 +# ADMIN_ID: 123456789123456 +# REDIRECT_URL: https://poracle.map.com # +# DISCORD_BOT_CLIENT_ID: 123456789123456789 +# DISCORD_BOT_CLIENT_SECRET: abcdefghijklmnopqrstuvwxyz +# MAP_URL: https://tiles.map.com/staticmap/poracle-web?img=https://raw.githubusercontent> +# MAP_PORACLE_WEB: https://tiles.map.com/staticmap/poracle-web depends_on: - poracle-db - poracle volumes: - - ./poracle/:/poracle/ +# - ./config.php:/var/www/html/config.php - /etc/localtime:/etc/localtime:ro ports: - 127.0.0.1:9060:80 From e58580f1315afd5ddb38aa2b71b21d61affd0a7f Mon Sep 17 00:00:00 2001 From: TMH Date: Wed, 23 Aug 2023 20:06:59 +0200 Subject: [PATCH 04/12] Fix copy paste error --- docker-compose.example.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.example.yml b/docker-compose.example.yml index 5be87906..f67ea4d6 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -1,7 +1,7 @@ version: '3.1' services: poracle-web: - image: docker pull ghcr.io/bbdoc/poracleweb:main + image: ghcr.io/bbdoc/poracleweb:main container_name: poracle-web restart: unless-stopped tty: true From fe37d46922f0e6300b2c116d55684b70c2d572bf Mon Sep 17 00:00:00 2001 From: bbdoc Date: Thu, 31 Aug 2023 12:04:33 +0200 Subject: [PATCH 05/12] Add Gen 9 --- actions/channel_sync.php | 8 ++++++-- include/defaults.php | 2 +- pages/display/pokemon.php | 13 ++++++++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/actions/channel_sync.php b/actions/channel_sync.php index 7872406c..78bfcc18 100644 --- a/actions/channel_sync.php +++ b/actions/channel_sync.php @@ -45,7 +45,9 @@ template, min_weight, max_weight, form, max_atk, max_def, max_sta, gender, pvp_ranking_worst, pvp_ranking_best,pvp_ranking_min_cp, pvp_ranking_league, - profile_no, min_time, rarity, max_rarity + profile_no, min_time, rarity, max_rarity, + pvp_ranking_worst, pvp_ranking_best, pvp_ranking_min_cp, pvp_ranking_league, pvp_ranking_cap, + size, max_size ) SELECT REPLACE(id, ?, ? ), ping, clean, pokemon_id, distance, @@ -56,7 +58,9 @@ template, min_weight, max_weight, form, max_atk, max_def, max_sta, gender, pvp_ranking_worst, pvp_ranking_best,pvp_ranking_min_cp, pvp_ranking_league, - profile_no, min_time, rarity, max_rarity + profile_no, min_time, rarity, max_rarity, + pvp_ranking_worst, pvp_ranking_best, pvp_ranking_min_cp, pvp_ranking_league, pvp_ranking_cap, + size, max_size FROM monsters WHERE id = ? "); diff --git a/include/defaults.php b/include/defaults.php index fb6bfbcd..47b11180 100644 --- a/include/defaults.php +++ b/include/defaults.php @@ -25,7 +25,7 @@ ); $min_poracle_version = "4.6.2"; -$max_pokemon="904"; +$max_pokemon="1008"; $other_grunt_types = array( "7"=>"gold-stop", diff --git a/pages/display/pokemon.php b/pages/display/pokemon.php index 4c97ac8f..800acc1c 100644 --- a/pages/display/pokemon.php +++ b/pages/display/pokemon.php @@ -49,10 +49,14 @@ $result = $conn->query($sql); while ($row = $result->fetch_assoc()) { $gen7 = $row['count']; } -$sql = $sql_base."AND pokemon_id >= 810"; +$sql = $sql_base."AND pokemon_id between 810 and 905"; $result = $conn->query($sql); while ($row = $result->fetch_assoc()) { $gen8 = $row['count']; } +$sql = $sql_base."AND pokemon_id >= 906"; +$result = $conn->query($sql); +while ($row = $result->fetch_assoc()) { $gen9 = $row['count']; } + ?> @@ -176,7 +180,8 @@ class="btn btn-danger"> if ( @$_GET['gen'] == 5 ) { $gen_selector = "AND pokemon_id between 494 and 649"; } if ( @$_GET['gen'] == 6 ) { $gen_selector = "AND pokemon_id between 650 and 721"; } if ( @$_GET['gen'] == 7 ) { $gen_selector = "AND pokemon_id between 722 and 809"; } - if ( @$_GET['gen'] == 8 ) { $gen_selector = "AND pokemon_id >= 810"; } + if ( @$_GET['gen'] == 8 ) { $gen_selector = "AND pokemon_id between 810 and 905"; } + if ( @$_GET['gen'] == 9 ) { $gen_selector = "AND pokemon_id >= 906"; } ?> @@ -201,7 +206,7 @@ class="btn btn-danger">
  • "> -

    +

  • ">
    G1
  • @@ -219,6 +224,8 @@ class="btn btn-danger">
    G7
  • ">
    G8
  • +
  • "> +
    G9
From 86e6fed309d92bdcd8daaa63058b18fecb2afec0 Mon Sep 17 00:00:00 2001 From: bbdoc Date: Thu, 31 Aug 2023 12:32:28 +0200 Subject: [PATCH 06/12] Styling --- pages/display/pokemon.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pages/display/pokemon.php b/pages/display/pokemon.php index 800acc1c..8b336aed 100644 --- a/pages/display/pokemon.php +++ b/pages/display/pokemon.php @@ -206,26 +206,26 @@ class="btn btn-danger"> From 1dde009f6cb1f299f014a0c64b74d9d2aba1d232 Mon Sep 17 00:00:00 2001 From: bbdoc Date: Fri, 1 Sep 2023 08:10:31 +0200 Subject: [PATCH 07/12] Double Declare --- actions/channel_sync.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/actions/channel_sync.php b/actions/channel_sync.php index 78bfcc18..d14dd9d4 100644 --- a/actions/channel_sync.php +++ b/actions/channel_sync.php @@ -44,9 +44,8 @@ atk, def, sta, template, min_weight, max_weight, form, max_atk, max_def, max_sta, gender, - pvp_ranking_worst, pvp_ranking_best,pvp_ranking_min_cp, pvp_ranking_league, - profile_no, min_time, rarity, max_rarity, pvp_ranking_worst, pvp_ranking_best, pvp_ranking_min_cp, pvp_ranking_league, pvp_ranking_cap, + profile_no, min_time, rarity, max_rarity, size, max_size ) SELECT REPLACE(id, ?, ? ), @@ -57,9 +56,8 @@ atk, def, sta, template, min_weight, max_weight, form, max_atk, max_def, max_sta, gender, - pvp_ranking_worst, pvp_ranking_best,pvp_ranking_min_cp, pvp_ranking_league, - profile_no, min_time, rarity, max_rarity, pvp_ranking_worst, pvp_ranking_best, pvp_ranking_min_cp, pvp_ranking_league, pvp_ranking_cap, + profile_no, min_time, rarity, max_rarity, size, max_size FROM monsters WHERE id = ? From a14601ee83b7e29d53ed9c9d9eba112b97da03e1 Mon Sep 17 00:00:00 2001 From: bbdoc Date: Fri, 8 Sep 2023 10:52:01 +0200 Subject: [PATCH 08/12] Remove Need for Nominatim --- modal/distance_show_modal.php | 8 ++++---- pages/display/pokemon.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modal/distance_show_modal.php b/modal/distance_show_modal.php index 2ee533be..593dae1b 100644 --- a/modal/distance_show_modal.php +++ b/modal/distance_show_modal.php @@ -23,14 +23,14 @@

- "True") { ?> -