Show Visitor's country flag on your Directories

Discussion in 'Directories' started by Freewebspace, Sep 15, 2007.

  1. #1
    Just add this code anywhere in main.tpl or sidebar.tpl


    This will show flag of the visitor's country

    you can see live demo at http://www.rmmfa2004.org
     
    Freewebspace, Sep 15, 2007 IP
    Ibn Juferi, maldives and britishguy like this.
  2. britishguy

    britishguy Prominent Member

    Messages:
    7,949
    Likes Received:
    892
    Best Answers:
    0
    Trophy Points:
    360
    #2
    Interesting will try out to see how the layout looks
    Thanks for the code :)
     
    britishguy, Sep 15, 2007 IP
  3. Fastian

    Fastian Peon

    Messages:
    2,085
    Likes Received:
    235
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well, that's interesting :)

    I might try it on my free directory (if my friend let me edit something in there ;) )

    So now I will be confirming a user that he is browsing from his country. :D (kidding)
     
    Fastian, Sep 15, 2007 IP
  4. kohinoor

    kohinoor Peon

    Messages:
    169
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Britishguy Please post your opinion so, i will try.Nice information.
     
    kohinoor, Sep 15, 2007 IP
  5. deluxdon

    deluxdon Catch Me If You Can...!!!™ Staff

    Messages:
    25,481
    Likes Received:
    1,943
    Best Answers:
    32
    Trophy Points:
    480
    #5
    It show me Your Country: ?

    Why :confused:
     
    deluxdon, Sep 15, 2007 IP
  6. msolution

    msolution Well-Known Member

    Messages:
    1,182
    Likes Received:
    123
    Best Answers:
    0
    Trophy Points:
    175
    #6
    hostip.info is a fantastic open, community built database which anyone can use,
    ?: being open and non-commercial it has its limitations and sometimes lack of data :)

    (IP ranges keep especially AOL and stuff, sometimes one IP is of US the next day the IP allocated to europe!!!, But all in all works fab)
     
    msolution, Sep 15, 2007 IP
  7. msolution

    msolution Well-Known Member

    Messages:
    1,182
    Likes Received:
    123
    Best Answers:
    0
    Trophy Points:
    175
    #7
    Another gr8 use of hostip.info is you can use it to find the country and City of the visitor,

    I have been using this functionality on my contact form on all my sites, and with permmission from freewebspace, i am releaseing the following codes in this thread,

    these codes I found on a public forum released from the people at hostip.info and are not mine

    USE: so i know exactly where my visitor sending me an email is located, using my contact form.

    Codes:

    Open your contact.php and find :

    
          //Add body message
          $bodyMsg  = '';
    
    Code (markup):
    add above that:

    
    $no_ip = get_client_ip(); //phpLd function
    $hostip= "http://api.hostip.info/get_html.php?ip=$no_ip"."&position=true";
    $result = @ file($hostip);
    
    $message1 = "\n\nYour IP is $no_ip";
    $message1 .= "\n$result[0]";
    $message1 .= "\n$result[1]";
    $message1 .= "\n$result[2]";
    $message1 .= "\n$result[3]";
    
    /*
    In the array $result, we will find:
    $result[0] : Country: INDIA (IN) 
    $result[1] : City: (city) 
    $result[2] : Latitude: 
    $result[3] : Longitude: 
    */ 
    
    
    Code (markup):
    Next find:

          $bodyMsg .= trim ($data['MESSAGE']);
    
    Code (markup):
    Under that add:

    
                $bodyMsg .= "******************************\n\n";
                $bodyMsg .= $message1;
    
    Code (markup):
    Done!
     
    msolution, Sep 15, 2007 IP
    Ibn Juferi likes this.
  8. Ibn Juferi

    Ibn Juferi Prominent Member

    Messages:
    6,221
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    310
    #8
    Ibn Juferi, Sep 16, 2007 IP
  9. jabb

    jabb Peon

    Messages:
    1,019
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Is this for people on LSD who cant remember what country they are from?
     
    jabb, Sep 16, 2007 IP
  10. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #10
    Shows ? for my country.. :(
     
    MeetHere, Sep 16, 2007 IP
  11. pctec

    pctec Well-Known Member

    Messages:
    1,623
    Likes Received:
    210
    Best Answers:
    0
    Trophy Points:
    160
    #11
    Shows "my country" as USA...
    I think not!
     
    pctec, Sep 16, 2007 IP
  12. jminscoe

    jminscoe Peon

    Messages:
    1,223
    Likes Received:
    119
    Best Answers:
    0
    Trophy Points:
    0
    #12
    but maybe your server is located in the USA;) mine shows as ?
     
    jminscoe, Sep 16, 2007 IP
  13. mikey1090

    mikey1090 Moderator Staff

    Messages:
    15,869
    Likes Received:
    1,055
    Best Answers:
    0
    Trophy Points:
    445
    Digital Goods:
    2
    #13
    identifies me correctly as a brit...just wondering what use it has:p
     
    mikey1090, Sep 16, 2007 IP
  14. pctec

    pctec Well-Known Member

    Messages:
    1,623
    Likes Received:
    210
    Best Answers:
    0
    Trophy Points:
    160
    #14
    Increases your "cool factor" maybe? :rolleyes:
     
    pctec, Sep 16, 2007 IP
  15. Freewebspace

    Freewebspace Notable Member

    Messages:
    6,213
    Likes Received:
    370
    Best Answers:
    0
    Trophy Points:
    275
    #15
    Just for fun!!
     
    Freewebspace, Sep 16, 2007 IP
  16. Ibn Juferi

    Ibn Juferi Prominent Member

    Messages:
    6,221
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    310
    #16
    Its the only bid directory in the world that knows where you are from! :p
     
    Ibn Juferi, Sep 16, 2007 IP
  17. mikey1090

    mikey1090 Moderator Staff

    Messages:
    15,869
    Likes Received:
    1,055
    Best Answers:
    0
    Trophy Points:
    445
    Digital Goods:
    2
    #17
    until i add it:p
     
    mikey1090, Sep 16, 2007 IP