Changeset 733966
- Timestamp:
- 06/29/2013 09:45:28 AM (13 years ago)
- Location:
- wpgeocode
- Files:
-
- 3 added
- 2 edited
-
tags/1.0.9 (added)
-
tags/1.0.9/geolite_city_license.txt (added)
-
tags/1.0.9/wpgeocode.php (added)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/wpgeocode.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpgeocode/trunk/readme.txt
r617698 r733966 4 4 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GDQD948MQ3G3G 5 5 Tags: geocode, geocode filter, geotag, geomarketing, geomarking, geolocation, geofilter, location, local marketing, keywords 6 Version: 1.0. 86 Version: 1.0.9 7 7 Requires at least: 3.0 8 8 Tested up to: 3.2.4 … … 88 88 == Change Log == 89 89 90 = 1.0.9 = 91 * state_name never worked... problem with maxmind database. I've corrected via code in this plugin. 92 90 93 = 1.0.8 = 91 94 * Minor fixes for country_code support. … … 142 145 = 1.0.8 = 143 146 * Minor fixes 147 148 = 1.0.9 = 149 * Corrected wpgc_state_name to correctly show state name -
wpgeocode/trunk/wpgeocode.php
r617698 r733966 5 5 Tags: geocode, geotagging, geolocation, geotags, latitude, longitude, city, state, geomarketing, geolocation marketing 6 6 Description: Use WPGeocode to customize the content of your blog based on the location of your readers. 7 Version: 1.0. 87 Version: 1.0.9 8 8 Author: Michael Lynn 9 9 Author URI: http://www.mlynn.org/ 10 10 */ 11 12 11 13 if ( ! defined( 'ABSPATH' ) ) 12 14 die( "Can't load this file directly" ); … … 73 75 return do_shortcode(wpgc_conditional_shortcode($atts, $content, 'state_code')); 74 76 } 77 function wpgc_shortcode_state_name($atts, $content="") { 78 return do_shortcode(wpgc_conditional_shortcode($atts, $content, 'state_name')); 79 } 75 80 function wpgc_options_nearby_range($atts, $content="") { 76 81 $options = get_option('wpgc_options'); … … 101 106 return do_shortcode(wpgc_conditional_shortcode($atts, $content, 'is_not_state_code')); 102 107 } 108 function wpgc_is_not_state_name($atts, $content="") { 109 return do_shortcode(wpgc_conditional_shortcode($atts, $content, 'is_not_state_name')); 110 } 103 111 function wpgc_is_not_postal_codes($atts, $content="") { 104 112 return do_shortcode(wpgc_conditional_shortcode($atts, $content, 'is_not_postal_codes')); … … 139 147 function wpgc_is_state_code($atts, $content="") { 140 148 return do_shortcode(wpgc_conditional_shortcode($atts, $content, 'is_state_code')); 149 } 150 function wpgc_is_state_name($atts, $content="") { 151 return do_shortcode(wpgc_conditional_shortcode($atts, $content, 'is_state_name')); 141 152 } 142 153 function wpgc_is_postal_codes($atts, $content="") { … … 178 189 'country_code' => '', 179 190 'country_codes' => '', 191 'state_name' => '', 180 192 'state_code' => '', 181 193 'state_codes' => '', … … 193 205 $user_longitude = ''; 194 206 $user_state_code = ''; 207 $user_state_name = ''; 195 208 $user_postal_code = ''; 196 209 $user_city = ''; … … 201 214 $user_longitude = $loc_arr['longitude']; 202 215 $user_state_code = $loc_arr['state_code']; 216 $user_state_name = $loc_arr['state_name']; 203 217 $user_postal_code = $loc_arr['postal_code']; 204 218 $user_city = $loc_arr['city_name']; … … 239 253 case 'state_code' : 240 254 return wpgc_case_convert($user_state_code,$options['rdo_case'],$options['txt_filter_cls']); 255 break; 256 case 'state_name' : 257 return wpgc_case_convert($user_state_name,$options['rdo_case'],$options['txt_filter_cls']); 241 258 break; 242 259 case 'postal_code' : … … 356 373 } 357 374 break; 375 case 'is_not_state_name': 376 if ($state_code!=$loc_arr['state_name']) { 377 return $content; 378 } 379 break; 358 380 case 'is_not_state_codes': 359 381 $found=wpgc_csv_find($states,$loc_arr['state_code']); … … 491 513 add_shortcode("wpgc_country_name", "wpgc_shortcode_country_name"); 492 514 add_shortcode("wpgc_country_code", "wpgc_shortcode_country_code"); 515 add_shortcode("wpgc_state_name", "wpgc_shortcode_state_name"); 493 516 add_shortcode("wpgc_state_code", "wpgc_shortcode_state_code"); 494 517 add_shortcode("wpgc_options_nearby_range", "wpgc_options_nearby_range"); … … 932 955 933 956 function wpgc_get_location_info($user_ip) { 957 $state_list= array( 'AL' => 'Alabama', 'AK' => 'Alaska', 'AZ' => 'Arizona', 'AR' => 'Arkansas', 'CA' => 'California', 'CO' => 'Colorado', 'CT' => 'Connecticut', 'DE' => 'Delaware', 'FL' => 'Florida', 'GA' => 'Georgia', 'HI' => 'Hawaii', 'ID' => 'Idaho', 'IL' => 'Illinois', 'IN' => 'Indiana', 'IA' => 'Iowa', 'KS' => 'Kansas', 'KY' => 'Kentucky', 'LA' => 'Louisiana', 'ME' => 'Maine', 'MD' => 'Maryland', 'MA' => 'Massachusetts', 'MI' => 'Michigan', 'MN' => 'Minnesota', 'MS' => 'Mississippi', 'MO' => 'Missouri', 'MT' => 'Montana', 'NE' => 'Nebraska', 'NV' => 'Nevada', 'NH' => 'New Hampshire', 'NJ' => 'New Jersey', 'NM' => 'New Mexico', 'NY' => 'New York', 'NC' => 'North Carolina', 'ND' => 'North Dakota', 'OH' => 'Ohio', 'OK' => 'Oklahoma', 'OR' => 'Oregon', 'PA' => 'Pennsylvania', 'RI' => 'Rhode Island', 'SC' => 'South Carolina', 'SD' => 'South Dakota', 'TN' => 'Tennessee', 'TX' => 'Texas', 'UT' => 'Utah', 'VT' => 'Vermont', 'VA' => 'Virginia', 'WA' => 'Washington', 'WV' => 'West Virginia', 'WI' => 'Wisconsin', 'WY' => 'Wyoming',); 934 958 $tmp = get_option('wpgc_options'); 935 959 $wpgc_path = WP_PLUGIN_DIR . '/wpgeocode/'; … … 950 974 $location_info['city_name'] = (isset($record->city)) ? $record->city : '~'; 951 975 $location_info['state_code'] = (isset($record->region)) ? strtoupper($record->region) : '~'; 976 $location_info['state_name'] = (isset($record->region)) ? $state_list[$record->region] : '~' ; 952 977 $location_info['postal_code'] = (isset($record->postal_code)) ? strtoupper($record->postal_code) : '~'; 953 978 $location_info['country_name'] = (isset($record->country_name)) ? $record->country_name : '~';
Note: See TracChangeset
for help on using the changeset viewer.