gbcl / userip
Flarum的地理位置服务
1.1.0
2024-07-30 15:36 UTC
Requires
- php: ^8.0
- flarum/core: ^1.7.0
- guzzlehttp/guzzle: ^6.0 || ^7.0
README
在帖子下方显示IP地址
屏幕截图
安装
composer require gbcl/userip:"*"
php flarum migrate
更新
composer update gbcl/userip:"*"
php flarum cache:clear
php flarum migrate
移除
composer remove gbcl/userip php flarum cache:clear
如何使用
只需在管理面板中打开扩展即可。 :)
功能
- 支持使用CDN的网站
- 简洁、详细、易懂的风格
- 无bug(可能?)
扩展
您可以轻松扩展此扩展以支持不同的API提供商,只需遵循以下步骤
- 在您的新扩展中,将
gbcl/userip
作为依赖项 - 定义一个新的服务,该服务实现
GBCLStudio\GeoIp\Api\GeoIpInterface
并扩展GBCLStudio\GeoIp\Api\Service\BaseService
- 在您的新扩展的extend.php中注册服务:
new GBCLStudio\GeoIp\Extend\ApiProvider(MyNewService::class);
- 在
gbcl-userip
命名空间下提供所需的翻译,例如:gbcl-userip.admin.service.YOUR_NEW_EXTENSION.label
,具体的翻译文本可以在这里找到
注意
参考以下项目的代码:fof/geoip, fof/oauth
在afdian上支持我的工作