[Andy] Country flag

[Andy] Country flag 2.0

Homicide

Administrator

Staff member
Reputation: 50%
Joined
Oct 27, 2025
Messages
352
Description:

Shows a country flag in the message user info block.

(Example of country flag)

Andy Country flag-1.webp


(Example of Privacy page)

Andy Country flag-2.webp


(Example of Options page)

Andy Country flag-3.webp


(Example of User group permissions)

Andy Country flag-4.webp


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

Create a /misc/flags/shiny/32/ directory in your web root.

Setup step 2:

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

Setup step 3:

Update the Country flag Options page with the Image link.

Setup step 4:

Give User group permissions to view the country flag:

Registered = Yes
Unregistered / Unconfirmed = Yes

Setup step 5:

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 ipapi.co API is used. They have a set limit of 1000 API calls per 24 hours, so it might take a few days to update all your members.

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. You can use the Country flag select add-on if you want opt-in.

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:


Q: Is there a way I can update all the members country flags?
A: Yes. The following URL will delete 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:

 

Attachments

Similar threads

Track and analyze user visits based on country and IP data. 🌍 MaxMind GeoIP Support: Accurately resolve user locations with GeoIP data. 🎯 Selective Tracking: Track visits only for specific users...
Replies
0
Views
75
Homicide
Description: Blocks access to specified countries. When a visitor from a blocked country clicks the Contact us, Log in, Register or thread link, they are shown an error message. (Example of...
Replies
0
Views
245
Homicide
Description: Moderate registration by specified country. This add-on is useful if you don't have 'Enable manual approval' enabled. With this add-on you can specify that registrations from specific...
Replies
0
Views
151
Homicide
Transform your sidebar with a comprehensive and visually appealing Traffic Counter & Statistics Widget. Unlike the standard "Who's Online" widget, this tool tracks visits over time and provides...
Replies
0
Views
73
Nitro
Description: Shows a list of bots, guests and members accessing your forum. I suggest following the information in this thread to block bad bot access to your forum:To block bad AI bots from a...
Replies
0
Views
145
Homicide
Back
Top Bottom