Country Flags by IP Address [Deleted]

Hi. Before I begin to install all the pre-requisites on the server, could anyone please tell me:

1) Is it possible to make only the administrator and moderators see the flags? I want to respect the members' privacy.
2) If a person registers and logs in from multiple countries, is it possible to show multiple flags? That would be a killer feature to detect spammers on the fly.
#1 - Yes
#2 - No
 
@Snog Thank you for responding so quickly. So is the query done at the time of registration only? Does the plugin pull country data from a static file or ping an IP lookup site via an API?
 
@Snog Thank you for responding so quickly. So is the query done at the time of registration only? Does the plugin pull country data from a static file or ping an IP lookup site via an API?
It is checked every time the user visits the site and it pulls the information from a file.

The file is automatically updated once a month (downloaded from MaxMind) to be sure it's accurate.
 
Any idea what this could be?

Code:
[*]Error
The PHP callback Snog_CountryFlags_Option_Group::renderOption is not valid.
It will not be possible to display this option until the problem is resolved by editing the option definition.


curl and bcmath are installed:

root@live [2226 17:29:19 ~]# php -m|grep curl
curl

root@live [2227 17:29:23 ~]# php -m|grep -i math
bcmath
 
Any idea what this could be?

Code:
[*]Error
The PHP callback Snog_CountryFlags_Option_Group::renderOption is not valid.
It will not be possible to display this option until the problem is resolved by editing the option definition.


curl and bcmath are installed:
Make sure you uploaded all of the files to the proper directories on your server.

That error is saying the library/Snog/CountryFlags/Option/Group.php file doesn't exist or is corrupt.
 
This working great for us so far.

Is there anyway a user can fix their flag so it doesn't change? For example one of our mods in Sweden can access the site from work but due to the proxy servers used there, may show as UK or Netherlands. Then Sweden when at home.
 
This working great for us so far.

Is there anyway a user can fix their flag so it doesn't change? For example one of our mods in Sweden can access the site from work but due to the proxy servers used there, may show as UK or Netherlands. Then Sweden when at home.
Sorry, no there isn't.

That is really the whole point of this add-on. To show country changes of a user and possibly alert people of a problem.
 
Next to user name is not an option for posts.

And since I don't have that style, I can only suggest you try changing where the flag is displayed in the add-on options. Or, you can edit the 'message_user_info' template modifications that are for the add-on.

I know with their UIX style, show over avatar and show in extra user info works very well.

flag.webp
 
Last edited:
I can't upgrade to new version!
Server Error
fopen(/home/hiepvhph/domains/filmmaking.com.vn/public_html/xf/data/countryflags/GeoLite2-Country.mmdb): failed to open stream: Permission denied
  1. XenForo_Application::handlePhpError()
  2. fopen() in Snog/CountryFlags/Install.php at line 94
  3. Snog_CountryFlags_Install::install()
  4. call_user_func() in XenForo/Model/AddOn.php at line 215
  5. XenForo_Model_AddOn->installAddOnXml() in XenForo/Model/AddOn.php at line 169
  6. XenForo_Model_AddOn->installAddOnXmlFromFile() in XenForo/ControllerAdmin/AddOn.php at line 236
  7. XenForo_ControllerAdmin_AddOn->actionUpgrade() in XenForo/FrontController.php at line 347
  8. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  9. XenForo_FrontController->run() in /home/hiepvhph/domains/filmmaking.com.vn/public_html/xf/admin.php at line 13
Could you help me @Snog ?
Thank you so much!
 

Attachments

  • CountryFlags.webp
    CountryFlags.webp
    29.1 KB · Views: 3
Check your PHP info and see if allow_url_fopen is set to 'On'. Although that shouldn't make a difference since it's not a URL open that's taking place.

Check if the data/countryflags/GeoLite2-Country.mmdb file exists on your server and make sure it's the same owner that PHP runs as.

Something in your server settings isn't allowing the file to be saved.

If all else fails, try deleting the data/countryflags/GeoLite2-Country.mmdb and data/countryflags/GeoLite2-Country.mmdb.gz files and try upgrading again.
 
Last edited:
If all else fails, try deleting the data/countryflags/GeoLite2-Country.mmdb and data/countryflags/GeoLite2-Country.mmdb.gz files and try upgrading again.
I follow this guide and upgraded sucessfully!
Thank you so much!
 
Since the flag for a user can change multiple times in one day, I don't see this as a feasible possibility.

Maybe for me it would be. Our members are filipinos from different parts of the world and surely will not travel on a daily basis or even monthly.

I'm using a group tag add on and I want to sort our members by group according to places where they currenly are. If someone asks something about a certain country, I could easily tag the members on that certain groups.

I'm currently doing it manually, but it would really be nice if automatic. :D
 
Maybe for me it would be. Our members are filipinos from different parts of the world and surely will not travel on a daily basis or even monthly.

I'm using a group tag add on and I want to sort our members by group according to places where they currenly are. If someone asks something about a certain country, I could easily tag the members on that certain groups.

I'm currently doing it manually, but it would really be nice if automatic. :D
They don't need to travel to have their flag change. There are many reasons why a flag might change. The top two being...

1) They use or change proxy servers
2) They use a mobile service near a country border.

I really wouldn't put that much faith in users not hiding where they actually are. The use of proxy servers is more common than you might think.
 
My members don't have to travel for their flags to change. Sometimes their work is routed through a server in a nother country or same when on their mobile devices. I have a Swede who often shows as UK, a South African who shows as Germany & my make in the UK who shows as in Eire when on his mobile.
 
Top Bottom