Country flag

Country flag 2.1

No permission to buy ($35.00)
Compatible XF 2.x versions
  1. 2.3
Premium upgrade:

This XF2 add-on along with the entire collection can be purchased for $35.00 USD. Your Premium upgrade will allow you to download as many XF2 add-ons as you like for one year. Please see the entire collection located in the Resources area at this URL:

https://www.xf2addons.com/

Description:

Shows a country flag in the message user info block.

(Example of country flag)

pic001.jpg


(Example of Privacy page)

pic002.jpg


(Example of Options page)

pic003.webp


(Example of User group permissions)

pic004.jpg


Features:
  • Privacy option allows members to not show their country flag.
  • All phrases start with countryflag_ for your convenience.
Setup step 1:

Create a /data/files/country_flag/shiny/32 directory on your server.

Setup step 2:

Copy the files from the /flags/shiny/32 located in the Country flag add-on directory to the /data/files/country_flag/shiny/32 directory you created in Setup step 1.

Setup step 3:

Install the MaxMind updater add-on.

https://www.xf2addons.com/resources/maxmind-updater.888/

Setup step 4:

Update the Country flag Options page.

Setup step 5:

Give User group permissions to view the country flag:

Registered = Yes
Unregistered / Unconfirmed = Yes

Setup step 6:

Run the Cron entry for the Country flag manually, this is only required upon initial setup. The Cron entry will run run once a day at 12:00AM UTC.

Database modifications:

This add-on will create two columns in your xf_user table:

andy_country_flag_name
andy_country_flag_display

Questions and Answers:

Q: When I hover the flag with my mouse, the filename is displayed in English, can I phrase this to show the filename in another language?
A: No.

Q: What does the 'Last activity days' in the options page do?
A: This value is used when the Cron entry runs.

Q: How is the country determined?
A: The members IP address is used to determine the country.

Q: When does the Cron entry run?
A: It runs once a day.

Q: Is there a way a member can change their country flag?
A: Yes. The following URL will allow your member to update their country flag:

https://example.com/countryflag/update

Q: Is there a way I can update all the members country flags?
A: Yes. The following URL will delete all members country flags:

https://example.com/countryflag/updateall

The you can run the cron entry to update all members country flags.

Q: Is there a way I can see all the members country flags?
A: Yes. The following URL will show all members country flags:

https://example.com/countryflag/list
Author
AndyB
Views
4,707
First release
Last update

Ratings

5.00 star(s) 1 ratings

More resources from AndyB

Latest updates

  1. See description

    Country flag v2.1 changes: Now uses GeoIp2 database.
  2. See description

    Country flag v2.0 changes: Added URL option to allow members to change their country flag. See...
  3. See description

    Country flag v1.9 changes: Removed unused Image path in options page.

Latest reviews

This add-on works exactly as intended. You just get a free API key from IPstack, and enter the location of the flags database folder on your server, set permissions and go. This add-on fills a need as other similar solutions have been rendered unavailable for new installations due to a geolocation service provider change of terms and conditions.
Back
Top Bottom