Index: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php |
— | — | @@ -218,10 +218,22 @@ |
219 | 219 | } |
220 | 220 | $profile_data = $this->profile_data; |
221 | 221 | |
| 222 | + $defaultCountry = wfMsgForContent( 'user-profile-default-country' ); |
| 223 | + |
222 | 224 | $location = $profile_data['location_city'] . ', ' . $profile_data['location_state']; |
223 | | - if ( $profile_data['location_country'] != 'United States' ) { |
224 | | - $location = ''; |
225 | | - $location .= $profile_data['location_country']; |
| 225 | + if ( $profile_data['location_country'] != $defaultCountry ) { |
| 226 | + if ( $profile_data['location_city'] && $profile_data['location_state'] ) { // city AND state |
| 227 | + $location = $profile_data['location_city'] . ', ' . |
| 228 | + $profile_data['location_state'] . ', ' . |
| 229 | + $profile_data['location_country']; |
| 230 | + } elseif ( $profile_data['location_city'] && !$profile_data['location_state'] ) { // city, but no state |
| 231 | + $location = $profile_data['location_city'] . ', ' . $profile_data['location_country']; |
| 232 | + } elseif ( $profile_data['location_state'] && !$profile_data['location_city'] ) { // state, but no city |
| 233 | + $location = $profile_data['location_state'] . ', ' . $profile_data['location_country']; |
| 234 | + } else { |
| 235 | + $location = ''; |
| 236 | + $location .= $profile_data['location_country']; |
| 237 | + } |
226 | 238 | } |
227 | 239 | |
228 | 240 | if ( $location == ', ' ) { |
— | — | @@ -229,10 +241,21 @@ |
230 | 242 | } |
231 | 243 | |
232 | 244 | $hometown = $profile_data['hometown_city'] . ', ' . $profile_data['hometown_state']; |
233 | | - if ( $profile_data['hometown_country'] != 'United States' ) { |
234 | | - $hometown = ''; |
235 | | - $hometown .= $profile_data['hometown_country']; |
| 245 | + if ( $profile_data['hometown_country'] != $defaultCountry ) { |
| 246 | + if ( $profile_data['hometown_city'] && $profile_data['hometown_state'] ) { // city AND state |
| 247 | + $hometown = $profile_data['hometown_city'] . ', ' . |
| 248 | + $profile_data['hometown_state'] . ', ' . |
| 249 | + $profile_data['hometown_country']; |
| 250 | + } elseif ( $profile_data['hometown_city'] && !$profile_data['hometown_state'] ) { // city, but no state |
| 251 | + $hometown = $profile_data['hometown_city'] . ', ' . $profile_data['hometown_country']; |
| 252 | + } elseif ( $profile_data['hometown_state'] && !$profile_data['hometown_city'] ) { // state, but no city |
| 253 | + $hometown = $profile_data['hometown_state'] . ', ' . $profile_data['hometown_country']; |
| 254 | + } else { |
| 255 | + $hometown = ''; |
| 256 | + $hometown .= $profile_data['hometown_country']; |
| 257 | + } |
236 | 258 | } |
| 259 | + |
237 | 260 | if ( $hometown == ', ' ) { |
238 | 261 | $hometown = ''; |
239 | 262 | } |