Locations 插件 🌍

|||
-|-|-|
:information_source: | 摘要 | 允许您将地理编码的位置与主题相关联,并在精美的地图上显示它们。还允许您的用户记录他们的位置,并在您网站上的中央用户地图上集体显示它们。
:hammer_and_wrench: | 仓库链接 | GitHub - merefield/discourse-locations: Tools for handling locations in Discourse · GitHub
:open_book: | 安装指南 | 如何在 Discourse 中安装插件
:heart: | 赞助 | 请考虑成为我开源工作的持续赞助人,赞助级别可根据您或您组织的需求和资源来选择,以确保此插件获得应有的维护,并在未来继续为您网站服务。

喜欢这个插件吗?请在 GitHub 上为它 :star:

文档

在仓库中查看自述文件

支持

我不为免费用户提供任何保证的支持。我可以为注册了我的黄金或白金月度赞助级别的企业或机构提供支持。

有一个一次性错误排查选项

还有一个与用户地图改进相关的当前赞助机会:

110 个赞
OpenStreet maps embedding
Events Plugin :calendar:
Learn how to build Discourse plugins by helping me
Suitability of Discourse for Discussion on Page
Locations dropdown (Google maybe?)
Enable tagging only in some categories
My 2nd Discourse forum, 2 years after the first one
How to add custom fields to models
2020: The Year in Review
Events Plugin :calendar:
Listing users by group - ERROR: missing FROM-clause entry for table "groups"
2021: The Year in Review
A "Votes" option for the top menu in main page
Forum Completely Broken 2.8.5
It's Time We Talked About Tags
Who use event plugin in their discourse community?
Automated map
Configure plugin Custom Wizard for autoposting
2022: The Year in Review
Show a modal dialog after clicking toolbar button via a plugin
Must have plugins and components for Discourse?
Getting a 500 error on the mobile for bookmark and some category pages
Get aggregate user location data from IP addresses?
Could a List of Recommended Topics Be Added to the Top Menu?
2023: The Year in Review
¿Cómo encuentro a una persona en Discourse?
New Theme: Tag-Pages Navigation
Is it possible to add a location and display them on a map?
Generating an ical to use with a custom map
Remove overriding of cmd/ctrl-f
Locate a feature like the one shown in the photo
Usercard Redesign Experiment
2024: The Year in Review
Migrated my old custom-built trail-journal/blog to Discourse
Newly created topic shown location based on device
Alternative post templates
What happens next?
Discourse-events 'this.router' error
National Flags
How minimal is your forum?
Layouts Plugin
Suggestions on how I can have hundreds of small groups (e.g. streets in a town)?
Problème accès aux onglets des paramètres des catégories
Discourse.fontawesome-6-upgrade needs updating
Locations plugin modifications
Traditional multi level hierarchy vs flat discourse hierarchy
More options to filter users on users page
Project ideas for Google Summer of Code 2018
Traditional multi level hierarchy vs flat discourse hierarchy
Any way to display Location below the name in posts?
Topic List Previews (legacy)
Developing with Discourse
Calendar plugin features to make it really useful for us
Learn how to build Discourse plugins by helping me
Developing
Discourse-common asset availability: difference between development and production?
2018: The Year in Review
Object instead of users due to locations plugin
Inserting a date with Paris timezone gives me Berlin
Failed building stable due to 3rd party plugin
Events Plugin :calendar:
How to make a topic filter based on current user group and topic location
2019: The Year in Review
United states map
Fig - Native Discourse client for iOS
Loading slider issues
Job exception: undefined method `name' for
A plugin to "check" a portion of a post before it can be posted

我对这项技术还非常陌生。我已经安装了插件(我在汉堡菜单中看到了“地图”命令,并且在用户个人资料页面中有一个位置字段(已通过 Nominatim 成功进行地理编码)),但是……

我在编辑器中没有看到“添加位置”按钮。

这是我的配置:

这是编辑器窗口:

最后,这是我安装插件的方式:

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-math.git
          - git clone https://github.com/paviliondev/discourse-events.git
          - git clone https://github.com/paviliondev/discourse-locations.git
          - git clone https://github.com/davidtaylorhq/discourse-whos-online.git
          - git clone https://github.com/discourse/twitter-profile-link.git
          - git clone https://github.com/discourse/discourse-tooltips.git

我尝试将 locale 设置为 en,结果相同。

2 个赞

好吧,更正一下:该插件在用户资料中按预期工作。

根据地图显示,我已经“去世”了,因为地图上的定位点位于蒙特利尔最大的公墓中央:

13 个赞

您希望使用的每个类别也必须启用该功能。

6 个赞

谢谢!已经生效了。

顺便提一下,复选框默认是“开启”的,但!你需要先显示设置面板,取消勾选后再重新勾选,该功能才能真正生效。

4 个赞

很高兴它起作用了。我已经很久没使用这个插件了,所以那只是我的最佳猜测。

3 个赞

@angus 我最近注意到,当用户的个人资料中未填写位置时会出现这个问题:

不过并非所有用户都会出现此问题,我还无法完全确定其规律。

是否是因为那些删除了个人资料中位置的用户?或者是因为位置字段是空字符串(例如 “”)而不是 NULL?:thinking:

3 个赞

看起来最近的更新完全移除了用户卡片中的位置信息。

用户卡片:
user-card

用户资料:

3 个赞

这很可能是由于核心中的以下变更引起的:

5 个赞

@omarfilip @david 感谢分享见解 :+1:t2:

@angus 这个你能修改吗?

4 个赞

@david @Richie 谢谢,该插件已更新以支持此变更。

提醒一下,该插件即将与 Pavilion 其他主要插件采用相同的更新周期。这意味着它将在每月的第一周与最新的 Discourse 核心版本保持一致。关于该插件的具体细节将随后公布,但可先参考以下内容:

5 个赞

感谢迅速修复,Angus。

4 个赞

你好 @angus,已确认位置现在会显示在用户卡片上,但我们仍遇到以下问题:即使某些用户未输入位置信息,其卡片上仍会显示地图图钉和地图图标:

在完整的个人资料页面中也是如此:

4 个赞

由于 locations 插件,我无法启动 Discourse 应用。日志附在下面,如果我在 app.yml 中注释掉 locations 部分,它就能正常工作。有人能优先处理并修复这个问题吗?

另外,有没有办法只升级到该插件的“测试通过”版本(如果有的话),就像主 Discourse 应用那样?这样我们以后就不会再遇到类似的问题了。

日志
5: from /var/www/discourse/plugins/discourse-layouts/plugin.rb:49:in `block in activate!'
4: from /var/www/discourse/lib/discourse_event.rb:13:in `trigger'
3: from /usr/local/lib/ruby/2.6.0/set.rb:338:in `each'
2: from /usr/local/lib/ruby/2.6.0/set.rb:338:in `each_key'
1: from /var/www/discourse/lib/discourse_event.rb:14:in `block in trigger'
/var/www/discourse/plugins/discourse-locations/plugin.rb:234:in `block in activate!': uninitialized constant DiscourseLayouts::WidgetHelper
Did you mean?  DiscourseLayouts::WidgetSerializer (NameError)

** 不兼容的插件 **

由于插件 /var/www/discourse/plugins/discourse-locations 中的错误,您无法构建 Discourse。

请尝试移除该插件并重新构建!
I, [2020-04-25T20:32:06.399307 #1]  INFO -- : gem install icalendar -v 2.4.1 -i /var/www/discourse/plugins/discourse-events/gems/2.6.5 --no-document --ignore-dependencies --no-user-install
注意!iCalendar 2.0 与 1.x 版本不兼容。请参阅 README 了解新语法。

注意!icalendar 2.2.0 默认切换到非严格解析。如果您依赖严格解析,请参阅 README 了解如何启用它。

ActiveSupport 是 TimeWithZone 支持所必需的,但对于一般使用并非必需。
成功安装 icalendar-2.4.1
已安装 1 个 gem
gem install geocoder -v 1.4.4 -i /var/www/discourse/plugins/discourse-locations/gems/2.6.5 --no-document --ignore-dependencies --no-user-install
成功安装 geocoder-1.4.4
已安装 1 个 gem

I, [2020-04-25T20:32:06.400580 #1]  INFO -- : 终止异步进程
I, [2020-04-25T20:32:06.400773 #1]  INFO -- : 向 HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main pid: 50 发送 INT 信号
I, [2020-04-25T20:32:06.400979 #1]  INFO -- : 向 exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 167 发送 TERM 信号
167:signal-handler (1587846726) 收到 SIGTERM 信号,计划关闭...
2020-04-25 20:32:06.401 UTC [50] LOG:  收到快速关闭请求
2020-04-25 20:32:06.403 UTC [50] LOG:  中止所有活动事务
2020-04-25 20:32:06.406 UTC [50] LOG:  工作进程:逻辑复制启动器 (PID 59) 以退出代码 1 退出
167:M 25 Apr 2020 20:32:06.406 # 用户请求关闭...
167:M 25 Apr 2020 20:32:06.406 * 在退出前保存最终的 RDB 快照。
2020-04-25 20:32:06.409 UTC [54] LOG:  正在关闭
2020-04-25 20:32:06.439 UTC [50] LOG:  数据库系统已关闭
167:M 25 Apr 2020 20:32:06.502 * 数据库已保存到磁盘
167:M 25 Apr 2020 20:32:06.502 # Redis 现在可以退出,再见...


失败
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' 失败,返回状态为 #<Process::Status: pid 13098 exit 1>
失败位置:/pups/lib/pups/exec_command.rb:112:in `spawn'
执行失败,参数为 {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
b5a02d7f9df6b6a9dc160e269de30eef49bb0aeaf5dcb1b712bab5e6edad4030
** 引导失败 ** 请向上滚动并查找之前的错误消息,可能不止一条。
./discourse-doctor 可能有助于诊断问题。
root@discuss:/var/discourse#
3 个赞

@k4rtik 感谢您的报告,很抱歉给您带来了影响。您遇到的问题是由以下原因导致的:

  1. layouts 插件在两天前进行了更新。
  2. locations 插件当时仍支持 layouts 插件的旧版本。
  3. 您同时使用了这两个插件。
  4. 您在 layouts 插件首次更新后、locations 插件添加对新版本支持之前,更新了您的 Discourse。

我已更新 locations 插件以支持新的 layouts 插件版本:https://github.com/paviliondev/discourse-locations/commit/52aec30461f8439c6658fdc401127cb52881ab49。现在,当您同时安装这两个插件进行更新时,问题将得到解决。@Richie 这也将修复您的问题:Add include? to geo_json in user_card serializer · merefield/discourse-locations@5185063 · GitHub

在这种情况下,拥有 tests-passed 分支 unfortunately 无法提供太大帮助,而且在其他许多插件不兼容的情况下也是如此。用户的更新频率各不相同,自定义组合也多种多样。

不过,我们已经开始采取一些措施来解决这个问题。我们将实施一项计划,确保 Pavilion 的主要开源插件(包括本插件、Events、Topic List Previews 等)在每月的 1 日至 5 日(从 5 月开始)的每 24 小时内与 Discourse 保持同步更新。

这为您提供了一个安全窗口,以便在 try.thepavilion.io 上更新所有插件以及 Discourse 本身,并更有把握地确保:

  1. 您不会遇到插件与 Discourse 之间的冲突;即使出现冲突,也将在 24 小时内得到解决。

  2. 您不会因插件本身的变更而遇到问题。任何可能破坏兼容性的插件变更都将在此窗口期之外进行。

这适用于此处列出的所有插件:

此列表未来可能会扩展。更多信息请访问:https://try.thepavilion.io

如果您对此有任何疑问,请随时通过私信联系我,或访问 thepavilion.io 联系我们。

8 个赞

谢谢,是的,我一直在试图弄清楚为什么我的自定义布局在上次更新后也没有显示出来。它似乎仍然没有出现,但我在 Pavilion 上看到你们正在准备发布关于插件变更的更新文档,所以我会再等一段时间。

2 个赞

@angus 已确认 - 问题已解决 :clap:t2:

再次感谢你对该插件的持续支持 :smiley:

4 个赞

你好 @angus,我看到通知说本线程的首条帖子已被编辑。

看起来仓库的位置已变更。

我们需要将 Discourse 设置更新为新位置,还是现有的/旧位置仍会继续更新?

更改插件源位置后,我们是否需要重新构建任何内容?

3 个赞

@Richie,你可以继续使用旧的 URL:https://github.com/angusmcleod/discourse-locations。你可以等到自然有机会时再更新,例如因为其他原因需要重建你的网站时。

该插件已于之前从我的个人 GitHub 仓库转移到了 Pavilion 的仓库。当仓库被转移时,GitHub 会自动将所有指向旧位置的链接重定向到新位置。

首帖在未来几周内会有所调整。我将在 thepavilion.io 上为它编写一些文档,并在这里的 meta 上提供一个简短的描述。

4 个赞

太好了,我之前还不知道这一点 :+1:t2:

再次感谢您的支持!

3 个赞