Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   IP Address from what country? (http://www.bvlist.com/showthread.php?t=9626)

hatijahat 7th November 2013 17:08

IP Address from what country?
 
hello guys,

need a little help here, i have try to install geopip in my vps,
but still in the site didn't mention from what country the IP Address from.
is there any code needed for this?

http://i.imgur.com/gyIDA4l.png

as you can see, in the red box i have highlight, is still mention there [unknown] after i install the geoip. :sos:

DND 7th November 2013 20:22

latest version of geoip ?

Dingo38 7th November 2013 23:31

What it's doing is picking up previous visits before you installed it.Thats why it's classing that ip as unknown..Should they return using that ip now you have it installed then it will show you the info.

hatijahat 8th November 2013 04:28

Quote:

Originally Posted by DeNeDe (Post 43259)
latest version of geoip ?

geoip ver = Running latest 1.4.7~beta6+dfsg-1
don't know if this correct or not, i'm getting it from my system.

firefly007 8th November 2013 21:24

2 Attachment(s)
Quote:

Originally Posted by hatijahat (Post 43258)
hello guys,

need a little help here, i have try to install geopip in my vps,
but still in the site didn't mention from what country the IP Address from.
is there any code needed for this?

Save the two atached files to www root and then save this in bittorrent.php

PHP Code:

function cipf($ipf) {
    
    include (
"geoip.inc");

    
$handle geoip_open("GeoIP.dat"GEOIP_STANDARD);

    switch (
geoip_country_code_by_addr($handle$ipf)) {
        case 
"UK" :
            
$flag_out "<img src='/pic/flag/uk.gif'>";
            break;
        case 
"USA" :
            
$flag_out "<img src='/pic/flag/.gif'>";
            break;
        case 
"ZA" :
            
$flag_out "<img src='/pic/flag/southafrica.gif'>";
            break;
        default :
            
$flag_out "not defined!";
    }

    Return 
"IP address $ipf located in " geoip_country_name_by_addr($handle$ipf) . " (country code " geoip_country_code_by_addr($handle$ipf) . ") $flag_out";

    
geoip_close($handle);


Then replace your current Ip address line in userdetails.php with this

PHP Code:

print ("<tr><td class=rowhead>Country</td><td align=left>".Cipf($user["ip"])."</td></tr>\n"); 

You will need to add more flags in the switch Ive only added three..

hatijahat 15th November 2014 17:00

thanks.. and so millions thanks for the code and guide.. this working for me.. :D


All times are GMT +2. The time now is 16:26.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.