PHP: [ Select all ]
function get_country_info($tempip)
{
global $prefix, $db;
$tempip = str_replace(".*", ".0", $tempip);
$tempip = sprintf("%u", ip2long($tempip));
$result = $db->sql_query("SELECT * FROM `".$prefix."_nsnst_ip2country` WHERE `ip_lo`<='$tempip' AND `ip_hi`>='$tempip' LIMIT 0,1");
$countryinfo = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
return $countryinfo;
}
PHP: [ Select all ]
$ip2c = get_country_info($row['ip']);
if (!empty($ip2c['c2c'])){
if(file_exists("./images/info/flags/".strtolower($ip2c['c2c']).".png")){
echo "<img src=\"images/info/flags/".strtolower($ip2c['c2c']).".png\" border=\"0\" alt=\"".ucfirst (strtolower($ip2c['country']))."\"
title=\"".ucfirst (strtolower($ip2c['country']))."\" style=\"max-width: 20px; max-height:15px;\" /> ";
}else{
echo "<img src=\"./images/info/flags/not_available.png\" border=\"0\" alt=\"".ucfirst (strtolower($ip2c['country']))."\"
title=\"Missing flag for country c2c code of ".ucfirst (strtolower($ip2c['c2c'])).", report to coRpSE of headshotdomain.net\"
style=\"max-width: 20px; max-height:15px;\" /> ";
}
}else{
echo "<img src=\"images/info/flags/unknown.png\" border=\"0\" alt=\"UnKnown\" title=\"UnKnown\"
style=\"max-width: 20px; max-height:15px;\"/> ";
}