Country flag

Country flag 1.8

No permission to buy ($35.00)
Compatible XF 2.x versions
  1. 2.2
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:


Shows a country flag in the message user info block.

(Example of country flag)


(Example of Privacy page)


(Example of Options page)


(Example of User group permissions)


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

Create a /misc directory in your web root.

Setup step 2:

Copy the flags directory from the add-on folder to the /misc directory.


Setup step 3:

Give User group permissions to view the country flag:

Registered = Yes
Unregistered / Unconfirmed = Yes

Setup step 4:

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:


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: When does the Cron entry run?
A: It runs once a day at 12:00AM UTC time.

Q: When the Cron entry runs, which members will have their country looked up?
A: Only new members which have an empty andy_country_flag_name field.

Q: Is there an option to make the add-on opt-in instead of opt-out?
A: No. Opt-in does not work, member will not take the time to opt-in.

Q: Is there a way I can update all the members country flags?
A: Yes. You can add the following to your forum URL:


The next time the Cron entry runs it will update all your members country flags. Keep in mind inactive members will not be updated, this is a setting in the options page.
First release
Last update
5.00 star(s) 1 ratings

More resources from AndyB

  • Remove edit silently
    Remove edit silently
    Removes 'Edit silently' and 'Clear last edit information' options for moderators.
  • Favicon manager
    Favicon manager
    Allows specifying which favicon.png to use for the admin control panel.
  • Keyword email
    Keyword email
    Sends email to specific member if keyword is mentioned in post.
  • Rsvp
    Provides an RSVP option where members can register for an event.
  • Attachment editor
    Attachment editor
    Allows rotating, resizing and adding a border to attachments.

Latest updates

  1. See description

    Country flag v1.8 changes: Now using for country lookup.
  2. See description

    Country flag v1.7 changes: Now compatible with XF 2.2.6 and newer.
  3. See description

    Country flag v1.6 changes: Removed unused variable in PHP code.

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.