Country Flags by IP Address [Deleted]

After update, I got an outdated template error message:

Code:
<xen:require css="snog_flags.css" />
<xen:if is="{xen:helper ismemberof, $visitor, $xenOptions.snog_countryflags_groups} || {$visitor.is_admin} || ({$xenOptions.snog_countryflags_moderator} && {$visitor.is_moderator})">
    <xen:if is="{$user.snog_flag}">
    <dl class="pairsJustified">
        <dt style="padding-top:2px;">{xen:phrase snog_countryflags_country}:</dt>
        <dd><img class="flag-{$user.snog_flag}" style="margin-top:2px;" src="data/countryflags/flags/clear.gif" alt="{$user.snog_country}" title="{$user.snog_country}" /></dd>
    </dl>
    </xen:if>
</xen:if>
 
After update it looks like too much of a gap between country and joined?
There should be no difference in the position of the flag. I don't see it.

The distance from the bottom of the flag to the top of the next line is equal for all lines on all of my styles.

EDIT: Just to be sure I took a screenshot of both the new and old versions and compared them in photoshop. They are identical, the word 'country' is more or less centered on the vertical portion of the flag...

newold.webp
 
Last edited:
Installed 1.1.8 over 1.1.4 and now most of the flags show an R (Reserved) including mine when I'm logged in.
GeoLite2-Country.mmdb exists in the data/countryflags folder. It's got today's date against it.
What's going on?
 
Installed 1.1.8 over 1.1.4 and now most of the flags show an R (Reserved) including mine when I'm logged in.
GeoLite2-Country.mmdb exists in the data/countryflags folder. It's got today's date against it.
What's going on?
That shouldn't be happening. That portion of the program hasn't changed at all.

Try running the Update GeoIP Database cron task manually.

But before you do that, are flags in OLD posts showing that way too?
 
That shouldn't be happening. That portion of the program hasn't changed at all.

Try running the Update GeoIP Database cron task manually.

But before you do that, are flags in OLD posts showing that way too?
Yes, old posts are showing that way. On this page, for example, all the posts were made before I updated the addon. All the members with an R flag have visited since I updated. The one with the Union Flag hasn't visited since I updated.
upload_2015-3-5_7-10-1.webp

Your addon is writing 'Reserved' and ZZ into the xf_user table for users.
Also, I ran the cron and the GeoLite2-Country.mmdb file is bang up to date.
I am disabling the addon for now.
 
Last edited:
It's very possible, it's just adding the 'Tooltip' class to the images. But I'm not going to do a release for a cosmetic change right away.
 
I'll try to do it myself (y)
Anyway, if there are some specific guidelines to add the class Tooltip, will be highly appreciated :coffee:
 
I'll try to do it myself (y)
Anyway, if there are some specific guidelines to add the class Tooltip, will be highly appreciated :coffee:
Since you're using them shown over the avatar, put your site into debug mode and edit the 'message_user_info' - 'Adds country flag to avatar' template modification and change this..
Code:
class="userflag flag-{$user.snog_flag}"

To this..
Code:
class="userflag flag-{$user.snog_flag} Tooltip"

Do the same anywhere else you want to have it displayed as an XF tooltip.
 
Once a user is queried, is the location cached in the database? If so, are there any country conditionals available?
 
Once a user is queried, is the location cached in the database? If so, are there any country conditionals available?
The country flag is stored in the user database table for each user. So, it is accessible by using {$visitor.snog_country}, {$visitor.snog_flag}, {$user.snog_country} or {$user.snog_flag} values for a user.
 
icon_whoa.gif


Awesome!
 
Hello Snog, today I got his error in the server:
0637ec8ba611d8457a834b08e9575126.png

Code:
Server Error Log
Error Info
Countryflags\Db\Reader\InvalidDatabaseException: Error opening database file (/home/foro/public_html/data/countryflags/GeoLite2-Country.mmdb). - library/Snog/CountryFlags/Listener/Includes/Reader.php:248
Generated By: XKnight, 8 minutes ago
Stack Trace
#0 /home/foro/public_html/library/Snog/CountryFlags/Listener/Includes/Reader.php(60): Countryflags\Db\Reader->findMetadataStart('/home/foro/publ...')
#1 /home/foro/public_html/library/Snog/CountryFlags/Listener/Visitor.php(72): Countryflags\Db\Reader->__construct('/home/foro/publ...')
#2 [internal function]: Snog_CountryFlags_Listener_Visitor::visitor(Object(XenForo_Visitor))
#3 /home/foro/public_html/library/XenForo/CodeEvent.php(90): call_user_func_array(Array, Array)
#4 /home/foro/public_html/library/XenForo/Visitor.php(469): XenForo_CodeEvent::fire('visitor_setup', Array)
#5 /home/foro/public_html/library/XenForo/Session.php(274): XenForo_Visitor::setup(94, Array)
#6 /home/foro/public_html/library/XenForo/Controller.php(293): XenForo_Session::startPublicSession(Object(Zend_Controller_Request_Http))
#7 /home/foro/public_html/library/XenForo/Controller.php(306): XenForo_Controller->_setupSession('Index')
#8 /home/foro/public_html/library/XenForo/FrontController.php(346): XenForo_Controller->preDispatch('Index', 'LiveUpdate_Cont...')
#9 /home/foro/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#10 /home/foro/public_html/index.php(13): XenForo_FrontController->run()
#11 {main}
Request State
array(3) {
  ["url"] => string(36) "https://foro.io/index.php?liveupdate"
  ["_GET"] => array(1) {
    ["liveupdate"] => string(0) ""
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(1) "/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}
Could you please give me a hand?
 
Hello Snog, today I got his error in the server:
0637ec8ba611d8457a834b08e9575126.png

Code:
Server Error Log
Error Info
Countryflags\Db\Reader\InvalidDatabaseException: Error opening database file (/home/foro/public_html/data/countryflags/GeoLite2-Country.mmdb). - library/Snog/CountryFlags/Listener/Includes/Reader.php:248
Generated By: XKnight, 8 minutes ago
Stack Trace
#0 /home/foro/public_html/library/Snog/CountryFlags/Listener/Includes/Reader.php(60): Countryflags\Db\Reader->findMetadataStart('/home/foro/publ...')
#1 /home/foro/public_html/library/Snog/CountryFlags/Listener/Visitor.php(72): Countryflags\Db\Reader->__construct('/home/foro/publ...')
#2 [internal function]: Snog_CountryFlags_Listener_Visitor::visitor(Object(XenForo_Visitor))
#3 /home/foro/public_html/library/XenForo/CodeEvent.php(90): call_user_func_array(Array, Array)
#4 /home/foro/public_html/library/XenForo/Visitor.php(469): XenForo_CodeEvent::fire('visitor_setup', Array)
#5 /home/foro/public_html/library/XenForo/Session.php(274): XenForo_Visitor::setup(94, Array)
#6 /home/foro/public_html/library/XenForo/Controller.php(293): XenForo_Session::startPublicSession(Object(Zend_Controller_Request_Http))
#7 /home/foro/public_html/library/XenForo/Controller.php(306): XenForo_Controller->_setupSession('Index')
#8 /home/foro/public_html/library/XenForo/FrontController.php(346): XenForo_Controller->preDispatch('Index', 'LiveUpdate_Cont...')
#9 /home/foro/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#10 /home/foro/public_html/index.php(13): XenForo_FrontController->run()
#11 {main}
Request State
array(3) {
  ["url"] => string(36) "https://foro.io/index.php?liveupdate"
  ["_GET"] => array(1) {
    ["liveupdate"] => string(0) ""
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(1) "/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}
Could you please give me a hand?
Yeah me too, please help, i can't login to forum and admincp with this error !!!!!!
 
Back
Top Bottom