为 EMLOG 添加归属地
几行代码 为 EMLOG 添加来客,归属地显示
API 用的 新浪的,实现起来也非常简单,直接在后台 底部 信息添加 即可代码如下 (需 jQuery)
<script>
$.getScript("http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js", function() {
if (remote_ip_info.province == remote_ip_info.city) city = remote_ip_info.city;
else city = remote_ip_info.province + " " + remote_ip_info.city;
userinfo = " <span style='clor:#08d'>欢迎来自 " + remote_ip_info.country + " " + city + " 的朋友</span> ";
$(userinfo).prependTo("body:first").css({
'position': 'fixed',
'top': '5px',
'left': '10%',
'color': 'red',
'padding': '5px 10px',
'background-color': '#fff',
'background': 'rgba(100,100,100,0.4) none repeat scroll 0 0!important',
'box-shadow': '0 0 2px #000 inset,0 0 2px #000',
});
});
</script>
样式什么自己在修改一下就可以了
更多精彩
