[3.2][3.3][BETA] Usermap for phpBB

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
Mike-on-Tour
Registered User
Posts: 98
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by Mike-on-Tour »

3Di wrote:
Sat May 16, 2020 5:32 pm
There are the GPS coordinates for each city/village etc AFAIK, a generic one.

Example
https://www.latlong.net/place/berlin-germany-9966.html -
https://www.google.com/maps/place/52%C2 ... d13.404954

So ideally the logic should be:

1 - user input just the City/Country
2 - code searchs the GPS coordinates
3 - code places the location on the Map

here we need a library. Don't know if exists.
The first one sounds like a good idea, but it is not free - and I was looking for a free solution. And there is one additional point: The place name could have duplicates (and e.g. this is the case in Germany for a lot of places) and thus it is not a precise solution as is the postal code.
And even Google Maps doesn't provide coordinates for every place around the world.
The logic is clear, it's the same which I use except that for city it is the postal code.
Watz fo lunch?
User avatar
thecaretaker1
Registered User
Posts: 94
Joined: Tue Dec 30, 2014 8:38 pm

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by thecaretaker1 »

Mike-on-Tour wrote:
Sun May 17, 2020 5:35 am
The extension is missing the predefined profile field 'location' which is by default part of phpbb. Did you by any chance remove it from your profile fields list?
The profile should look something like this (of course there can be more fields):
UCP_Profile1.jpg
I may have when I removed facebook, twiiter etc.

What would I need to recreate it?

This is my edit profile page with my 2 custom profiles:

Annotation 2020-05-17 122248.png
User avatar
thecaretaker1
Registered User
Posts: 94
Joined: Tue Dec 30, 2014 8:38 pm

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by thecaretaker1 »

I tried creating a profile called Location as a text input, but it didn't work.

Maybe the only way would be for somebody to give me the default MySQL code so I can insert the fields required for the default Location using phpmyadmin ;)
User avatar
thecaretaker1
Registered User
Posts: 94
Joined: Tue Dec 30, 2014 8:38 pm

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by thecaretaker1 »

OK, after many hours, I finally got it to work by creating a new custom profile called "phpbb_location"

It's looking good. Thank you for your efforts.

Annotation 2020-05-18 011022.png
User avatar
thecaretaker1
Registered User
Posts: 94
Joined: Tue Dec 30, 2014 8:38 pm

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by thecaretaker1 »

A small issue, some of the text on the map is in German. I'm guessing this is due to where the map data is collected from on OpenStreetMap. Is there a way to have the map language in British?

For example, Ireland is spelt Irland. On visiting OpenStreetMap website from the UK, the map shows the text Great Britain as the country, but on the User Map it is shown as Vereinigtes Konigreich which thanks to Google translate is German for United Kingdom.

Is there an easy work around for this?

Annotation 2020-05-18 011022.png
User avatar
Mike-on-Tour
Registered User
Posts: 98
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by Mike-on-Tour »

Good to hear that you solved that problem. :D

As to your question about the map, I've never thought about the issue of the map language but you are right. I'm not certain but I believe I've seen some other OSM maps somewhere. I'll do a research and perhaps implement kind of a map selector so users can choose from a selection of map types and languages
Watz fo lunch?
User avatar
Mike-on-Tour
Registered User
Posts: 98
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by Mike-on-Tour »

To all who wish to replace the German map with an international map:

Please replace the file "/ext/mot/usermap/styles/all/template/mot_usermap.js" with the attached file, purge the cache and you should have the different countries displayed with the place names in their respective language.

New file:
mot_usermap.js
(4.05 KiB) Downloaded 15 times
Watz fo lunch?
User avatar
thecaretaker1
Registered User
Posts: 94
Joined: Tue Dec 30, 2014 8:38 pm

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by thecaretaker1 »

You are a star. That is fantastic. It's working really well and my forum users love the extension. Well done.

I've tried some different User Maps over the years I've been running phpbb and yours is the easiest to use and works flawlessly. Your hard work is much appreciated! ;)
User avatar
Mike-on-Tour
Registered User
Posts: 98
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by Mike-on-Tour »

Thanks, I'm glad to hear this.
Watz fo lunch?
User avatar
Mike-on-Tour
Registered User
Posts: 98
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by Mike-on-Tour »

Usermap ver 0.6.0 is available through the download link in the first post. Since we had the discussion of not getting coordinates for every country through geonames.org I've added the possibility to query the Google Maps data base, too (an API Key must be obtained). And since Google doesn't provide data for every country (e.g. Israel, my apologies to koraldon, now it is clear why he wasn't able to see the user map) I've added the possibility to provide coordinates through the phpbb data base.
The Spanish language pack is now part of Usermap, my sincerest thanks to Jorup16 for his work.

This is the list of all changes/additions in ver 0.6.0:
- Added Spanish language pack (courtesy of Jorge aka Jorup16)
- Added an additional search for coordinates with Google Maps API by country and zip code
- Added an additional search for coordinates within an internal data base
- Added corresponding config and config_text keys to the settings tab
- Added a new table 'usermap_zipcodes' to store the data base input
- Added a new ACP tab to list and amend the internal data base
- Deleted unused variables in ACP modules database_module.php, lang_module.php and main_module.php
- Updated sql queries in 'main_listener.php', 'lang_module.php' and 'main.php'

Your questions are welcome.
Watz fo lunch?
User avatar
Mike-on-Tour
Registered User
Posts: 98
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by Mike-on-Tour »

Version 0.6.0 contains an error which results in an AJAX error message during enabling and, if it works afterwards, possibly in error messages if users try to set their data in the UCP. I've corrected this with version 0.6.1 which is available through the download link in the initial post.

Everybody who experienced this error message and wasn't able to enable the extension is only a few steps away from a working usermap. Just delete the extension data within the ACP, purge the cache, replace all extension files with those in the download package, enable it and you should be set.

Everybody using version 0.5.x and wishes to update can use the way described within the ACP.

Everybody who got version 0.6.0 working (there should be at least a few since it worked within my test environment) and wants to update and keep the user data (otherwise your users have to fill in their profile data again) should follow this description:
1. Set your board into maintenance mode and back up your data base
2. If it isn't already disable the usermap
3. Using phpMyAdmin (or something similar)
  1. copy 'mot_usermap_doublesarray' into 'mot_usermap_doublesarray_bak' in the table 'phpbb_config_text' (perhaps you have to adjust to your table prefix)
  2. copy the table 'phpbb_usermap_users' into 'phpbb_usermap_users_bak' through the 'operations' tab
4. Within the ACP delete the data of the extension
5. Check by using phpMyAdmin whether you have any lines containing '..._usermap_...' in the table 'phpbb_config_text' except your copy of
...'mot_usermap_doublesarray_bak', if yes delete those
6. Purge the cache
7. Replace all files of Usermap with those of the download package of version 0.6.1
8. Enable Usermap ver. 0.6.1 in the ACP (if you don't see version 0.6.1 refresh the page)
9. Using phpMyAdmin
  1. delete the empty line 'mot_usermap_doublesarray' in table 'phpbb_config_text'
  2. rename 'mot_usermap_doublesaray_bak' into 'mot_usermap_doublesarray'
  3. delete table 'phpbb_usermap_users'
  4. rename table 'phpbb_usermap_user_bak' into 'phpbb_usermap_users'
10. Upload the file 'mot_fill_profiledata.php' (Link) after downloading and unzipping it into the root directory of your board
11. Edit lines 6 - 9 and if applicable 10 (if you changed your table prefix) of 'mot_fill_profiledata.php' according to the values of your
...'config.php' file
12. Run the script through 'yourboard/mot_fill_profiledata.php'
13.Using phpMyAdmin check whether columns 'pf_mot_zip' and 'pf_mot_land' in table 'phpbb_profile_fields_data' contain your users data
...if they are in the Usermap (which should be the case if you have not experienced an error message)
14. Delete 'mot_fill_profiledata.php' from the root directory of your board (IMPORTANT!!!)

You and your users should now enjoy a working usermap without error messages.
Watz fo lunch?
User avatar
Mike-on-Tour
Registered User
Posts: 98
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by Mike-on-Tour »

I've just published version 0.6.2 through the download link in the start post.
It introduces the https protocol for quering the OSM tile server in order to prevent browser warnings in environments using that protocol.
The optimized sql queries of versions > 0.6.0 had an unintended side effect allowing users not listed in the usermap to see it anyway, this side effect is now corrected.

For updating please follow the instructions in the phpbb ACP tab 'Customize'.
Watz fo lunch?
User avatar
thecaretaker1
Registered User
Posts: 94
Joined: Tue Dec 30, 2014 8:38 pm

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by thecaretaker1 »

Version 0.6.2 working well here. ;)
User avatar
Mike-on-Tour
Registered User
Posts: 98
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by Mike-on-Tour »

Thanks for the feed back - the more since it's positive :D
Watz fo lunch?
User avatar
Mike-on-Tour
Registered User
Posts: 98
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael

Re: [3.2][3.3][BETA] Usermap for phpBB

Post by Mike-on-Tour »

Version 0.7.0 is available through the download link in the original post, it comes with an additional overlay to display points of interest. This overlay and a topographical map as a second base map can be selected for display through an additional layer control element in the maps upright corner.
For more details please refer to the download site.

The Spanish language pack isn't updated yet, using it may show some text and labels in the ACP in the English language.
Watz fo lunch?
Post Reply

Return to “Extensions in Development”