Skip to content

Commit

Permalink
feat: add support for fof/default-user-preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Sep 9, 2024
1 parent d5de2b1 commit 646b70c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
},
"require-dev": {
"flarum/phpstan": "*",
"fof/drafts": "*"
"fof/drafts": "*",
"fof/default-user-preferences": "*"
},
"scripts": {
"analyse:phpstan": "phpstan analyse",
Expand Down
6 changes: 6 additions & 0 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,10 @@

(new Extend\User())
->registerPreference('showIPCountry', 'boolval', false),

(new Extend\Conditional())
->whenExtensionEnabled('fof-default-user-preferences', fn() => [
(new \FoF\DefaultUserPreferences\Extend\RegisterUserPreferenceDefault())
->default('showIPCountry', false, 'bool'),
]),
];
6 changes: 6 additions & 0 deletions resources/locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ fof-geoip:
user:
settings:
ip_country: Show the flag of the country I post from, based on my IP address

fof-default-user-preferences:
admin:
settings:
showIPCountry: Show the flag of the country the user posts from
showIPCountry-help: This is based on their IP address at the time of posting. The country flag (if enabled) will be visible to all users. Admin users and moderators will see the IP address in the tooltip.

0 comments on commit 646b70c

Please sign in to comment.