• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Implemented  Map IP Address on IP Card

kingston

Well-known member
#1
So I was needing this to help track down users. All I did was make the IP address clickable and take you to a website that uses google maps to show you where that IP address is.

Code:
<xen:require css="content_ip.css" />

<div>
	<table class="ipInfo">
	<tr>
		<th class="primaryContent">{xen:phrase content_ip}</th>
		<td class="secondaryContent"><span class="ip"><a href="http://ip.corporationwiki.com/{$ipInfo.contentIp}/" target=_blank>{$ipInfo.contentIp}</a></span> <span class="host">{$ipInfo.contentHost}</span></td>
	</tr>	
	<tr>
		<th class="primaryContent">{xen:phrase user_registration_ip}</th>
		<td class="secondaryContent"><span class="ip"><a href="http://ip.corporationwiki.com/{$ipInfo.registrationIp}/" target=_blank>{$ipInfo.registrationIp}</a></span> <span class="host">{$ipInfo.registrationHost}</span></td>
	</tr>
	<tr>
		<th class="primaryContent">{xen:phrase account_confirmation_ip}</th>
		<td class="secondaryContent"><span class="ip"><a href="http://ip.corporationwiki.com/{$ipInfo.confirmationIp}/" target=_blank>{$ipInfo.confirmationIp}</a></span> <span class="host">{$ipInfo.confirmationHost}</span></td>
	</tr>
	</table>
	<div class="sectionFooter overlayOnly"><a class="button primary OverlayCloser">{xen:phrase close}</a></div>
</div>
 

kingston

Well-known member
#5
Great idea. I've now implemented something similar, though I've used a different lookup site that seems to give better results for residential areas:

http://whatismyipaddress.com/ip/174.123.247.178/
@kier, not really working for me. its the correct country but about 350km away from my place ;)

*edit*
kingstons site shows the correct city
I think whatever service you use can be hit or miss. I have some users I am getting spot on, and some area a couple states away (in the US that is far)

I might switch to whatismyipaddress