Country Flags by IP Address [Deleted]

ok, thanks. on the other side there is only the css and no <img> element you use with class="flag-.. Is that intended or did it not import this part?
 
ok, thanks. on the other side there is only the css and no <img> element you use with class="flag-.. Is that intended or did it not import this part?
The <img> element is added in a second member_list_item template modification.

I have installed 1.2.5 and installed the flag system into it. I do not see that code in the standard template. It only appears in the TMS itself. And I did not get any type of message to confirm template changes.

Have you edited the template in any way? Or, do you have some kind of add-on that applies the TMS changes to your templates?
 
OK, now I know what the problem is.

There was a change in the member_info_item template in 1.3 so it isn't finding what it needs to find in 1.2.5.

I'll release a fix for this on Monday.
 
I had some quick free time so I was able to update it today.

I am still not sure why some people need to confirm template changes since I can't reproduce that on any system I have access to.
 
I had some quick free time so I was able to update it today.

I am still not sure why some people need to confirm template changes since I can't reproduce that on any system I have access to.
That is what I meant with manually confirming it. The small button when you open the tms overlay. Is there another way to customize it? As I set different icon sizes at different locations.

just an example:

https://mineyourmind.net/forum/members/cmdpepper.888/
https://mineyourmind.net/forum/threads/agrarian-skies-skyblock-server-reset-major-update.920/

If you like that more than the flags you use, just copy the css :D
 
I can't see the flags you're using without registering. But I probably won't be changing the flags I distribute with the add-on.

Anyway, if you want to use different flags for different pages, just change the css included for each page to your flags. Just be sure to properly name the flags in your css. The css is set for each page in these TMS changes member_card, member_list_item, member_view and post. Each one is labeled as adding the css for the page. Obviously you would need to put your site in debug mode to edit the TMS changes.

And keep in mind there are some flags that are not standard to countries. Such as A1, A2, LO and ZZ. Those are specialized flags. For example, LO is 'Local Intranet' and is used when direct access to a site is used. It appears on my site because my site is hosted in-house and I access it directly via my local network.

A1 = Unknown
A2 = Satellite
LO = Local Intranet
ZZ = Reserved

The A1 is probably the most important. But the others can also appear from time to time.
 
Last edited:
I can't see the flags you're using without registering. But I probably won't be changing the flags I distribute with the add-on.

Anyway, if you want to use different flags for different pages, just change the css included for each page to your flags. Just be sure to properly name the flags in your css. The css is set for each page in these TMS changes member_card, member_list_item, member_view and post. Each one is labeled as adding the css for the page. Obviously you would need to put your site in debug mode to edit the TMS changes.

And keep in mind there are some flags that are not standard to countries. Such as A1, A2, LO and ZZ. Those are specialized flags. For example, LO is 'Local Intranet' and is used when direct access to a site is used. It appears on my site because my site is hosted in-house and I access it directly via my local network.

A1 = Unknown
A2 = Satellite
LO = Local Intranet
ZZ = Reserved

The A1 is probably the most important. But the others can also appear from time to time.
D87n85P.png

HtubPbz.png
RqgD0ic.png
 
I appreciate your efforts on this add-on; just installed the update. My users are loving it (y)

Some feedback:
  • I'm editing the css/template so that the flag URL and clear image are coming from my CDN. If there was a future option to set this it would be helpful. The template is manually edited, but I copy out the CSS and use a find/replace in notepad to insert my CDN prefix to the url on all of the lines.
  • Moving the clear.gif image to an upper-level directory also be helpful so that the countryflags/flags won't show repetitively in the html code. I copied my clear.gif up to the data directory, but am not sure if that is the best place. If there was a way to completely remove the need for clear.gif that would be best, in my mind the sprite image would have to be loaded regardless. These images are tiny, but if we can reduce the roundtrips.
  • Removed the margin-related CSS from the snog_countryflag template. It may be necessary for other sites, but just sharing that it wasn't necessary in mine. Only the img class is retained, so that the appropriate flag could be shown.
Thanks for your efforts!
 
I appreciate your efforts on this add-on; just installed the update. My users are loving it (y)

Some feedback:
  • I'm editing the css/template so that the flag URL and clear image are coming from my CDN. If there was a future option to set this it would be helpful. The template is manually edited, but I copy out the CSS and use a find/replace in notepad to insert my CDN prefix to the url on all of the lines.
  • Moving the clear.gif image to an upper-level directory also be helpful so that the countryflags/flags won't show repetitively in the html code. I copied my clear.gif up to the data directory, but am not sure if that is the best place. If there was a way to completely remove the need for clear.gif that would be best, in my mind the sprite image would have to be loaded regardless. These images are tiny, but if we can reduce the roundtrips.
  • Removed the margin-related CSS from the snog_countryflag template. It may be necessary for other sites, but just sharing that it wasn't necessary in mine. Only the img class is retained, so that the appropriate flag could be shown.
Thanks for your efforts!
The CDN is a real possibility. I hadn't thought of that but I do have an add-on of mine that allows for it.

The clear.gif file is a 43 byte file that if your server is set up properly to allow browser caching should only be loaded once. So round trips shouldn't be a problem. The location has nothing to do with how many times it's loaded. It's no different than avatar locations. They appear every time an avatar is shown. But that doesn't mean the avatar is downloaded every time it's shown in the HTML.

The margin for the flags is there for display aesthetics. You're free to remove it if you like. I may move it to the css itself. We'll see.

EDIT: After a quick review, because the flag is used in multiple places, I can't move the margins to the CSS. That would throw off the display in other areas of the site.
 
Last edited:
hello, i have error :

Code:
Erreur Info
ErrorException: Undefined index: country - library/Snog/CountryFlags/Listener/Visitor.php:39
Généré par: Jeronimo67, il y a 13 minutes
Trace de la pile
#0 /home/ecigfaci/public_html/library/Snog/CountryFlags/Listener/Visitor.php(39): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/ecigfaci/...', 39, Array)
#1 [internal function]: Snog_CountryFlags_Listener_Visitor::visitor(Object(XenForo_Visitor))
#2 /home/ecigfaci/public_html/library/XenForo/CodeEvent.php(90): call_user_func_array(Array, Array)
#3 /home/ecigfaci/public_html/library/XenForo/Visitor.php(461): XenForo_CodeEvent::fire('visitor_setup', Array)
#4 /home/ecigfaci/public_html/library/XenForo/Session.php(275): XenForo_Visitor::setup(1037, Array)
#5 /home/ecigfaci/public_html/library/XenForo/Controller.php(291): XenForo_Session::startPublicSession(Object(Zend_Controller_Request_Http))
#6 /home/ecigfaci/public_html/library/XenForo/Controller.php(304): XenForo_Controller->_setupSession('Index')
#7 /home/ecigfaci/public_html/library/XenForo/FrontController.php(346): XenForo_Controller->preDispatch('Index', 'XenForo_Control...')
#8 /home/ecigfaci/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /home/ecigfaci/public_html/index.php(13): XenForo_FrontController->run()
#10 {main}
État de la demande
array(3) {
["url"] => string(33) "http://www.ecig-facile.fr/forums/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
hello, i have error :

Code:
Erreur Info
ErrorException: Undefined index: country - library/Snog/CountryFlags/Listener/Visitor.php:39
Généré par: Jeronimo67, il y a 13 minutes
Trace de la pile
#0 /home/ecigfaci/public_html/library/Snog/CountryFlags/Listener/Visitor.php(39): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/ecigfaci/...', 39, Array)
#1 [internal function]: Snog_CountryFlags_Listener_Visitor::visitor(Object(XenForo_Visitor))
#2 /home/ecigfaci/public_html/library/XenForo/CodeEvent.php(90): call_user_func_array(Array, Array)
#3 /home/ecigfaci/public_html/library/XenForo/Visitor.php(461): XenForo_CodeEvent::fire('visitor_setup', Array)
#4 /home/ecigfaci/public_html/library/XenForo/Session.php(275): XenForo_Visitor::setup(1037, Array)
#5 /home/ecigfaci/public_html/library/XenForo/Controller.php(291): XenForo_Session::startPublicSession(Object(Zend_Controller_Request_Http))
#6 /home/ecigfaci/public_html/library/XenForo/Controller.php(304): XenForo_Controller->_setupSession('Index')
#7 /home/ecigfaci/public_html/library/XenForo/FrontController.php(346): XenForo_Controller->preDispatch('Index', 'XenForo_Control...')
#8 /home/ecigfaci/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /home/ecigfaci/public_html/index.php(13): XenForo_FrontController->run()
#10 {main}
État de la demande
array(3) {
["url"] => string(33) "http://www.ecig-facile.fr/forums/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
Someone else also reported an error like this. And I can't duplicate it.

Please send me the IP Address for the user that triggered the error by PC (all of the IP addresses for the user if you don't know which one triggered the error). That is probably the only way I'll be able to track down the error. Until someone sends me an IP address, I can't do anything to track down the problem.
 
The CDN is a real possibility. I hadn't thought of that but I do have an add-on of mine that allows for it.

The clear.gif file is a 43 byte file that if your server is set up properly to allow browser caching should only be loaded once. So round trips shouldn't be a problem. The location has nothing to do with how many times it's loaded. It's no different than avatar locations. They appear every time an avatar is shown. But that doesn't mean the avatar is downloaded every time it's shown in the HTML.

The margin for the flags is there for display aesthetics. You're free to remove it if you like. I may move it to the css itself. We'll see.

EDIT: After a quick review, because the flag is used in multiple places, I can't move the margins to the CSS. That would throw off the display in other areas of the site.

Is there a way to replace the icons mate? I like the ones here: http://xenforo.com/community/resources/country-flags.806/
 
I can't see the flags you're using without registering. But I probably won't be changing the flags I distribute with the add-on.

Anyway, if you want to use different flags for different pages, just change the css included for each page to your flags. Just be sure to properly name the flags in your css. The css is set for each page in these TMS changes member_card, member_list_item, member_view and post. Each one is labeled as adding the css for the page. Obviously you would need to put your site in debug mode to edit the TMS changes.

And keep in mind there are some flags that are not standard to countries. Such as A1, A2, LO and ZZ. Those are specialized flags. For example, LO is 'Local Intranet' and is used when direct access to a site is used. It appears on my site because my site is hosted in-house and I access it directly via my local network.

A1 = Unknown
A2 = Satellite
LO = Local Intranet
ZZ = Reserved

The A1 is probably the most important. But the others can also appear from time to time.

Is there a way to replace the icons mate? I like the ones here: http://xenforo.com/community/resources/country-flags.806/

See the quoted post above yours.

You would need to rename all of the flags in the css you posted, upload the flags and account for the flags mentioned in the quote.
 
Top Bottom