תוסף מיקומים 🌍

This plugin remains unfunded, so its future is in some doubt, however, for the time being I have added the following:

@viddekla that should resolve your issue

If you think Locations is awesome and I did a great job here, you can buy me a coffee :coffee:

4 לייקים

I should add the new quick find current location target button on the location selector works for Topic locations too if you disable location input fields. :+1:

Just needs a tweak to styling …

3 לייקים

Important bug fix, please update:

(only impacts user locations entered since this weekends patch, simply enter them again)

3 לייקים

Nice work! I’m seeing an additional broken flag below the username, any idea why?

2 לייקים

Makes me think this is from the Locations Plugin 🌍.

4 לייקים

Yes, you no longer need to run both. In the Locations Plugin, it is trivial to determine the country code, so why not offer a flag to go with it?

3 לייקים

You should lowercase the country code @merefield

2 לייקים

Country codes out of the box in Locations are lower case. Perhaps it relates to a third party data provider.

I offer paid support if someone needs me to take a closer look or PR welcome.

That is the issue, I changed it to lowercase manually and it loaded. Tried Mapquest and Mapbox with same results. I’ll shoot you a PM Rob.

2 לייקים

Hello, thank you for this plugin which is great

I am trying to display the name of my subject on the map because I only have the location

Is there a parameter to activate?

Thank you

לייק 1

Some updates:

@Renato kindly fixed an issue on Category settings:

We had a contribution for the Russian language, thank you!

And finally I added an experimental new Topic List filter called Nearby:

Which lists all the Topics within x km (setting) from the logged in user’s supplied location.

@Barney_Lodge that was inspired by your use case and took up most of my Sunday :slight_smile:

This also fixes the inline location selector for Topics on the modal.

7 לייקים

Oh wow!!! I am loving Discourse !!

Regards

Barney Lodge

3 לייקים

In a past but recent release there was a bug in the UserLocation population logic. That is now fixed, but there may be some data impact.

This doesn’t currently affect much but may affect the map in the future.

You can identify if you have the problem by running this on the rails console:

array_for_fix = Locations::UserLocation.where(state: "state").pluck(:user_id)

if that’s not empty, simply run this:

array_for_fix.each do |id|
  Locations::UserLocationProcess.upsert(id)
end

The other way this can be fixed is manually re-entering the user map location, so basically future user location edits will simply overwrite the bad data.

Apologies for the inconvenience.

If anyone wants to write a migration or rake task, PR welcome.

4 לייקים

Is it possible to implement this feature:

After a user publishes a thread or reply, automatically detect the location based on their current IP address and display it below their avatar in the thread/post—instead of requiring users to manually select it or set it in their profile.

I am willing to provide paid support for this.

Just like ZHIHU.

לייק 1

Involuntary update of user location would be a big departure for this plugin as to date it’s been reliant on voluntary submission and therefore individual user buy-in.

But I can see the case for it. It would make gathering user location much more reliable and less dependent on user action.

There’s already a Post label for user location on every Post. So I think this part is already covered.

I think automated update of user location as a site option during posting is feasible and reasonable so long as:

  • Sites update their T&C’s
  • The location is sufficiently approximate, perhaps to the nearest city? To me tracking people to the street is unlikely to endear users to the site! Perhaps you’d want an option to set granularity to city, province (if generally feasible via data) or country. I’d be interested in other admin’s opinions about this.

It would be optimal if we could standardise on MaxMind, which is the standard IP Geolocation service native to Discourse core.

I would be happy to consider sponsorship to add back end automation as a site option. I’ll contact you via PM to see if we can reach agreement.

3 לייקים

City-level precision is sufficient. Street-level precision would be terrifying.

3 לייקים

Having a granularity option as a site default would be brilliant. As would the ability of the users to alter the granularity / opt out.

2 national forums I run would be great for province granularity. A local one would be great for suburb granularity.

I can easily imagine sites using all the options.

3 לייקים

Thank you, I ran this and it found something:

discourse(prod)> array_for_fix = Locations::UserLocation.where(state: "state").pluck(:user_id)
=> [175, 12, 578, 1347, 1355, 1, 590]
discourse(prod)* array_for_fix.each do |id|
discourse(prod)*   Locations::UserLocationProcess.upsert(id)
discourse(prod)> end
=> [175, 12, 578, 1347, 1355, 1, 590]

Then I ran the first command again and it still found 590, which also did not vanish when I ran the second command:

discourse(prod)> array_for_fix = Locations::UserLocation.where(state: "state").pluck(:user_id)
=> [590]
discourse(prod)* array_for_fix.each do |id|
discourse(prod)*   Locations::UserLocationProcess.upsert(id)
discourse(prod)> end
=> [590]

What can I do? :thinking: