Country Flags by IP Address [Deleted]

I loaded up the addon and only my admin avatar shows the flag. No other members flags are showing. Can anyone comment on a fix for this? Thanks.
Len
Once a user visits, and the cron runs then the flag should show.
Ozzy is close, except users need to visit the site and be logged in for their flag to show.

The cron task just updates the GeoIP database once a month.
 
@Snog got 3x errors today:

Code:
Countryflags\Db\Reader\InvalidDatabaseException: Error opening database file (/home/dressedw/public_html/data/countryflags/GeoLite2-Country.mmdb). - library/Snog/CountryFlags/Listener/Includes/Reader.php:248
Generated By: robertito, Wednesday at 11:03 PM
Stack Trace
#0 /home/dressedw/public_html/library/Snog/CountryFlags/Listener/Includes/Reader.php(60): Countryflags\Db\Reader->findMetadataStart('/home/dressedw/...')
#1 /home/dressedw/public_html/library/Snog/CountryFlags/Listener/Visitor.php(119): Countryflags\Db\Reader->__construct('/home/dressedw/...')
#2 /home/dressedw/public_html/library/XenForo/CodeEvent.php(90): Snog_CountryFlags_Listener_Visitor::visitor(Object(XenForo_Visitor))
#3 /home/dressedw/public_html/library/XenForo/Visitor.php(477): XenForo_CodeEvent::fire('visitor_setup', Array)
#4 /home/dressedw/public_html/library/XenForo/Session.php(274): XenForo_Visitor::setup(401, Array)
#5 /home/dressedw/public_html/library/XenForo/Controller.php(293): XenForo_Session::startPublicSession(Object(Zend_Controller_Request_Http))
#6 /home/dressedw/public_html/library/XenForo/Controller.php(306): XenForo_Controller->_setupSession('Errornotfound')
#7 /home/dressedw/public_html/library/XenForo/FrontController.php(368): XenForo_Controller->preDispatch('Errornotfound', 'XenForo_Control...')
#8 /home/dressedw/public_html/library/XenForo/FrontController.php(152): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /home/dressedw/public_html/index.php(13): XenForo_FrontController->run()
#10 {main}
Request State
array(3) {
  ["url"] => string(44) "http://www.dressedwell.net/forum/favicon.ico"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
@Snog got 3x errors today:

Code:
Countryflags\Db\Reader\InvalidDatabaseException: Error opening database file (/home/dressedw/public_html/data/countryflags/GeoLite2-Country.mmdb). - library/Snog/CountryFlags/Listener/Includes/Reader.php:248
Generated By: robertito, Wednesday at 11:03 PM
Stack Trace
#0 /home/dressedw/public_html/library/Snog/CountryFlags/Listener/Includes/Reader.php(60): Countryflags\Db\Reader->findMetadataStart('/home/dressedw/...')
#1 /home/dressedw/public_html/library/Snog/CountryFlags/Listener/Visitor.php(119): Countryflags\Db\Reader->__construct('/home/dressedw/...')
#2 /home/dressedw/public_html/library/XenForo/CodeEvent.php(90): Snog_CountryFlags_Listener_Visitor::visitor(Object(XenForo_Visitor))
#3 /home/dressedw/public_html/library/XenForo/Visitor.php(477): XenForo_CodeEvent::fire('visitor_setup', Array)
#4 /home/dressedw/public_html/library/XenForo/Session.php(274): XenForo_Visitor::setup(401, Array)
#5 /home/dressedw/public_html/library/XenForo/Controller.php(293): XenForo_Session::startPublicSession(Object(Zend_Controller_Request_Http))
#6 /home/dressedw/public_html/library/XenForo/Controller.php(306): XenForo_Controller->_setupSession('Errornotfound')
#7 /home/dressedw/public_html/library/XenForo/FrontController.php(368): XenForo_Controller->preDispatch('Errornotfound', 'XenForo_Control...')
#8 /home/dressedw/public_html/library/XenForo/FrontController.php(152): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /home/dressedw/public_html/index.php(13): XenForo_FrontController->run()
#10 {main}
Request State
array(3) {
  ["url"] => string(44) "http://www.dressedwell.net/forum/favicon.ico"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
Check your data/countryflags folder and be sure the GeoLite2-Country.mmdb file exists.

If it doesn't try manually running the "Update GeoIP Database" cron task to see if it gets downloaded to that folder.

Even if it does exist, try running the cron task to update it. The file may be corrupt.
 
Last edited:
I gather 1.x doesn't work on php 7.x? even though under 'Configure Command' I see "--enable-bcmath=shared"
 
Last edited:
For some reason it says i live in singapore though i live in Australia. I have both bcmath and curl install, also no errors
 
For some reason it says i live in singapore though i live in Australia. I have both bcmath and curl install, also no errors
If you're viewing your site with a proxy, the proxy IP address is being picked up. Though I try to pick up Opera proxies, this could also be true if you're using Opera on a mobile device. And your provider may also be using an automatic proxy which is impossible to detect.

If you're not, then the IP address hasn't been updated at MaxMind yet. I have no control over that.

EDIT: There is one more time the wrong IP address can be picked up and that's if the IP address being returned is the IP address of your site's server. That's a server configuration problem that I can't help with. It's been known to happen most often with nginx.
 
Nooooooooooooooooooooooooooooooooooooooooooooooooooooooo
Now you had to know it was coming. I stopped selling my XF1 add-ons eons ago and now the free XF1 add-ons are no longer available.

I thought you switched to XF2 anyway???

 
Top Bottom