Changeset 2041631
- Timestamp:
- 02/28/2019 04:12:18 PM (6 years ago)
- Location:
- show-visitor-ip/tags/5.0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
show-visitor-ip/tags/5.0/readme.txt
r1721365 r2041631 3 3 Tags: ip address, country code, region, lat, long, city, country name, user, visitor, display, shortcode, vs, rockon 4 4 Requires at least: 3.0 5 Tested up to: 4.86 Stable tag: 1.0.0 015 Tested up to: 5.1 6 Stable tag: 1.0.01 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
show-visitor-ip/tags/5.0/show-visitor-ip.php
r1721360 r2041631 19 19 return apply_filters('wpb_get_ip', $ip); 20 20 } 21 add_shortcode('show_ip', 'show_visitor_ip'); 22 21 add_shortcode('show_ip', 'show_visitor_ip'); 23 22 24 23 function show_visitor_locationByIp($svip){ 25 26 24 $client = @$_SERVER['HTTP_CLIENT_IP']; 27 25 $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; 28 26 $remote = @$_SERVER['REMOTE_ADDR']; 29 27 30 31 if(filter_var($client, FILTER_VALIDATE_IP)){ 32 33 $ip = $client; 34 28 if(filter_var($client, FILTER_VALIDATE_IP)){ 29 $ip = $client; 35 30 }elseif(filter_var($forward, FILTER_VALIDATE_IP)){ 36 37 $ip = $forward; 38 31 $ip = $forward; 39 32 } else { 40 33 $ip = $remote; … … 46 39 $svip_ltype = $svip['type']; 47 40 48 if($ip_data && $ip_data->geoplugin_countryName != null){ 49 41 if($ip_data && $ip_data->geoplugin_countryName != null){ 50 42 if($svip_ltype == 'countryCode'){ 51 43 $svip_data = $ip_data->geoplugin_countryCode; … … 61 53 $svip_data = $ip_data->geoplugin_countryName; 62 54 } 63 64 55 } 65 56 66 57 return $svip_data; 67 } 68 58 } 69 59 add_shortcode('svip_location', 'show_visitor_locationByIp'); 70 60 ?>
Note: See TracChangeset
for help on using the changeset viewer.