How can I show geoip informaion for visitor

How can i add to template (let it be “bottom.tpl”) 3 geoip lines for visitor:

  1. Visitor IP is: (visitor ip)
  2. Visitor Country is: (country name)
  3. Visitor Country flag is: (flag image)



    Thanks in advance!

Why? Do they not know where they are?

{$smarty.server.REMOTE_ADDR} will give you the ip address. Can't be arsed looking up the php atm

[quote name='kogi' timestamp='1317242164' post='122516']

{$smarty.server.REMOTE_ADDR} will give you the ip address. Can't be arsed looking up the php atm

[/quote]



Thanks kogi!

{$smarty.server.REMOTE_ADDR} works good



catch ip on template there is also a function

{assign var="visitor_ip" value=""|fn_get_ip:false}
{$visitor_ip|@print_r}




but there is some issues to show the flag by “bottom.tpl”

there is actually a function named fn_get_country_by_ip

{$smarty.server.REMOTE_ADDR|fn_get_country_by_ip} but it shows nothing, how to use it?



Thanks, James

By original code admin-side the code is:

{$visitor.country} align="top" /> {if $visitor.country}{$visitor.country}{elseif $visitor.country_code}{$visitor.country_code}{else}{$lang.undefined}{/if}



But it always shows “undefined” flag by adding to bottom.tpl