Country flag

Country flag [Paid] 2.0

No permission to buy ($35.00)

AndyB

Well-known member
AndyB submitted a new resource:

Country flag - Shows a country flag in the message user info block.

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)

View attachment 215983

(Example of Privacy page)

[ATTACH...

Read more about this resource...
 
If you hover your mouse curser over the flag will it show the county of the flag?
Yes, if you pass your mouse over the flag, it will identify the country that it is.

This add-on takes less than five minutes to implement. You do have to create a free account with IPstack to obtain an API key, which is then entered into the add-on's "Options" screen.

Nice and very rapid work, @AndyB !! I think it clearly shows that the obstacles are not insurmountable.
 
You do have to create a free account with IPstack to obtain an API key, which is then entered into the add-on's "Options" screen.
Yeah I noticed that too, not a big thing but maybe if andy added that into the info of the add on it could help others as i wasn't sure what was what after following the link...
Nice and very rapid work, @AndyB !! I think it clearly shows that the obstacles are not insurmountable.
Yep andy does some great add ons...
 
I can't seem to get it working on my end. I just get dead links images instead of flags?
I put the flags into the root of my website.

website/public_html/misc/flags

CHMOD 644'd flags, shiny, 32.

Tried using image path links of both these:
Code:
misc/flags/shiny/32/
Code:
https://MySite.com/misc/flags/shiny/32/

No change in problem.

1578006389057.png

Would also welcome suggestions on getting the flag to show up under the user-info rather than next to it?
1578006480312.png
 
Your owner and group may be set incorrectly. Are they the same as your forum files?

My forum's flags appear directly underneath the user block. It may depend on the skin you are using as to how/where it is displayed?

I also put my "flags" folder in my forum root (in an existing "images" folder I'd created for legacy avatars and smilies, mainly for redirect purposes from my vBulletin forum) rather in my html root. That way it inherits the same owner/group and permissions as my forum's files.
 

Attachments

  • Screen Shot 2020-01-02 at 6.10.07 PM.webp
    Screen Shot 2020-01-02 at 6.10.07 PM.webp
    26.1 KB · Views: 12
Thanks. I put it in data instead of the root and now it's working!
The data folder is where the Snog flags also resided.

data/flags/shiny/32
 
is there any way to get something like this working that is not ip based? more and more people are using vpn services these days and i can see already a problem of some people not able to change it to their real country....or im wondering of when ppl move etc.....its all ip or nothing? im also thinking if it is a cron job checking peoples locations constantly some may not like that either...to be able to have an option in profile and to make a simple choice to have it display seems ideal...

not sure i understand how this works tho, anyone clarify pls?
 
Any VPN service is going to throw this off — I have seen plenty of it with the Snog add-on with folks i know who are in the US but with non-US flags because they are using VPNs for security. And privacy if desired.

No way around this if you are using an IP-based mechanism. I actually don’t know if any other way you could do it, anyway.

There’s no cron job checking people’s location on an ongoing basis. Cron job only compares users who don’t already have a location flag assigned (mainly new users) with the geolocation IP lookup table, and assigns the flag based on the country result that comes back.

People can disable the whole thing in their privacy screen in their user profile. Personally, I don’t mind a US flag showing, as it simply says I’m at a US IP address. Could be ANYWHERE in the US. It’s not pinpointing my exact location. If I’m in the US But using a Canadian or South Korean IP address (VPN), it will more that flag.

I’ve yet to see anyone on my forum concerned about a flag showing. Especially since as admin I can get their IPv4 (or IPv6 if available) address and look it up myself, pinpointing their exact city/location. The flag add-ones do not do this — they only display a country flag.
 
Last edited:
AndyB updated Country flag with a new update entry:

See description

Country flag v1.3 changes:

Hover over flag with cursor and now it will show just the country name.

Anyone running a previous version should run the updateall function which will delete current country information for all users, then run the Country flag cron entry.

To run the updateall function add this to your forum URL:

countryflag/updateall

Read the rest of this update entry...
 
Question: is there an API request made only once ever per user? Or every single time for every single user everytime the cron runs?
 
Back
Top Bottom