Skip to content

Commit

Permalink
ver 1.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-on-Tour committed Nov 23, 2024
1 parent 28f51ea commit 576ca9a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ All changes to `Usermap for phpBB` will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.2.6] - 2024-11-23

### Added

### Changed
- Maximum PHP version raised to 8.4.x
- Some code improvements

### Fixed

### Removed
- E_USER_ERROR for compatibility with PHP 8.4


## [1.2.5] - 2024-06-17

### Added
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"type": "phpbb-extension",
"description": "Adds a usermap to your forum",
"homepage": "https://www.mike-on-tour.com",
"version": "1.2.5",
"time": "2024-06-17 12:11:57",
"version": "1.2.6",
"time": "2024-11-23 12:11:57",
"license": "GPL-2.0-only",
"authors": [
{
Expand All @@ -14,7 +14,7 @@
"role": "Developer"
} ],
"require": {
"php": ">=7.2.24, <8.3.0",
"php": ">=7.2.24, <8.5.0",
"phpbb/phpbb": ">=3.2.0, <3.4.0@dev",
"composer/installers": "~1.0.0"
},
Expand Down
24 changes: 9 additions & 15 deletions event/main_listener.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
*
* @package Usermap v1.2.5
* @package Usermap v1.2.6
* @copyright (c) 2020 - 2024 Mike-on-Tour
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
Expand Down Expand Up @@ -95,7 +95,7 @@ public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config
$this->db = $db;
$this->user = $user;
$this->log = $log;
$this->phpbb_extension_manager = $phpbb_extension_manager;
$this->phpbb_extension_manager = $phpbb_extension_manager;
$this->language = $language;
$this->php_ext = $php_ext;
$this->root_path = $root_path;
Expand Down Expand Up @@ -159,7 +159,7 @@ function ucp_register_register_after($event)
$message = $this->language->lang('MOT_UCP_GEONAMES_ERROR') . '<br><br>' . sprintf($this->language->lang('RETURN_UCP'), '<a href="' . $this->u_action . '">', '</a>');
if ($gn_username[0] == '')
{
trigger_error($message, E_USER_ERROR);
trigger_error($message, E_USER_WARNING);
}

// check if location was provided during registration
Expand Down Expand Up @@ -270,7 +270,7 @@ public function delete_user_after($event)
public function ucp_profile_info_modify_sql_ary($event)
{
$message = $this->language->lang('MOT_UCP_GEONAMES_ERROR') . '<br><br>' . sprintf($this->language->lang('RETURN_UCP'), '<a href="' . $this->u_action . '">', '</a>');
$this->process_user_profile_data($this->user->data['user_id'], $event['cp_data'], $message, E_USER_ERROR);
$this->process_user_profile_data($this->user->data['user_id'], $event['cp_data'], $message, E_USER_WARNING);
}


Expand Down Expand Up @@ -694,24 +694,18 @@ function google_search($postal_code, $country, $city, &$google_lat, &$google_lng
function db_search($postal_code, $country_code, &$db_lat, &$db_lng)
{
$return = false;
$sql_array = array(
$sql_array = [
'country_code' => $country_code,
'zip_code' => $postal_code,
);
$sql = 'SELECT COUNT(country_code) AS cc_count
FROM ' . $this->usermap_zipcode_table . '
];
$sql = 'SELECT * FROM ' . $this->usermap_zipcode_table . '
WHERE ' . $this->db->sql_build_array('SELECT', $sql_array);
$result = $this->db->sql_query($sql);
$cc_count = (int) $this->db->sql_fetchfield('cc_count');
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);

if ($cc_count == 1)
if ($row)
{
$sql = 'SELECT * FROM ' . $this->usermap_zipcode_table . '
WHERE ' . $this->db->sql_build_array('SELECT', $sql_array);
$result = $this->db->sql_query($sql);
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);
$db_lat = $row['lat'];
$db_lng = $row['lng'];
$return = true;
Expand Down
4 changes: 2 additions & 2 deletions ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
*
* @package Usermap v1.2.5
* @package Usermap v1.2.6
* @copyright (c) 2019 - 2024 Mike-on-Tour
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
Expand All @@ -16,7 +16,7 @@ class ext extends \phpbb\extension\base
protected $phpbb_min_ver = '3.2.0';
protected $phpbb_below_ver = '3.4.0@dev';
protected $php_min_ver = '7.2.24';
protected $php_below_ver = '8.4.0';
protected $php_below_ver = '8.5.0';

public function is_enableable()
{
Expand Down

0 comments on commit 576ca9a

Please sign in to comment.