Support Forums


Go Back   68 Classifieds Forums > Legacy Help & Support > v3.1 Modules & Modifications

 
LinkBack Thread Tools Display Modes
Old 03-10-2008, 05:03 AM   #1
Senior Member
 
frommarcq's Avatar
 
Join Date: Mar 2006
Location: Lille (France)
Posts: 120
Rep Power: 15
frommarcq is on a distinguished road
Lightbulb Display Country Flag (based on IP address) against fraud

Hi everybody,
I've a problem with fraud from some countries (African).
They register themselves as european sellers and try to sell something in order to stole money of the buyer.
To avoid fraud, I've found this script : http://www.scripts.com/viewscript/ip...atabases/7705/
It works fine, but I don't succeed in implement it in 68classifieds.
I want a flag to be displayed on admin/browseusers.php in front of the username
I succeed in displaying the IP address in browseusers.php, but I'm unable to display the matching flag.
Here's the script I want to integer :

PHP Code:
<?
$two_letter_country_code
=iptocountry("83.229.97.26");

    print 
"<img src='flags/".strtolower($two_letter_country_code).".png' width=30 height=15><br>";


function 
iptocountry($ip) {   
    
$numbers preg_split"/\./"$ip);   
    include(
"ip_files/".$numbers[0].".php");
    
$code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);   
    foreach(
$ranges as $key => $value){
        if(
$key<=$code){
            if(
$ranges[$key][0]>=$code){$two_letter_country_code=$ranges[$key][1];break;}
            }
    }
    if (
$two_letter_country_code==""){$two_letter_country_code="unkown";}
    return 
$two_letter_country_code;
}
?>
Could anyone help me ?
It would be a good idea to share this modification to the community, no ?

Regards
Pascal
__________________
68classifieds (V4.0.9Developer)
frommarcq is offline   Reply With Quote
Old 03-11-2008, 11:22 AM   #2
Moderator
 
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 2,182
Rep Power: 59
juven14 is a jewel in the rough
Default

I don't see where you are including the file that links to your functions. Did you just leave it out in your example?

Also, are you attempting to put this in the template or in the core file?

Did you verify the images are in the right directory? I mean if they are not in the admin directory it might not be finding them for display.
__________________
TemplateCodes.com
juven14 is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't want State, Country to display dawnrae v3.1 Questions & Support 2 01-19-2007 11:44 AM


All times are GMT -4. The time now is 10:31 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0