Advertisement
Guest User

Untitled

a guest
Apr 8th, 2011
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. $ip = $_SERVER['REMOTE_ADDR'];
  2.  
  3. $record = GeoIP_record_by_addr($gi,$ip);
  4.  
  5. $countryid = $record->country_code;
  6.  
  7. $countryname = $record->country_name;
  8.  
  9. geoip_close($gi);
  10.  
  11. $countryallowed = array("AL", "AM", "AR", "AT", "AU", "AX", "BA", "BD", "BE", "BG", "BO", "BR", "BY", "CA", "CH", "CL", "CN", "CO", "CZ", "DE", "DJ", "DK", "DO", "DZ", "EC", "EE", "EG", "ES", "FI", "FR", "GB", "GE", "GF", "GL", "GR", "GY", "HK", "HR", "HU", "ID", "IE", "IL", "IN", "IR", "IS", "IT", "JO", "JP", "KH", "KP", "KR", "KZ", "LB", "LT", "LU", "LV", "LY", "MA", "MD", "ME", "MK", "ML", "MN", "MW", "MX", "MY", "NL", "NO", "NR", "NZ", "PE", "PH", "PL", "PR", "PT", "PW", "PY", "RE", "RO", "RS", "RU", "SE", "SG", "SI", "SK", "SR", "TH", "TR", "TW", "UA", "US", "UY", "UZ", "VE", "VN", "YE", "ZA");
  12.  
  13. if(in_array($countryid, $countryallowed)){
  14.  
  15. $post['subject'] = "<table border=\"0\"><tr><td><img src=\"" . KU_WEBPATH . "/css/images/cb/" . $countryid . ".png\" title=\"" . $countryname . "\"></td><td>" . $post['subject'] . "</td></tr></table>"; }
  16.  
  17. else{
  18.  
  19. $post['subject'] = "<table border=\"0\"><tr><td><img src=\"" . KU_WEBPATH . "/css/images/cb/unknown.png\" title=\"Unknown\"></td><td>" . $post['subject'] . "</td></tr></table>";
  20.  
  21. }
  22.  
  23. }
  24.  
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement