@@ -18,23 +18,25 @@ discard block |
||
| 18 | 18 | global $context; |
| 19 | 19 | |
| 20 | 20 | // Prevent Chrome from auto completing fields when viewing/editing other members profiles |
| 21 | - if (isBrowser('is_chrome') && !$context['user']['is_owner']) |
|
| 22 | - echo ' |
|
| 21 | + if (isBrowser('is_chrome') && !$context['user']['is_owner']) { |
|
| 22 | + echo ' |
|
| 23 | 23 | <script> |
| 24 | 24 | disableAutoComplete(); |
| 25 | 25 | </script>'; |
| 26 | + } |
|
| 26 | 27 | |
| 27 | 28 | // If an error occurred while trying to save previously, give the user a clue! |
| 28 | 29 | echo ' |
| 29 | 30 | ', template_error_message(); |
| 30 | 31 | |
| 31 | 32 | // If the profile was update successfully, let the user know this. |
| 32 | - if (!empty($context['profile_updated'])) |
|
| 33 | - echo ' |
|
| 33 | + if (!empty($context['profile_updated'])) { |
|
| 34 | + echo ' |
|
| 34 | 35 | <div class="infobox"> |
| 35 | 36 | ', $context['profile_updated'], ' |
| 36 | 37 | </div>'; |
| 37 | -} |
|
| 38 | + } |
|
| 39 | + } |
|
| 38 | 40 | |
| 39 | 41 | /** |
| 40 | 42 | * Template for any HTML needed below the profile (closing off divs/tables, etc.) |
@@ -102,8 +104,7 @@ discard block |
||
| 102 | 104 | if (empty($context['unread_alerts'])) |
| 103 | 105 | { |
| 104 | 106 | template_alerts_all_read(); |
| 105 | - } |
|
| 106 | - else |
|
| 107 | + } else |
|
| 107 | 108 | { |
| 108 | 109 | foreach ($context['unread_alerts'] as $id_alert => $details) |
| 109 | 110 | { |
@@ -164,10 +165,11 @@ discard block |
||
| 164 | 165 | <div class="custom_fields_above_name"> |
| 165 | 166 | <ul >'; |
| 166 | 167 | |
| 167 | - foreach ($context['print_custom_fields']['above_member'] as $field) |
|
| 168 | - if (!empty($field['output_html'])) |
|
| 168 | + foreach ($context['print_custom_fields']['above_member'] as $field) { |
|
| 169 | + if (!empty($field['output_html'])) |
|
| 169 | 170 | echo ' |
| 170 | 171 | <li>', $field['output_html'], '</li>'; |
| 172 | + } |
|
| 171 | 173 | |
| 172 | 174 | echo ' |
| 173 | 175 | </ul> |
@@ -188,10 +190,11 @@ discard block |
||
| 188 | 190 | <div class="custom_fields_below_avatar"> |
| 189 | 191 | <ul >'; |
| 190 | 192 | |
| 191 | - foreach ($context['print_custom_fields']['below_avatar'] as $field) |
|
| 192 | - if (!empty($field['output_html'])) |
|
| 193 | + foreach ($context['print_custom_fields']['below_avatar'] as $field) { |
|
| 194 | + if (!empty($field['output_html'])) |
|
| 193 | 195 | echo ' |
| 194 | 196 | <li>', $field['output_html'], '</li>'; |
| 197 | + } |
|
| 195 | 198 | |
| 196 | 199 | echo ' |
| 197 | 200 | </ul> |
@@ -202,22 +205,25 @@ discard block |
||
| 202 | 205 | echo ' |
| 203 | 206 | <ul class="clear">'; |
| 204 | 207 | // Email is only visible if it's your profile or you have the moderate_forum permission |
| 205 | - if ($context['member']['show_email']) |
|
| 206 | - echo ' |
|
| 208 | + if ($context['member']['show_email']) { |
|
| 209 | + echo ' |
|
| 207 | 210 | <li><a href="mailto:', $context['member']['email'], '" title="', $context['member']['email'], '" rel="nofollow"><span class="generic_icons mail" title="' . $txt['email'] . '"></span></a></li>'; |
| 211 | + } |
|
| 208 | 212 | |
| 209 | 213 | // Don't show an icon if they haven't specified a website. |
| 210 | - if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website'])) |
|
| 211 | - echo ' |
|
| 214 | + if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website'])) { |
|
| 215 | + echo ' |
|
| 212 | 216 | <li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<span class="generic_icons www" title="' . $context['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
| 217 | + } |
|
| 213 | 218 | |
| 214 | 219 | // Are there any custom profile fields as icons? |
| 215 | 220 | if (!empty($context['print_custom_fields']['icons'])) |
| 216 | 221 | { |
| 217 | - foreach ($context['print_custom_fields']['icons'] as $field) |
|
| 218 | - if (!empty($field['output_html'])) |
|
| 222 | + foreach ($context['print_custom_fields']['icons'] as $field) { |
|
| 223 | + if (!empty($field['output_html'])) |
|
| 219 | 224 | echo ' |
| 220 | 225 | <li class="custom_field">', $field['output_html'], '</li>'; |
| 226 | + } |
|
| 221 | 227 | } |
| 222 | 228 | |
| 223 | 229 | echo ' |
@@ -225,23 +231,26 @@ discard block |
||
| 225 | 231 | <span id="userstatus">', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['text'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<span class="' . ($context['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $context['member']['online']['text'] . '"></span>' : $context['member']['online']['label'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['label'] . '</span>' : ''; |
| 226 | 232 | |
| 227 | 233 | // Can they add this member as a buddy? |
| 228 | - if (!empty($context['can_have_buddy']) && !$context['user']['is_owner']) |
|
| 229 | - echo ' |
|
| 234 | + if (!empty($context['can_have_buddy']) && !$context['user']['is_owner']) { |
|
| 235 | + echo ' |
|
| 230 | 236 | <br><a href="', $scripturl, '?action=buddy;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>'; |
| 237 | + } |
|
| 231 | 238 | |
| 232 | 239 | echo ' |
| 233 | 240 | </span>'; |
| 234 | 241 | |
| 235 | - if (!$context['user']['is_owner'] && $context['can_send_pm']) |
|
| 236 | - echo ' |
|
| 242 | + if (!$context['user']['is_owner'] && $context['can_send_pm']) { |
|
| 243 | + echo ' |
|
| 237 | 244 | <a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '" class="infolinks">', $txt['profile_sendpm_short'], '</a>'; |
| 245 | + } |
|
| 238 | 246 | |
| 239 | 247 | echo ' |
| 240 | 248 | <a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '" class="infolinks">', $txt['showPosts'], '</a>'; |
| 241 | 249 | |
| 242 | - if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled'])) |
|
| 243 | - echo ' |
|
| 250 | + if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled'])) { |
|
| 251 | + echo ' |
|
| 244 | 252 | <a href="', $scripturl, '?action=profile;area=showdrafts;u=', $context['id_member'], '" class="infolinks">', $txt['drafts_show'], '</a>'; |
| 253 | + } |
|
| 245 | 254 | |
| 246 | 255 | echo ' |
| 247 | 256 | <a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '" class="infolinks">', $txt['statPanel'], '</a>'; |
@@ -253,10 +262,11 @@ discard block |
||
| 253 | 262 | <div class="custom_fields_bottom"> |
| 254 | 263 | <ul class="nolist">'; |
| 255 | 264 | |
| 256 | - foreach ($context['print_custom_fields']['bottom_poster'] as $field) |
|
| 257 | - if (!empty($field['output_html'])) |
|
| 265 | + foreach ($context['print_custom_fields']['bottom_poster'] as $field) { |
|
| 266 | + if (!empty($field['output_html'])) |
|
| 258 | 267 | echo ' |
| 259 | 268 | <li>', $field['output_html'], '</li>'; |
| 269 | + } |
|
| 260 | 270 | |
| 261 | 271 | echo ' |
| 262 | 272 | </ul> |
@@ -270,15 +280,17 @@ discard block |
||
| 270 | 280 | <div id="detailedinfo"> |
| 271 | 281 | <dl class="settings">'; |
| 272 | 282 | |
| 273 | - if ($context['user']['is_owner'] || $context['user']['is_admin']) |
|
| 274 | - echo ' |
|
| 283 | + if ($context['user']['is_owner'] || $context['user']['is_admin']) { |
|
| 284 | + echo ' |
|
| 275 | 285 | <dt>', $txt['username'], ': </dt> |
| 276 | 286 | <dd>', $context['member']['username'], '</dd>'; |
| 287 | + } |
|
| 277 | 288 | |
| 278 | - if (!isset($context['disabled_fields']['posts'])) |
|
| 279 | - echo ' |
|
| 289 | + if (!isset($context['disabled_fields']['posts'])) { |
|
| 290 | + echo ' |
|
| 280 | 291 | <dt>', $txt['profile_posts'], ': </dt> |
| 281 | 292 | <dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>'; |
| 293 | + } |
|
| 282 | 294 | |
| 283 | 295 | if ($context['member']['show_email']) |
| 284 | 296 | { |
@@ -287,15 +299,17 @@ discard block |
||
| 287 | 299 | <dd><a href="mailto:', $context['member']['email'], '">', $context['member']['email'], '</a></dd>'; |
| 288 | 300 | } |
| 289 | 301 | |
| 290 | - if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title'])) |
|
| 291 | - echo ' |
|
| 302 | + if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title'])) { |
|
| 303 | + echo ' |
|
| 292 | 304 | <dt>', $txt['custom_title'], ': </dt> |
| 293 | 305 | <dd>', $context['member']['title'], '</dd>'; |
| 306 | + } |
|
| 294 | 307 | |
| 295 | - if (!empty($context['member']['blurb'])) |
|
| 296 | - echo ' |
|
| 308 | + if (!empty($context['member']['blurb'])) { |
|
| 309 | + echo ' |
|
| 297 | 310 | <dt>', $txt['personal_text'], ': </dt> |
| 298 | 311 | <dd>', $context['member']['blurb'], '</dd>'; |
| 312 | + } |
|
| 299 | 313 | |
| 300 | 314 | echo ' |
| 301 | 315 | <dt>', $txt['age'], ':</dt> |
@@ -309,19 +323,21 @@ discard block |
||
| 309 | 323 | { |
| 310 | 324 | $fields = array(); |
| 311 | 325 | |
| 312 | - foreach ($context['print_custom_fields']['standard'] as $field) |
|
| 313 | - if (!empty($field['output_html'])) |
|
| 326 | + foreach ($context['print_custom_fields']['standard'] as $field) { |
|
| 327 | + if (!empty($field['output_html'])) |
|
| 314 | 328 | $fields[] = $field; |
| 329 | + } |
|
| 315 | 330 | |
| 316 | 331 | if (count($fields) > 0) |
| 317 | 332 | { |
| 318 | 333 | echo ' |
| 319 | 334 | <dl class="settings">'; |
| 320 | 335 | |
| 321 | - foreach ($fields as $field) |
|
| 322 | - echo ' |
|
| 336 | + foreach ($fields as $field) { |
|
| 337 | + echo ' |
|
| 323 | 338 | <dt>', $field['name'], ':</dt> |
| 324 | 339 | <dd>', $field['output_html'], '</dd>'; |
| 340 | + } |
|
| 325 | 341 | |
| 326 | 342 | echo ' |
| 327 | 343 | </dl>'; |
@@ -341,9 +357,10 @@ discard block |
||
| 341 | 357 | <a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', ($context['can_issue_warning'] && !$context['user']['is_owner'] ? 'issuewarning' : 'viewwarning'), '">', $context['member']['warning'], '%</a>'; |
| 342 | 358 | |
| 343 | 359 | // Can we provide information on what this means? |
| 344 | - if (!empty($context['warning_status'])) |
|
| 345 | - echo ' |
|
| 360 | + if (!empty($context['warning_status'])) { |
|
| 361 | + echo ' |
|
| 346 | 362 | <span class="smalltext">(', $context['warning_status'], ')</span>'; |
| 363 | + } |
|
| 347 | 364 | |
| 348 | 365 | echo ' |
| 349 | 366 | </dd>'; |
@@ -354,9 +371,10 @@ discard block |
||
| 354 | 371 | { |
| 355 | 372 | |
| 356 | 373 | // If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves. |
| 357 | - if (!empty($context['activate_message'])) |
|
| 358 | - echo ' |
|
| 374 | + if (!empty($context['activate_message'])) { |
|
| 375 | + echo ' |
|
| 359 | 376 | <dt class="clear"><span class="alert">', $context['activate_message'], '</span> (<a href="', $context['activate_link'], '"', ($context['activate_type'] == 4 ? ' class="you_sure" data-confirm="' . $txt['profileConfirm'] . '"' : ''), '>', $context['activate_link_text'], '</a>)</dt>'; |
| 377 | + } |
|
| 360 | 378 | |
| 361 | 379 | // If the current member is banned, show a message and possibly a link to the ban. |
| 362 | 380 | if (!empty($context['member']['bans'])) |
@@ -366,9 +384,10 @@ discard block |
||
| 366 | 384 | <dt class="clear" id="ban_info" style="display: none;"> |
| 367 | 385 | <strong>', $txt['user_banned_by_following'], ':</strong>'; |
| 368 | 386 | |
| 369 | - foreach ($context['member']['bans'] as $ban) |
|
| 370 | - echo ' |
|
| 387 | + foreach ($context['member']['bans'] as $ban) { |
|
| 388 | + echo ' |
|
| 371 | 389 | <br><span class="smalltext">', $ban['explanation'], '</span>'; |
| 390 | + } |
|
| 372 | 391 | |
| 373 | 392 | echo ' |
| 374 | 393 | </dt>'; |
@@ -382,30 +401,34 @@ discard block |
||
| 382 | 401 | // If the person looking is allowed, they can check the members IP address and hostname. |
| 383 | 402 | if ($context['can_see_ip']) |
| 384 | 403 | { |
| 385 | - if (!empty($context['member']['ip'])) |
|
| 386 | - echo ' |
|
| 404 | + if (!empty($context['member']['ip'])) { |
|
| 405 | + echo ' |
|
| 387 | 406 | <dt>', $txt['ip'], ': </dt> |
| 388 | 407 | <dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>'; |
| 408 | + } |
|
| 389 | 409 | |
| 390 | - if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip'])) |
|
| 391 | - echo ' |
|
| 410 | + if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip'])) { |
|
| 411 | + echo ' |
|
| 392 | 412 | <dt>', $txt['hostname'], ': </dt> |
| 393 | 413 | <dd>', $context['member']['hostname'], '</dd>'; |
| 414 | + } |
|
| 394 | 415 | } |
| 395 | 416 | |
| 396 | 417 | echo ' |
| 397 | 418 | <dt>', $txt['local_time'], ':</dt> |
| 398 | 419 | <dd>', $context['member']['local_time'], '</dd>'; |
| 399 | 420 | |
| 400 | - if (!empty($modSettings['userLanguage']) && !empty($context['member']['language'])) |
|
| 401 | - echo ' |
|
| 421 | + if (!empty($modSettings['userLanguage']) && !empty($context['member']['language'])) { |
|
| 422 | + echo ' |
|
| 402 | 423 | <dt>', $txt['language'], ':</dt> |
| 403 | 424 | <dd>', $context['member']['language'], '</dd>'; |
| 425 | + } |
|
| 404 | 426 | |
| 405 | - if ($context['member']['show_last_login']) |
|
| 406 | - echo ' |
|
| 427 | + if ($context['member']['show_last_login']) { |
|
| 428 | + echo ' |
|
| 407 | 429 | <dt>', $txt['lastLoggedIn'], ': </dt> |
| 408 | 430 | <dd>', $context['member']['last_login'], (!empty($context['member']['is_hidden']) ? ' (' . $txt['hidden'] . ')' : ''), '</dd>'; |
| 431 | + } |
|
| 409 | 432 | |
| 410 | 433 | echo ' |
| 411 | 434 | </dl>'; |
@@ -417,10 +440,11 @@ discard block |
||
| 417 | 440 | <div class="custom_fields_above_signature"> |
| 418 | 441 | <ul class="nolist">'; |
| 419 | 442 | |
| 420 | - foreach ($context['print_custom_fields']['above_signature'] as $field) |
|
| 421 | - if (!empty($field['output_html'])) |
|
| 443 | + foreach ($context['print_custom_fields']['above_signature'] as $field) { |
|
| 444 | + if (!empty($field['output_html'])) |
|
| 422 | 445 | echo ' |
| 423 | 446 | <li>', $field['output_html'], '</li>'; |
| 447 | + } |
|
| 424 | 448 | |
| 425 | 449 | echo ' |
| 426 | 450 | </ul> |
@@ -428,12 +452,13 @@ discard block |
||
| 428 | 452 | } |
| 429 | 453 | |
| 430 | 454 | // Show the users signature. |
| 431 | - if ($context['signature_enabled'] && !empty($context['member']['signature'])) |
|
| 432 | - echo ' |
|
| 455 | + if ($context['signature_enabled'] && !empty($context['member']['signature'])) { |
|
| 456 | + echo ' |
|
| 433 | 457 | <div class="signature"> |
| 434 | 458 | <h5>', $txt['signature'], ':</h5> |
| 435 | 459 | ', $context['member']['signature'], ' |
| 436 | 460 | </div>'; |
| 461 | + } |
|
| 437 | 462 | |
| 438 | 463 | // Are there any custom profile fields for below the signature? |
| 439 | 464 | if (!empty($context['print_custom_fields']['below_signature'])) |
@@ -442,10 +467,11 @@ discard block |
||
| 442 | 467 | <div class="custom_fields_below_signature"> |
| 443 | 468 | <ul class="nolist">'; |
| 444 | 469 | |
| 445 | - foreach ($context['print_custom_fields']['below_signature'] as $field) |
|
| 446 | - if (!empty($field['output_html'])) |
|
| 470 | + foreach ($context['print_custom_fields']['below_signature'] as $field) { |
|
| 471 | + if (!empty($field['output_html'])) |
|
| 447 | 472 | echo ' |
| 448 | 473 | <li>', $field['output_html'], '</li>'; |
| 474 | + } |
|
| 449 | 475 | |
| 450 | 476 | echo ' |
| 451 | 477 | </ul> |
@@ -490,62 +516,70 @@ discard block |
||
| 490 | 516 | </div> |
| 491 | 517 | <div class="list_posts">'; |
| 492 | 518 | |
| 493 | - if (!$post['approved']) |
|
| 494 | - echo ' |
|
| 519 | + if (!$post['approved']) { |
|
| 520 | + echo ' |
|
| 495 | 521 | <div class="approve_post"> |
| 496 | 522 | <em>', $txt['post_awaiting_approval'], '</em> |
| 497 | 523 | </div>'; |
| 524 | + } |
|
| 498 | 525 | |
| 499 | 526 | echo ' |
| 500 | 527 | ', $post['body'], ' |
| 501 | 528 | </div>'; |
| 502 | 529 | |
| 503 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
| 504 | - echo ' |
|
| 530 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
| 531 | + echo ' |
|
| 505 | 532 | <div class="floatright"> |
| 506 | 533 | <ul class="quickbuttons">'; |
| 534 | + } |
|
| 507 | 535 | |
| 508 | 536 | // If they *can* reply? |
| 509 | - if ($post['can_reply']) |
|
| 510 | - echo ' |
|
| 537 | + if ($post['can_reply']) { |
|
| 538 | + echo ' |
|
| 511 | 539 | <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>'; |
| 540 | + } |
|
| 512 | 541 | |
| 513 | 542 | // If they *can* quote? |
| 514 | - if ($post['can_quote']) |
|
| 515 | - echo ' |
|
| 543 | + if ($post['can_quote']) { |
|
| 544 | + echo ' |
|
| 516 | 545 | <li><a href="', $scripturl . '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
| 546 | + } |
|
| 517 | 547 | |
| 518 | 548 | // How about... even... remove it entirely?! |
| 519 | - if ($post['can_delete']) |
|
| 520 | - echo ' |
|
| 549 | + if ($post['can_delete']) { |
|
| 550 | + echo ' |
|
| 521 | 551 | <li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';profile;u=', $context['member']['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>'; |
| 552 | + } |
|
| 522 | 553 | |
| 523 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
| 524 | - echo ' |
|
| 554 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
| 555 | + echo ' |
|
| 525 | 556 | </ul> |
| 526 | 557 | </div>'; |
| 558 | + } |
|
| 527 | 559 | |
| 528 | 560 | echo ' |
| 529 | 561 | </div>'; |
| 530 | 562 | } |
| 563 | + } else { |
|
| 564 | + template_show_list('attachments'); |
|
| 531 | 565 | } |
| 532 | - else |
|
| 533 | - template_show_list('attachments'); |
|
| 534 | 566 | |
| 535 | 567 | // No posts? Just end with a informative message. |
| 536 | - if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts']))) |
|
| 537 | - echo ' |
|
| 568 | + if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts']))) { |
|
| 569 | + echo ' |
|
| 538 | 570 | <div class="windowbg2"> |
| 539 | 571 | ', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), ' |
| 540 | 572 | </div>'; |
| 573 | + } |
|
| 541 | 574 | |
| 542 | 575 | // Show more page numbers. |
| 543 | - if (!empty($context['page_index'])) |
|
| 544 | - echo ' |
|
| 576 | + if (!empty($context['page_index'])) { |
|
| 577 | + echo ' |
|
| 545 | 578 | <div class="pagesection"> |
| 546 | 579 | <div class="pagelinks">', $context['page_index'], '</div> |
| 547 | 580 | </div>'; |
| 548 | -} |
|
| 581 | + } |
|
| 582 | + } |
|
| 549 | 583 | |
| 550 | 584 | /** |
| 551 | 585 | * Template for showing alerts within the alerts popup |
@@ -555,11 +589,12 @@ discard block |
||
| 555 | 589 | global $context, $txt, $scripturl; |
| 556 | 590 | |
| 557 | 591 | // Do we have an update message? |
| 558 | - if (!empty($context['update_message'])) |
|
| 559 | - echo ' |
|
| 592 | + if (!empty($context['update_message'])) { |
|
| 593 | + echo ' |
|
| 560 | 594 | <div class="infobox"> |
| 561 | 595 | ', $context['update_message'], '. |
| 562 | 596 | </div>'; |
| 597 | + } |
|
| 563 | 598 | |
| 564 | 599 | echo ' |
| 565 | 600 | <div class="cat_bar"> |
@@ -568,13 +603,12 @@ discard block |
||
| 568 | 603 | </h3> |
| 569 | 604 | </div>'; |
| 570 | 605 | |
| 571 | - if (empty($context['alerts'])) |
|
| 572 | - echo ' |
|
| 606 | + if (empty($context['alerts'])) { |
|
| 607 | + echo ' |
|
| 573 | 608 | <div class="information"> |
| 574 | 609 | ', $txt['alerts_none'], ' |
| 575 | 610 | </div>'; |
| 576 | - |
|
| 577 | - else |
|
| 611 | + } else |
|
| 578 | 612 | { |
| 579 | 613 | // Start the form. |
| 580 | 614 | echo ' |
@@ -636,12 +670,12 @@ discard block |
||
| 636 | 670 | </div>' : ''; |
| 637 | 671 | |
| 638 | 672 | // No drafts? Just show an informative message. |
| 639 | - if (empty($context['drafts'])) |
|
| 640 | - echo ' |
|
| 673 | + if (empty($context['drafts'])) { |
|
| 674 | + echo ' |
|
| 641 | 675 | <div class="windowbg2 centertext"> |
| 642 | 676 | ', $txt['draft_none'], ' |
| 643 | 677 | </div>'; |
| 644 | - else |
|
| 678 | + } else |
|
| 645 | 679 | { |
| 646 | 680 | // For every draft to be displayed, give it its own div, and show the important details of the draft. |
| 647 | 681 | foreach ($context['drafts'] as $draft) |
@@ -652,11 +686,13 @@ discard block |
||
| 652 | 686 | <div class="topic_details"> |
| 653 | 687 | <h5><strong><a href="', $scripturl, '?board=', $draft['board']['id'], '.0">', $draft['board']['name'], '</a> / ', $draft['topic']['link'], '</strong> '; |
| 654 | 688 | |
| 655 | - if (!empty($draft['sticky'])) |
|
| 656 | - echo '<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>'; |
|
| 689 | + if (!empty($draft['sticky'])) { |
|
| 690 | + echo '<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>'; |
|
| 691 | + } |
|
| 657 | 692 | |
| 658 | - if (!empty($draft['locked'])) |
|
| 659 | - echo '<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>'; |
|
| 693 | + if (!empty($draft['locked'])) { |
|
| 694 | + echo '<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>'; |
|
| 695 | + } |
|
| 660 | 696 | |
| 661 | 697 | echo ' |
| 662 | 698 | </h5> |
@@ -689,12 +725,13 @@ discard block |
||
| 689 | 725 | { |
| 690 | 726 | global $context, $scripturl, $txt; |
| 691 | 727 | |
| 692 | - if (!empty($context['saved_successful'])) |
|
| 693 | - echo ' |
|
| 728 | + if (!empty($context['saved_successful'])) { |
|
| 729 | + echo ' |
|
| 694 | 730 | <div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>'; |
| 695 | - elseif (!empty($context['saved_failed'])) |
|
| 696 | - echo ' |
|
| 731 | + } elseif (!empty($context['saved_failed'])) { |
|
| 732 | + echo ' |
|
| 697 | 733 | <div class="errorbox">', $context['saved_failed'], '</div>'; |
| 734 | + } |
|
| 698 | 735 | |
| 699 | 736 | echo ' |
| 700 | 737 | <div id="edit_buddies"> |
@@ -708,24 +745,27 @@ discard block |
||
| 708 | 745 | <th scope="col" class="quarter_table">', $txt['name'], '</th> |
| 709 | 746 | <th scope="col">', $txt['status'], '</th>'; |
| 710 | 747 | |
| 711 | - if (allowedTo('moderate_forum')) |
|
| 712 | - echo ' |
|
| 748 | + if (allowedTo('moderate_forum')) { |
|
| 749 | + echo ' |
|
| 713 | 750 | <th scope="col">', $txt['email'], '</th>'; |
| 751 | + } |
|
| 714 | 752 | |
| 715 | - if (!empty($context['custom_pf'])) |
|
| 716 | - foreach ($context['custom_pf'] as $column) |
|
| 753 | + if (!empty($context['custom_pf'])) { |
|
| 754 | + foreach ($context['custom_pf'] as $column) |
|
| 717 | 755 | echo '<th scope="col">', $column['label'], '</th>'; |
| 756 | + } |
|
| 718 | 757 | |
| 719 | 758 | echo ' |
| 720 | 759 | <th scope="col">', $txt['remove'], '</th> |
| 721 | 760 | </tr>'; |
| 722 | 761 | |
| 723 | 762 | // If they don't have any buddies don't list them! |
| 724 | - if (empty($context['buddies'])) |
|
| 725 | - echo ' |
|
| 763 | + if (empty($context['buddies'])) { |
|
| 764 | + echo ' |
|
| 726 | 765 | <tr class="windowbg"> |
| 727 | 766 | <td colspan="', allowedTo('moderate_forum') ? '10' : '9', '"><strong>', $txt['no_buddies'], '</strong></td> |
| 728 | 767 | </tr>'; |
| 768 | + } |
|
| 729 | 769 | |
| 730 | 770 | // Now loop through each buddy showing info on each. |
| 731 | 771 | else |
@@ -737,15 +777,17 @@ discard block |
||
| 737 | 777 | <td>', $buddy['link'], '</td> |
| 738 | 778 | <td><a href="', $buddy['online']['href'], '"><span class="' . ($buddy['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $buddy['online']['text'] . '"></span></a></td>'; |
| 739 | 779 | |
| 740 | - if ($buddy['show_email']) |
|
| 741 | - echo ' |
|
| 780 | + if ($buddy['show_email']) { |
|
| 781 | + echo ' |
|
| 742 | 782 | <td><a href="mailto:' . $buddy['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $buddy['name'] . '"></span></a></td>'; |
| 783 | + } |
|
| 743 | 784 | |
| 744 | 785 | // Show the custom profile fields for this user. |
| 745 | - if (!empty($context['custom_pf'])) |
|
| 746 | - foreach ($context['custom_pf'] as $key => $column) |
|
| 786 | + if (!empty($context['custom_pf'])) { |
|
| 787 | + foreach ($context['custom_pf'] as $key => $column) |
|
| 747 | 788 | echo ' |
| 748 | 789 | <td class="lefttext">', $buddy['options'][$key], '</td>'; |
| 790 | + } |
|
| 749 | 791 | |
| 750 | 792 | echo ' |
| 751 | 793 | <td><a href="', $scripturl, '?action=profile;area=lists;sa=buddies;u=', $context['id_member'], ';remove=', $buddy['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons delete" title="', $txt['buddy_remove'], '"></span></a></td> |
@@ -775,9 +817,10 @@ discard block |
||
| 775 | 817 | </dl> |
| 776 | 818 | </div>'; |
| 777 | 819 | |
| 778 | - if (!empty($context['token_check'])) |
|
| 779 | - echo ' |
|
| 820 | + if (!empty($context['token_check'])) { |
|
| 821 | + echo ' |
|
| 780 | 822 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 823 | + } |
|
| 781 | 824 | |
| 782 | 825 | echo ' |
| 783 | 826 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -803,12 +846,13 @@ discard block |
||
| 803 | 846 | { |
| 804 | 847 | global $context, $scripturl, $txt; |
| 805 | 848 | |
| 806 | - if (!empty($context['saved_successful'])) |
|
| 807 | - echo ' |
|
| 849 | + if (!empty($context['saved_successful'])) { |
|
| 850 | + echo ' |
|
| 808 | 851 | <div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>'; |
| 809 | - elseif (!empty($context['saved_failed'])) |
|
| 810 | - echo ' |
|
| 852 | + } elseif (!empty($context['saved_failed'])) { |
|
| 853 | + echo ' |
|
| 811 | 854 | <div class="errorbox">', $context['saved_failed'], '</div>'; |
| 855 | + } |
|
| 812 | 856 | |
| 813 | 857 | echo ' |
| 814 | 858 | <div id="edit_buddies"> |
@@ -822,20 +866,22 @@ discard block |
||
| 822 | 866 | <th scope="col" class="quarter_table">', $txt['name'], '</th> |
| 823 | 867 | <th scope="col">', $txt['status'], '</th>'; |
| 824 | 868 | |
| 825 | - if (allowedTo('moderate_forum')) |
|
| 826 | - echo ' |
|
| 869 | + if (allowedTo('moderate_forum')) { |
|
| 870 | + echo ' |
|
| 827 | 871 | <th scope="col">', $txt['email'], '</th>'; |
| 872 | + } |
|
| 828 | 873 | |
| 829 | 874 | echo ' |
| 830 | 875 | <th scope="col">', $txt['ignore_remove'], '</th> |
| 831 | 876 | </tr>'; |
| 832 | 877 | |
| 833 | 878 | // If they don't have anyone on their ignore list, don't list it! |
| 834 | - if (empty($context['ignore_list'])) |
|
| 835 | - echo ' |
|
| 879 | + if (empty($context['ignore_list'])) { |
|
| 880 | + echo ' |
|
| 836 | 881 | <tr class="windowbg"> |
| 837 | 882 | <td colspan="', allowedTo('moderate_forum') ? '4' : '3', '"><strong>', $txt['no_ignore'], '</strong></td> |
| 838 | 883 | </tr>'; |
| 884 | + } |
|
| 839 | 885 | |
| 840 | 886 | // Now loop through each buddy showing info on each. |
| 841 | 887 | foreach ($context['ignore_list'] as $member) |
@@ -845,9 +891,10 @@ discard block |
||
| 845 | 891 | <td>', $member['link'], '</td> |
| 846 | 892 | <td><a href="', $member['online']['href'], '"><span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span></a></td>'; |
| 847 | 893 | |
| 848 | - if ($member['show_email']) |
|
| 849 | - echo ' |
|
| 894 | + if ($member['show_email']) { |
|
| 895 | + echo ' |
|
| 850 | 896 | <td><a href="mailto:' . $member['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $member['name'] . '"></span></a></td>'; |
| 897 | + } |
|
| 851 | 898 | echo ' |
| 852 | 899 | <td><a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore;remove=', $member['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons delete" title="', $txt['ignore_remove'], '"></span></a></td> |
| 853 | 900 | </tr>'; |
@@ -874,9 +921,10 @@ discard block |
||
| 874 | 921 | </dl> |
| 875 | 922 | </div>'; |
| 876 | 923 | |
| 877 | - if (!empty($context['token_check'])) |
|
| 878 | - echo ' |
|
| 924 | + if (!empty($context['token_check'])) { |
|
| 925 | + echo ' |
|
| 879 | 926 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 927 | + } |
|
| 880 | 928 | |
| 881 | 929 | echo ' |
| 882 | 930 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -921,9 +969,10 @@ discard block |
||
| 921 | 969 | <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>'; |
| 922 | 970 | |
| 923 | 971 | // Second address detected? |
| 924 | - if (!empty($context['last_ip2'])) |
|
| 925 | - echo ' |
|
| 972 | + if (!empty($context['last_ip2'])) { |
|
| 973 | + echo ' |
|
| 926 | 974 | , <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>'; |
| 975 | + } |
|
| 927 | 976 | |
| 928 | 977 | echo ' |
| 929 | 978 | </dd>'; |
@@ -988,9 +1037,10 @@ discard block |
||
| 988 | 1037 | <h3 class="catbg">', $txt['whois_title'], ' ', $context['ip'], '</h3> |
| 989 | 1038 | </div> |
| 990 | 1039 | <div class="windowbg2 noup">'; |
| 991 | - foreach ($context['whois_servers'] as $server) |
|
| 992 | - echo ' |
|
| 1040 | + foreach ($context['whois_servers'] as $server) { |
|
| 1041 | + echo ' |
|
| 993 | 1042 | <a href="', $server['url'], '" target="_blank"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br>'; |
| 1043 | + } |
|
| 994 | 1044 | echo ' |
| 995 | 1045 | </div> |
| 996 | 1046 | <br>'; |
@@ -1001,10 +1051,10 @@ discard block |
||
| 1001 | 1051 | <div class="cat_bar"> |
| 1002 | 1052 | <h3 class="catbg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3> |
| 1003 | 1053 | </div>'; |
| 1004 | - if (empty($context['ips'])) |
|
| 1005 | - echo ' |
|
| 1054 | + if (empty($context['ips'])) { |
|
| 1055 | + echo ' |
|
| 1006 | 1056 | <p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>'; |
| 1007 | - else |
|
| 1057 | + } else |
|
| 1008 | 1058 | { |
| 1009 | 1059 | echo ' |
| 1010 | 1060 | <table class="table_grid"> |
@@ -1017,12 +1067,13 @@ discard block |
||
| 1017 | 1067 | <tbody>'; |
| 1018 | 1068 | |
| 1019 | 1069 | // Loop through each of the members and display them. |
| 1020 | - foreach ($context['ips'] as $ip => $memberlist) |
|
| 1021 | - echo ' |
|
| 1070 | + foreach ($context['ips'] as $ip => $memberlist) { |
|
| 1071 | + echo ' |
|
| 1022 | 1072 | <tr class="windowbg"> |
| 1023 | 1073 | <td><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td> |
| 1024 | 1074 | <td>', implode(', ', $memberlist), '</td> |
| 1025 | 1075 | </tr>'; |
| 1076 | + } |
|
| 1026 | 1077 | |
| 1027 | 1078 | echo ' |
| 1028 | 1079 | </tbody> |
@@ -1068,8 +1119,7 @@ discard block |
||
| 1068 | 1119 | { |
| 1069 | 1120 | echo ' |
| 1070 | 1121 | <div class="information">', $txt['showPermissions_all'], '</div>'; |
| 1071 | - } |
|
| 1072 | - else |
|
| 1122 | + } else |
|
| 1073 | 1123 | { |
| 1074 | 1124 | echo ' |
| 1075 | 1125 | <div class="information">',$txt['showPermissions_help'], '</div> |
@@ -1083,9 +1133,10 @@ discard block |
||
| 1083 | 1133 | </div> |
| 1084 | 1134 | <div class="windowbg smalltext"> |
| 1085 | 1135 | ', $txt['showPermissions_restricted_boards_desc'], ':<br>'; |
| 1086 | - foreach ($context['no_access_boards'] as $no_access_board) |
|
| 1087 | - echo ' |
|
| 1136 | + foreach ($context['no_access_boards'] as $no_access_board) { |
|
| 1137 | + echo ' |
|
| 1088 | 1138 | <a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', '; |
| 1139 | + } |
|
| 1089 | 1140 | echo ' |
| 1090 | 1141 | </div>'; |
| 1091 | 1142 | } |
@@ -1117,12 +1168,13 @@ discard block |
||
| 1117 | 1168 | </td> |
| 1118 | 1169 | <td class="smalltext">'; |
| 1119 | 1170 | |
| 1120 | - if ($permission['is_denied']) |
|
| 1121 | - echo ' |
|
| 1171 | + if ($permission['is_denied']) { |
|
| 1172 | + echo ' |
|
| 1122 | 1173 | <span class="alert">', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']), '</span>'; |
| 1123 | - else |
|
| 1124 | - echo ' |
|
| 1174 | + } else { |
|
| 1175 | + echo ' |
|
| 1125 | 1176 | ', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']); |
| 1177 | + } |
|
| 1126 | 1178 | |
| 1127 | 1179 | echo ' |
| 1128 | 1180 | </td> |
@@ -1132,10 +1184,10 @@ discard block |
||
| 1132 | 1184 | </tbody> |
| 1133 | 1185 | </table> |
| 1134 | 1186 | </div><br>'; |
| 1135 | - } |
|
| 1136 | - else |
|
| 1137 | - echo ' |
|
| 1187 | + } else { |
|
| 1188 | + echo ' |
|
| 1138 | 1189 | <p class="windowbg2">', $txt['showPermissions_none_general'], '</p>'; |
| 1190 | + } |
|
| 1139 | 1191 | |
| 1140 | 1192 | // Board permission section. |
| 1141 | 1193 | echo ' |
@@ -1145,14 +1197,16 @@ discard block |
||
| 1145 | 1197 | <a id="board_permissions"></a>', $txt['showPermissions_select'], ': |
| 1146 | 1198 | <select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();"> |
| 1147 | 1199 | <option value="0"', $context['board'] == 0 ? ' selected' : '', '>', $txt['showPermissions_global'], ' </option>'; |
| 1148 | - if (!empty($context['boards'])) |
|
| 1149 | - echo ' |
|
| 1200 | + if (!empty($context['boards'])) { |
|
| 1201 | + echo ' |
|
| 1150 | 1202 | <option value="" disabled>---------------------------</option>'; |
| 1203 | + } |
|
| 1151 | 1204 | |
| 1152 | 1205 | // Fill the box with any local permission boards. |
| 1153 | - foreach ($context['boards'] as $board) |
|
| 1154 | - echo ' |
|
| 1206 | + foreach ($context['boards'] as $board) { |
|
| 1207 | + echo ' |
|
| 1155 | 1208 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>'; |
| 1209 | + } |
|
| 1156 | 1210 | |
| 1157 | 1211 | echo ' |
| 1158 | 1212 | </select> |
@@ -1183,8 +1237,7 @@ discard block |
||
| 1183 | 1237 | { |
| 1184 | 1238 | echo ' |
| 1185 | 1239 | <span class="alert">', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']), '</span>'; |
| 1186 | - } |
|
| 1187 | - else |
|
| 1240 | + } else |
|
| 1188 | 1241 | { |
| 1189 | 1242 | echo ' |
| 1190 | 1243 | ', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']); |
@@ -1196,10 +1249,10 @@ discard block |
||
| 1196 | 1249 | echo ' |
| 1197 | 1250 | </tbody> |
| 1198 | 1251 | </table>'; |
| 1199 | - } |
|
| 1200 | - else |
|
| 1201 | - echo ' |
|
| 1252 | + } else { |
|
| 1253 | + echo ' |
|
| 1202 | 1254 | <p class="windowbg2">', $txt['showPermissions_none_board'], '</p>'; |
| 1255 | + } |
|
| 1203 | 1256 | echo ' |
| 1204 | 1257 | </div> |
| 1205 | 1258 | </div>'; |
@@ -1241,9 +1294,10 @@ discard block |
||
| 1241 | 1294 | </div>'; |
| 1242 | 1295 | |
| 1243 | 1296 | // If they haven't post at all, don't draw the graph. |
| 1244 | - if (empty($context['posts_by_time'])) |
|
| 1245 | - echo ' |
|
| 1297 | + if (empty($context['posts_by_time'])) { |
|
| 1298 | + echo ' |
|
| 1246 | 1299 | <p class="centertext padding">', $txt['statPanel_noPosts'], '</p>'; |
| 1300 | + } |
|
| 1247 | 1301 | // Otherwise do! |
| 1248 | 1302 | else |
| 1249 | 1303 | { |
@@ -1282,11 +1336,10 @@ discard block |
||
| 1282 | 1336 | </h3> |
| 1283 | 1337 | </div>'; |
| 1284 | 1338 | |
| 1285 | - if (empty($context['popular_boards'])) |
|
| 1286 | - echo ' |
|
| 1339 | + if (empty($context['popular_boards'])) { |
|
| 1340 | + echo ' |
|
| 1287 | 1341 | <p class="centertext padding">', $txt['statPanel_noPosts'], '</p>'; |
| 1288 | - |
|
| 1289 | - else |
|
| 1342 | + } else |
|
| 1290 | 1343 | { |
| 1291 | 1344 | echo ' |
| 1292 | 1345 | <dl class="stats">'; |
@@ -1317,10 +1370,10 @@ discard block |
||
| 1317 | 1370 | </h3> |
| 1318 | 1371 | </div>'; |
| 1319 | 1372 | |
| 1320 | - if (empty($context['board_activity'])) |
|
| 1321 | - echo ' |
|
| 1373 | + if (empty($context['board_activity'])) { |
|
| 1374 | + echo ' |
|
| 1322 | 1375 | <p class="centertext padding">', $txt['statPanel_noPosts'], '</p>'; |
| 1323 | - else |
|
| 1376 | + } else |
|
| 1324 | 1377 | { |
| 1325 | 1378 | echo ' |
| 1326 | 1379 | <dl class="stats">'; |
@@ -1368,41 +1421,46 @@ discard block |
||
| 1368 | 1421 | <h3 class="catbg profile_hd">'; |
| 1369 | 1422 | |
| 1370 | 1423 | // Don't say "Profile" if this isn't the profile... |
| 1371 | - if (!empty($context['profile_header_text'])) |
|
| 1372 | - echo ' |
|
| 1424 | + if (!empty($context['profile_header_text'])) { |
|
| 1425 | + echo ' |
|
| 1373 | 1426 | ', $context['profile_header_text']; |
| 1374 | - else |
|
| 1375 | - echo ' |
|
| 1427 | + } else { |
|
| 1428 | + echo ' |
|
| 1376 | 1429 | ', $txt['profile']; |
| 1430 | + } |
|
| 1377 | 1431 | |
| 1378 | 1432 | echo ' |
| 1379 | 1433 | </h3> |
| 1380 | 1434 | </div>'; |
| 1381 | 1435 | |
| 1382 | 1436 | // Have we some description? |
| 1383 | - if ($context['page_desc']) |
|
| 1384 | - echo ' |
|
| 1437 | + if ($context['page_desc']) { |
|
| 1438 | + echo ' |
|
| 1385 | 1439 | <p class="information">', $context['page_desc'], '</p>'; |
| 1440 | + } |
|
| 1386 | 1441 | |
| 1387 | 1442 | echo ' |
| 1388 | 1443 | <div class="roundframe">'; |
| 1389 | 1444 | |
| 1390 | 1445 | // Any bits at the start? |
| 1391 | - if (!empty($context['profile_prehtml'])) |
|
| 1392 | - echo ' |
|
| 1446 | + if (!empty($context['profile_prehtml'])) { |
|
| 1447 | + echo ' |
|
| 1393 | 1448 | <div>', $context['profile_prehtml'], '</div>'; |
| 1449 | + } |
|
| 1394 | 1450 | |
| 1395 | - if (!empty($context['profile_fields'])) |
|
| 1396 | - echo ' |
|
| 1451 | + if (!empty($context['profile_fields'])) { |
|
| 1452 | + echo ' |
|
| 1397 | 1453 | <dl class="settings">'; |
| 1454 | + } |
|
| 1398 | 1455 | |
| 1399 | 1456 | // Start the big old loop 'of love. |
| 1400 | 1457 | $lastItem = 'hr'; |
| 1401 | 1458 | foreach ($context['profile_fields'] as $key => $field) |
| 1402 | 1459 | { |
| 1403 | 1460 | // We add a little hack to be sure we never get more than one hr in a row! |
| 1404 | - if ($lastItem == 'hr' && $field['type'] == 'hr') |
|
| 1405 | - continue; |
|
| 1461 | + if ($lastItem == 'hr' && $field['type'] == 'hr') { |
|
| 1462 | + continue; |
|
| 1463 | + } |
|
| 1406 | 1464 | |
| 1407 | 1465 | $lastItem = $field['type']; |
| 1408 | 1466 | if ($field['type'] == 'hr') |
@@ -1411,48 +1469,50 @@ discard block |
||
| 1411 | 1469 | </dl> |
| 1412 | 1470 | <hr> |
| 1413 | 1471 | <dl class="settings">'; |
| 1414 | - } |
|
| 1415 | - elseif ($field['type'] == 'callback') |
|
| 1472 | + } elseif ($field['type'] == 'callback') |
|
| 1416 | 1473 | { |
| 1417 | 1474 | if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func'])) |
| 1418 | 1475 | { |
| 1419 | 1476 | $callback_func = 'template_profile_' . $field['callback_func']; |
| 1420 | 1477 | $callback_func(); |
| 1421 | 1478 | } |
| 1422 | - } |
|
| 1423 | - else |
|
| 1479 | + } else |
|
| 1424 | 1480 | { |
| 1425 | 1481 | echo ' |
| 1426 | 1482 | <dt> |
| 1427 | 1483 | <strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['type'] !== 'label' ? '<label for="' . $key . '">' : '', $field['label'], $field['type'] !== 'label' ? '</label>' : '', '</strong>'; |
| 1428 | 1484 | |
| 1429 | 1485 | // Does it have any subtext to show? |
| 1430 | - if (!empty($field['subtext'])) |
|
| 1431 | - echo ' |
|
| 1486 | + if (!empty($field['subtext'])) { |
|
| 1487 | + echo ' |
|
| 1432 | 1488 | <br> |
| 1433 | 1489 | <span class="smalltext">', $field['subtext'], '</span>'; |
| 1490 | + } |
|
| 1434 | 1491 | |
| 1435 | 1492 | echo ' |
| 1436 | 1493 | </dt> |
| 1437 | 1494 | <dd>'; |
| 1438 | 1495 | |
| 1439 | 1496 | // Want to put something infront of the box? |
| 1440 | - if (!empty($field['preinput'])) |
|
| 1441 | - echo ' |
|
| 1497 | + if (!empty($field['preinput'])) { |
|
| 1498 | + echo ' |
|
| 1442 | 1499 | ', $field['preinput']; |
| 1500 | + } |
|
| 1443 | 1501 | |
| 1444 | 1502 | // What type of data are we showing? |
| 1445 | - if ($field['type'] == 'label') |
|
| 1446 | - echo ' |
|
| 1503 | + if ($field['type'] == 'label') { |
|
| 1504 | + echo ' |
|
| 1447 | 1505 | ', $field['value']; |
| 1506 | + } |
|
| 1448 | 1507 | |
| 1449 | 1508 | // Maybe it's a text box - very likely! |
| 1450 | 1509 | elseif (in_array($field['type'], array('int', 'float', 'text', 'password', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'number', 'time', 'url'))) |
| 1451 | 1510 | { |
| 1452 | - if ($field['type'] == 'int' || $field['type'] == 'float') |
|
| 1453 | - $type = 'number'; |
|
| 1454 | - else |
|
| 1455 | - $type = $field['type']; |
|
| 1511 | + if ($field['type'] == 'int' || $field['type'] == 'float') { |
|
| 1512 | + $type = 'number'; |
|
| 1513 | + } else { |
|
| 1514 | + $type = $field['type']; |
|
| 1515 | + } |
|
| 1456 | 1516 | $step = $field['type'] == 'float' ? ' step="0.1"' : ''; |
| 1457 | 1517 | |
| 1458 | 1518 | |
@@ -1460,9 +1520,10 @@ discard block |
||
| 1460 | 1520 | <input type="', $type, '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' ', $step, '>'; |
| 1461 | 1521 | } |
| 1462 | 1522 | // You "checking" me out? ;) |
| 1463 | - elseif ($field['type'] == 'check') |
|
| 1464 | - echo ' |
|
| 1523 | + elseif ($field['type'] == 'check') { |
|
| 1524 | + echo ' |
|
| 1465 | 1525 | <input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" ', $field['input_attr'], '>'; |
| 1526 | + } |
|
| 1466 | 1527 | |
| 1467 | 1528 | // Always fun - select boxes! |
| 1468 | 1529 | elseif ($field['type'] == 'select') |
@@ -1473,13 +1534,15 @@ discard block |
||
| 1473 | 1534 | if (isset($field['options'])) |
| 1474 | 1535 | { |
| 1475 | 1536 | // Is this some code to generate the options? |
| 1476 | - if (!is_array($field['options'])) |
|
| 1477 | - $field['options'] = $field['options'](); |
|
| 1537 | + if (!is_array($field['options'])) { |
|
| 1538 | + $field['options'] = $field['options'](); |
|
| 1539 | + } |
|
| 1478 | 1540 | // Assuming we now have some! |
| 1479 | - if (is_array($field['options'])) |
|
| 1480 | - foreach ($field['options'] as $value => $name) |
|
| 1541 | + if (is_array($field['options'])) { |
|
| 1542 | + foreach ($field['options'] as $value => $name) |
|
| 1481 | 1543 | echo ' |
| 1482 | 1544 | <option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>'; |
| 1545 | + } |
|
| 1483 | 1546 | } |
| 1484 | 1547 | |
| 1485 | 1548 | echo ' |
@@ -1487,25 +1550,28 @@ discard block |
||
| 1487 | 1550 | } |
| 1488 | 1551 | |
| 1489 | 1552 | // Something to end with? |
| 1490 | - if (!empty($field['postinput'])) |
|
| 1491 | - echo ' |
|
| 1553 | + if (!empty($field['postinput'])) { |
|
| 1554 | + echo ' |
|
| 1492 | 1555 | ', $field['postinput']; |
| 1556 | + } |
|
| 1493 | 1557 | |
| 1494 | 1558 | echo ' |
| 1495 | 1559 | </dd>'; |
| 1496 | 1560 | } |
| 1497 | 1561 | } |
| 1498 | 1562 | |
| 1499 | - if (!empty($context['profile_fields'])) |
|
| 1500 | - echo ' |
|
| 1563 | + if (!empty($context['profile_fields'])) { |
|
| 1564 | + echo ' |
|
| 1501 | 1565 | </dl>'; |
| 1566 | + } |
|
| 1502 | 1567 | |
| 1503 | 1568 | // Are there any custom profile fields - if so print them! |
| 1504 | 1569 | if (!empty($context['custom_fields'])) |
| 1505 | 1570 | { |
| 1506 | - if ($lastItem != 'hr') |
|
| 1507 | - echo ' |
|
| 1571 | + if ($lastItem != 'hr') { |
|
| 1572 | + echo ' |
|
| 1508 | 1573 | <hr>'; |
| 1574 | + } |
|
| 1509 | 1575 | |
| 1510 | 1576 | echo ' |
| 1511 | 1577 | <dl class="settings">'; |
@@ -1528,13 +1594,14 @@ discard block |
||
| 1528 | 1594 | } |
| 1529 | 1595 | |
| 1530 | 1596 | // Any closing HTML? |
| 1531 | - if (!empty($context['profile_posthtml'])) |
|
| 1532 | - echo ' |
|
| 1597 | + if (!empty($context['profile_posthtml'])) { |
|
| 1598 | + echo ' |
|
| 1533 | 1599 | <div>', $context['profile_posthtml'], '</div>'; |
| 1600 | + } |
|
| 1534 | 1601 | |
| 1535 | 1602 | // Only show the password box if it's actually needed. |
| 1536 | - if ($context['require_password']) |
|
| 1537 | - echo ' |
|
| 1603 | + if ($context['require_password']) { |
|
| 1604 | + echo ' |
|
| 1538 | 1605 | <dl class="settings"> |
| 1539 | 1606 | <dt> |
| 1540 | 1607 | <strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br> |
@@ -1544,18 +1611,21 @@ discard block |
||
| 1544 | 1611 | <input type="password" name="oldpasswrd" id="oldpasswrd" size="20" style="margin-right: 4ex;"> |
| 1545 | 1612 | </dd> |
| 1546 | 1613 | </dl>'; |
| 1614 | + } |
|
| 1547 | 1615 | |
| 1548 | 1616 | // The button shouldn't say "Change profile" unless we're changing the profile... |
| 1549 | - if (!empty($context['submit_button_text'])) |
|
| 1550 | - echo ' |
|
| 1617 | + if (!empty($context['submit_button_text'])) { |
|
| 1618 | + echo ' |
|
| 1551 | 1619 | <input type="submit" name="save" value="', $context['submit_button_text'], '" class="button">'; |
| 1552 | - else |
|
| 1553 | - echo ' |
|
| 1620 | + } else { |
|
| 1621 | + echo ' |
|
| 1554 | 1622 | <input type="submit" name="save" value="', $txt['change_profile'], '" class="button">'; |
| 1623 | + } |
|
| 1555 | 1624 | |
| 1556 | - if (!empty($context['token_check'])) |
|
| 1557 | - echo ' |
|
| 1625 | + if (!empty($context['token_check'])) { |
|
| 1626 | + echo ' |
|
| 1558 | 1627 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 1628 | + } |
|
| 1559 | 1629 | |
| 1560 | 1630 | echo ' |
| 1561 | 1631 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -1565,10 +1635,11 @@ discard block |
||
| 1565 | 1635 | </form>'; |
| 1566 | 1636 | |
| 1567 | 1637 | // Any final spellchecking stuff? |
| 1568 | - if (!empty($context['show_spellchecking'])) |
|
| 1569 | - echo ' |
|
| 1638 | + if (!empty($context['show_spellchecking'])) { |
|
| 1639 | + echo ' |
|
| 1570 | 1640 | <form name="spell_form" id="spell_form" method="post" accept-charset="', $context['character_set'], '" target="spellWindow" action="', $scripturl, '?action=spellcheck"><input type="hidden" name="spellstring" value=""></form>'; |
| 1571 | -} |
|
| 1641 | + } |
|
| 1642 | + } |
|
| 1572 | 1643 | |
| 1573 | 1644 | /** |
| 1574 | 1645 | * Personal Message settings. |
@@ -1605,10 +1676,11 @@ discard block |
||
| 1605 | 1676 | <select name="pm_receive_from" id="pm_receive_from"> |
| 1606 | 1677 | <option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected' : '', '>', $txt['pm_receive_from_everyone'], '</option>'; |
| 1607 | 1678 | |
| 1608 | - if (!empty($modSettings['enable_buddylist'])) |
|
| 1609 | - echo ' |
|
| 1679 | + if (!empty($modSettings['enable_buddylist'])) { |
|
| 1680 | + echo ' |
|
| 1610 | 1681 | <option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected' : '', '>', $txt['pm_receive_from_ignore'], '</option> |
| 1611 | 1682 | <option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected' : '', '>', $txt['pm_receive_from_buddies'], '</option>'; |
| 1683 | + } |
|
| 1612 | 1684 | |
| 1613 | 1685 | echo ' |
| 1614 | 1686 | <option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected' : '', '>', $txt['pm_receive_from_admins'], '</option> |
@@ -1651,11 +1723,12 @@ discard block |
||
| 1651 | 1723 | if (empty($setting) || !is_array($setting)) |
| 1652 | 1724 | { |
| 1653 | 1725 | // Insert a separator (unless this is the first item in the list) |
| 1654 | - if ($i !== $first_option_key) |
|
| 1655 | - echo ' |
|
| 1726 | + if ($i !== $first_option_key) { |
|
| 1727 | + echo ' |
|
| 1656 | 1728 | </dl> |
| 1657 | 1729 | <hr> |
| 1658 | 1730 | <dl class="settings">'; |
| 1731 | + } |
|
| 1659 | 1732 | |
| 1660 | 1733 | // Should we give a name to this section? |
| 1661 | 1734 | if (is_string($setting) && !empty($setting)) |
@@ -1663,48 +1736,52 @@ discard block |
||
| 1663 | 1736 | $titled_section = true; |
| 1664 | 1737 | echo ' |
| 1665 | 1738 | <dt><strong>' . $setting . '</strong></dt><dd></dd>'; |
| 1739 | + } else { |
|
| 1740 | + $titled_section = false; |
|
| 1666 | 1741 | } |
| 1667 | - else |
|
| 1668 | - $titled_section = false; |
|
| 1669 | 1742 | |
| 1670 | 1743 | continue; |
| 1671 | 1744 | } |
| 1672 | 1745 | |
| 1673 | 1746 | // Is this disabled? |
| 1674 | - if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled'])) |
|
| 1675 | - continue; |
|
| 1676 | - elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage'])) |
|
| 1677 | - continue; |
|
| 1678 | - elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored'])) |
|
| 1679 | - continue; |
|
| 1680 | - elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist'])) |
|
| 1681 | - continue; |
|
| 1682 | - elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg'])) |
|
| 1683 | - continue; |
|
| 1684 | - elseif ($setting['id'] == 'topics_per_page' && !empty($modSettings['disableCustomPerPage'])) |
|
| 1685 | - continue; |
|
| 1686 | - elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) |
|
| 1687 | - continue; |
|
| 1688 | - elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) |
|
| 1689 | - continue; |
|
| 1747 | + if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled'])) { |
|
| 1748 | + continue; |
|
| 1749 | + } elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage'])) { |
|
| 1750 | + continue; |
|
| 1751 | + } elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored'])) { |
|
| 1752 | + continue; |
|
| 1753 | + } elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist'])) { |
|
| 1754 | + continue; |
|
| 1755 | + } elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg'])) { |
|
| 1756 | + continue; |
|
| 1757 | + } elseif ($setting['id'] == 'topics_per_page' && !empty($modSettings['disableCustomPerPage'])) { |
|
| 1758 | + continue; |
|
| 1759 | + } elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) { |
|
| 1760 | + continue; |
|
| 1761 | + } elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) { |
|
| 1762 | + continue; |
|
| 1763 | + } |
|
| 1690 | 1764 | |
| 1691 | - if (!isset($setting['type']) || $setting['type'] == 'bool') |
|
| 1692 | - $setting['type'] = 'checkbox'; |
|
| 1693 | - elseif ($setting['type'] == 'int' || $setting['type'] == 'integer') |
|
| 1694 | - $setting['type'] = 'number'; |
|
| 1695 | - elseif ($setting['type'] == 'string') |
|
| 1696 | - $setting['type'] = 'text'; |
|
| 1765 | + if (!isset($setting['type']) || $setting['type'] == 'bool') { |
|
| 1766 | + $setting['type'] = 'checkbox'; |
|
| 1767 | + } elseif ($setting['type'] == 'int' || $setting['type'] == 'integer') { |
|
| 1768 | + $setting['type'] = 'number'; |
|
| 1769 | + } elseif ($setting['type'] == 'string') { |
|
| 1770 | + $setting['type'] = 'text'; |
|
| 1771 | + } |
|
| 1697 | 1772 | |
| 1698 | - if (isset($setting['options'])) |
|
| 1699 | - $setting['type'] = 'list'; |
|
| 1773 | + if (isset($setting['options'])) { |
|
| 1774 | + $setting['type'] = 'list'; |
|
| 1775 | + } |
|
| 1700 | 1776 | |
| 1701 | 1777 | echo ' |
| 1702 | 1778 | <dt> |
| 1703 | 1779 | <label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>'; |
| 1704 | 1780 | |
| 1705 | - if (isset($setting['description'])) |
|
| 1706 | - echo ' |
|
| 1781 | + if (isset($setting['description'])) { |
|
| 1782 | + echo ' |
|
| 1707 | 1783 | <br><span class="smalltext">', $setting['description'], '</span>'; |
| 1784 | + } |
|
| 1708 | 1785 | echo ' |
| 1709 | 1786 | </dt> |
| 1710 | 1787 | <dd>'; |
@@ -1742,13 +1819,11 @@ discard block |
||
| 1742 | 1819 | |
| 1743 | 1820 | echo ' |
| 1744 | 1821 | <input type="number"', $min . $max . $step; |
| 1745 | - } |
|
| 1746 | - else if (isset($setting['type']) && $setting['type'] == 'url') |
|
| 1822 | + } else if (isset($setting['type']) && $setting['type'] == 'url') |
|
| 1747 | 1823 | { |
| 1748 | 1824 | echo' |
| 1749 | 1825 | <input type="url"'; |
| 1750 | - } |
|
| 1751 | - else |
|
| 1826 | + } else |
|
| 1752 | 1827 | { |
| 1753 | 1828 | echo ' |
| 1754 | 1829 | <input type="text"'; |
@@ -1787,8 +1862,8 @@ discard block |
||
| 1787 | 1862 | <dl class="settings">'; |
| 1788 | 1863 | |
| 1789 | 1864 | // Allow notification on announcements to be disabled? |
| 1790 | - if (!empty($modSettings['allow_disableAnnounce'])) |
|
| 1791 | - echo ' |
|
| 1865 | + if (!empty($modSettings['allow_disableAnnounce'])) { |
|
| 1866 | + echo ' |
|
| 1792 | 1867 | <dt> |
| 1793 | 1868 | <label for="notify_announcements">', $txt['notify_important_email'], '</label> |
| 1794 | 1869 | </dt> |
@@ -1796,9 +1871,10 @@ discard block |
||
| 1796 | 1871 | <input type="hidden" name="notify_announcements" value="0"> |
| 1797 | 1872 | <input type="checkbox" id="notify_announcements" name="notify_announcements" value="1"', !empty($context['member']['notify_announcements']) ? ' checked' : '', '> |
| 1798 | 1873 | </dd>'; |
| 1874 | + } |
|
| 1799 | 1875 | |
| 1800 | - if (!empty($modSettings['enable_ajax_alerts'])) |
|
| 1801 | - echo ' |
|
| 1876 | + if (!empty($modSettings['enable_ajax_alerts'])) { |
|
| 1877 | + echo ' |
|
| 1802 | 1878 | <dt> |
| 1803 | 1879 | <label for="notify_send_body">', $txt['notify_alert_timeout'], '</label> |
| 1804 | 1880 | </dt> |
@@ -1806,6 +1882,7 @@ discard block |
||
| 1806 | 1882 | <input type="number" size="4" id="notify_alert_timeout" name="opt_alert_timeout" min="0" value="', $context['member']['alert_timeout'], '"> |
| 1807 | 1883 | </dd> |
| 1808 | 1884 | '; |
| 1885 | + } |
|
| 1809 | 1886 | |
| 1810 | 1887 | echo ' |
| 1811 | 1888 | </dl> |
@@ -1835,9 +1912,10 @@ discard block |
||
| 1835 | 1912 | <td colspan="3">'; |
| 1836 | 1913 | $label = $txt['alert_opt_' . $opts[1]]; |
| 1837 | 1914 | $label_pos = isset($opts['label']) ? $opts['label'] : ''; |
| 1838 | - if ($label_pos == 'before') |
|
| 1839 | - echo ' |
|
| 1915 | + if ($label_pos == 'before') { |
|
| 1916 | + echo ' |
|
| 1840 | 1917 | <label for="opt_', $opts[1], '">', $label, '</label>'; |
| 1918 | + } |
|
| 1841 | 1919 | |
| 1842 | 1920 | $this_value = isset($context['alert_prefs'][$opts[1]]) ? $context['alert_prefs'][$opts[1]] : 0; |
| 1843 | 1921 | switch ($opts[0]) |
@@ -1849,17 +1927,19 @@ discard block |
||
| 1849 | 1927 | case 'select': |
| 1850 | 1928 | echo ' |
| 1851 | 1929 | <select name="opt_', $opts[1], '" id="opt_', $opts[1], '">'; |
| 1852 | - foreach ($opts['opts'] as $k => $v) |
|
| 1853 | - echo ' |
|
| 1930 | + foreach ($opts['opts'] as $k => $v) { |
|
| 1931 | + echo ' |
|
| 1854 | 1932 | <option value="', $k, '"', $this_value == $k ? ' selected' : '', '>', $v, '</option>'; |
| 1933 | + } |
|
| 1855 | 1934 | echo ' |
| 1856 | 1935 | </select>'; |
| 1857 | 1936 | break; |
| 1858 | 1937 | } |
| 1859 | 1938 | |
| 1860 | - if ($label_pos == 'after') |
|
| 1861 | - echo ' |
|
| 1939 | + if ($label_pos == 'after') { |
|
| 1940 | + echo ' |
|
| 1862 | 1941 | <label for="opt_', $opts[1], '">', $label, '</label>'; |
| 1942 | + } |
|
| 1863 | 1943 | |
| 1864 | 1944 | echo ' |
| 1865 | 1945 | </td> |
@@ -1973,11 +2053,12 @@ discard block |
||
| 1973 | 2053 | <p class="information">', $txt['groupMembership_info'], '</p>'; |
| 1974 | 2054 | |
| 1975 | 2055 | // Do we have an update message? |
| 1976 | - if (!empty($context['update_message'])) |
|
| 1977 | - echo ' |
|
| 2056 | + if (!empty($context['update_message'])) { |
|
| 2057 | + echo ' |
|
| 1978 | 2058 | <div class="infobox"> |
| 1979 | 2059 | ', $context['update_message'], '. |
| 1980 | 2060 | </div>'; |
| 2061 | + } |
|
| 1981 | 2062 | |
| 1982 | 2063 | echo ' |
| 1983 | 2064 | <div id="groups">'; |
@@ -1999,8 +2080,7 @@ discard block |
||
| 1999 | 2080 | </div> |
| 2000 | 2081 | </div> |
| 2001 | 2082 | </div>'; |
| 2002 | - } |
|
| 2003 | - else |
|
| 2083 | + } else |
|
| 2004 | 2084 | { |
| 2005 | 2085 | echo ' |
| 2006 | 2086 | <div class="title_bar"> |
@@ -2012,27 +2092,30 @@ discard block |
||
| 2012 | 2092 | echo ' |
| 2013 | 2093 | <div class="windowbg" id="primdiv_', $group['id'], '">'; |
| 2014 | 2094 | |
| 2015 | - if ($context['can_edit_primary']) |
|
| 2016 | - echo ' |
|
| 2095 | + if ($context['can_edit_primary']) { |
|
| 2096 | + echo ' |
|
| 2017 | 2097 | <input type="radio" name="primary" id="primary_', $group['id'], '" value="', $group['id'], '"', $group['is_primary'] ? ' checked' : '', ' onclick="highlightSelected(\'primdiv_' . $group['id'] . '\');"', $group['can_be_primary'] ? '' : ' disabled', '>'; |
| 2098 | + } |
|
| 2018 | 2099 | |
| 2019 | 2100 | echo ' |
| 2020 | 2101 | <label for="primary_', $group['id'], '"><strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br><span class="smalltext">' . $group['desc'] . '</span>' : ''), '</label>'; |
| 2021 | 2102 | |
| 2022 | 2103 | // Can they leave their group? |
| 2023 | - if ($group['can_leave']) |
|
| 2024 | - echo ' |
|
| 2104 | + if ($group['can_leave']) { |
|
| 2105 | + echo ' |
|
| 2025 | 2106 | <a href="' . $scripturl . '?action=profile;save;u=' . $context['id_member'] . ';area=groupmembership;' . $context['session_var'] . '=' . $context['session_id'] . ';gid=' . $group['id'] . ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '">' . $txt['leave_group'] . '</a>'; |
| 2107 | + } |
|
| 2026 | 2108 | |
| 2027 | 2109 | echo ' |
| 2028 | 2110 | </div>'; |
| 2029 | 2111 | } |
| 2030 | 2112 | |
| 2031 | - if ($context['can_edit_primary']) |
|
| 2032 | - echo ' |
|
| 2113 | + if ($context['can_edit_primary']) { |
|
| 2114 | + echo ' |
|
| 2033 | 2115 | <div class="padding righttext"> |
| 2034 | 2116 | <input type="submit" value="', $txt['make_primary'], '" class="button"> |
| 2035 | 2117 | </div>'; |
| 2118 | + } |
|
| 2036 | 2119 | |
| 2037 | 2120 | // Any groups they can join? |
| 2038 | 2121 | if (!empty($context['groups']['available'])) |
@@ -2048,15 +2131,16 @@ discard block |
||
| 2048 | 2131 | <div class="windowbg"> |
| 2049 | 2132 | <strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br><span class="smalltext">' . $group['desc'] . '</span>' : ''), ''; |
| 2050 | 2133 | |
| 2051 | - if ($group['type'] == 3) |
|
| 2052 | - echo ' |
|
| 2134 | + if ($group['type'] == 3) { |
|
| 2135 | + echo ' |
|
| 2053 | 2136 | <a href="', $scripturl, '?action=profile;save;u=', $context['id_member'], ';area=groupmembership;', $context['session_var'], '=', $context['session_id'], ';gid=', $group['id'], ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '" class="button floatright">', $txt['join_group'], '</a>'; |
| 2054 | - elseif ($group['type'] == 2 && $group['pending']) |
|
| 2055 | - echo ' |
|
| 2137 | + } elseif ($group['type'] == 2 && $group['pending']) { |
|
| 2138 | + echo ' |
|
| 2056 | 2139 | <span class="floatright">', $txt['approval_pending'], '</span>'; |
| 2057 | - elseif ($group['type'] == 2) |
|
| 2058 | - echo ' |
|
| 2140 | + } elseif ($group['type'] == 2) { |
|
| 2141 | + echo ' |
|
| 2059 | 2142 | <a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '" class="button floatright">', $txt['request_group'], '</a>'; |
| 2143 | + } |
|
| 2060 | 2144 | |
| 2061 | 2145 | echo ' |
| 2062 | 2146 | </div>'; |
@@ -2079,9 +2163,10 @@ discard block |
||
| 2079 | 2163 | |
| 2080 | 2164 | prevDiv.className = "windowbg"; |
| 2081 | 2165 | }'; |
| 2082 | - if (isset($context['groups']['member'][$context['primary_group']])) |
|
| 2083 | - echo ' |
|
| 2166 | + if (isset($context['groups']['member'][$context['primary_group']])) { |
|
| 2167 | + echo ' |
|
| 2084 | 2168 | highlightSelected("primdiv_' . $context['primary_group'] . '");'; |
| 2169 | + } |
|
| 2085 | 2170 | echo ' |
| 2086 | 2171 | </script>'; |
| 2087 | 2172 | } |
@@ -2089,9 +2174,10 @@ discard block |
||
| 2089 | 2174 | echo ' |
| 2090 | 2175 | </div>'; |
| 2091 | 2176 | |
| 2092 | - if (!empty($context['token_check'])) |
|
| 2093 | - echo ' |
|
| 2177 | + if (!empty($context['token_check'])) { |
|
| 2178 | + echo ' |
|
| 2094 | 2179 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 2180 | + } |
|
| 2095 | 2181 | |
| 2096 | 2182 | echo ' |
| 2097 | 2183 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -2138,14 +2224,15 @@ discard block |
||
| 2138 | 2224 | |
| 2139 | 2225 | foreach ($category['boards'] as $board) |
| 2140 | 2226 | { |
| 2141 | - if ($i == $limit) |
|
| 2142 | - echo ' |
|
| 2227 | + if ($i == $limit) { |
|
| 2228 | + echo ' |
|
| 2143 | 2229 | </ul> |
| 2144 | 2230 | </li> |
| 2145 | 2231 | </ul> |
| 2146 | 2232 | <ul class="ignoreboards floatright"> |
| 2147 | 2233 | <li class="category"> |
| 2148 | 2234 | <ul>'; |
| 2235 | + } |
|
| 2149 | 2236 | |
| 2150 | 2237 | echo ' |
| 2151 | 2238 | <li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;"> |
@@ -2191,10 +2278,11 @@ discard block |
||
| 2191 | 2278 | |
| 2192 | 2279 | // Work out the starting color. |
| 2193 | 2280 | $context['current_color'] = $context['colors'][0]; |
| 2194 | - foreach ($context['colors'] as $limit => $color) |
|
| 2195 | - if ($context['member']['warning'] >= $limit) |
|
| 2281 | + foreach ($context['colors'] as $limit => $color) { |
|
| 2282 | + if ($context['member']['warning'] >= $limit) |
|
| 2196 | 2283 | $context['current_color'] = $color; |
| 2197 | -} |
|
| 2284 | + } |
|
| 2285 | + } |
|
| 2198 | 2286 | |
| 2199 | 2287 | // Show all warnings of a user? |
| 2200 | 2288 | function template_viewWarning() |
@@ -2233,14 +2321,15 @@ discard block |
||
| 2233 | 2321 | </dd>'; |
| 2234 | 2322 | |
| 2235 | 2323 | // There's some impact of this? |
| 2236 | - if (!empty($context['level_effects'][$context['current_level']])) |
|
| 2237 | - echo ' |
|
| 2324 | + if (!empty($context['level_effects'][$context['current_level']])) { |
|
| 2325 | + echo ' |
|
| 2238 | 2326 | <dt> |
| 2239 | 2327 | <strong>', $txt['profile_viewwarning_impact'], ':</strong> |
| 2240 | 2328 | </dt> |
| 2241 | 2329 | <dd> |
| 2242 | 2330 | ', $context['level_effects'][$context['current_level']], ' |
| 2243 | 2331 | </dd>'; |
| 2332 | + } |
|
| 2244 | 2333 | |
| 2245 | 2334 | echo ' |
| 2246 | 2335 | </dl> |
@@ -2278,10 +2367,11 @@ discard block |
||
| 2278 | 2367 | |
| 2279 | 2368 | // Otherwise see what we can do...'; |
| 2280 | 2369 | |
| 2281 | - foreach ($context['notification_templates'] as $k => $type) |
|
| 2282 | - echo ' |
|
| 2370 | + foreach ($context['notification_templates'] as $k => $type) { |
|
| 2371 | + echo ' |
|
| 2283 | 2372 | if (index == ', $k, ') |
| 2284 | 2373 | document.getElementById(\'warn_body\').value = "', strtr($type['body'], array('"' => "'", "\n" => '\\n', "\r" => '')), '";'; |
| 2374 | + } |
|
| 2285 | 2375 | |
| 2286 | 2376 | echo ' |
| 2287 | 2377 | } |
@@ -2291,10 +2381,11 @@ discard block |
||
| 2291 | 2381 | // Also set the right effect. |
| 2292 | 2382 | effectText = "";'; |
| 2293 | 2383 | |
| 2294 | - foreach ($context['level_effects'] as $limit => $text) |
|
| 2295 | - echo ' |
|
| 2384 | + foreach ($context['level_effects'] as $limit => $text) { |
|
| 2385 | + echo ' |
|
| 2296 | 2386 | if (slideAmount >= ', $limit, ') |
| 2297 | 2387 | effectText = "', $text, '";'; |
| 2388 | + } |
|
| 2298 | 2389 | |
| 2299 | 2390 | echo ' |
| 2300 | 2391 | setInnerHTML(document.getElementById(\'cur_level_div\'), slideAmount + \'% (\' + effectText + \')\'); |
@@ -2309,31 +2400,34 @@ discard block |
||
| 2309 | 2400 | </h3> |
| 2310 | 2401 | </div>'; |
| 2311 | 2402 | |
| 2312 | - if (!$context['user']['is_owner']) |
|
| 2313 | - echo ' |
|
| 2403 | + if (!$context['user']['is_owner']) { |
|
| 2404 | + echo ' |
|
| 2314 | 2405 | <p class="information">', $txt['profile_warning_desc'], '</p>'; |
| 2406 | + } |
|
| 2315 | 2407 | |
| 2316 | 2408 | echo ' |
| 2317 | 2409 | <div class="windowbg"> |
| 2318 | 2410 | <dl class="settings">'; |
| 2319 | 2411 | |
| 2320 | - if (!$context['user']['is_owner']) |
|
| 2321 | - echo ' |
|
| 2412 | + if (!$context['user']['is_owner']) { |
|
| 2413 | + echo ' |
|
| 2322 | 2414 | <dt> |
| 2323 | 2415 | <strong>', $txt['profile_warning_name'], ':</strong> |
| 2324 | 2416 | </dt> |
| 2325 | 2417 | <dd> |
| 2326 | 2418 | <strong>', $context['member']['name'], '</strong> |
| 2327 | 2419 | </dd>'; |
| 2420 | + } |
|
| 2328 | 2421 | |
| 2329 | 2422 | echo ' |
| 2330 | 2423 | <dt> |
| 2331 | 2424 | <strong>', $txt['profile_warning_level'], ':</strong>'; |
| 2332 | 2425 | |
| 2333 | 2426 | // Is there only so much they can apply? |
| 2334 | - if ($context['warning_limit']) |
|
| 2335 | - echo ' |
|
| 2427 | + if ($context['warning_limit']) { |
|
| 2428 | + echo ' |
|
| 2336 | 2429 | <br><span class="smalltext">', sprintf($txt['profile_warning_limit_attribute'], $context['warning_limit']), '</span>'; |
| 2430 | + } |
|
| 2337 | 2431 | |
| 2338 | 2432 | echo ' |
| 2339 | 2433 | </dt> |
@@ -2386,9 +2480,10 @@ discard block |
||
| 2386 | 2480 | <option value="-1">', $txt['profile_warning_notify_template'], '</option> |
| 2387 | 2481 | <option value="-1" disabled>------------------------------</option>'; |
| 2388 | 2482 | |
| 2389 | - foreach ($context['notification_templates'] as $id_template => $template) |
|
| 2390 | - echo ' |
|
| 2483 | + foreach ($context['notification_templates'] as $id_template => $template) { |
|
| 2484 | + echo ' |
|
| 2391 | 2485 | <option value="', $id_template, '">', $template['title'], '</option>'; |
| 2486 | + } |
|
| 2392 | 2487 | |
| 2393 | 2488 | echo ' |
| 2394 | 2489 | </select> |
@@ -2400,9 +2495,10 @@ discard block |
||
| 2400 | 2495 | </dl> |
| 2401 | 2496 | <div class="righttext">'; |
| 2402 | 2497 | |
| 2403 | - if (!empty($context['token_check'])) |
|
| 2404 | - echo ' |
|
| 2498 | + if (!empty($context['token_check'])) { |
|
| 2499 | + echo ' |
|
| 2405 | 2500 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 2501 | + } |
|
| 2406 | 2502 | |
| 2407 | 2503 | echo ' |
| 2408 | 2504 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -2418,8 +2514,8 @@ discard block |
||
| 2418 | 2514 | echo ' |
| 2419 | 2515 | <script>'; |
| 2420 | 2516 | |
| 2421 | - if (!$context['user']['is_owner']) |
|
| 2422 | - echo ' |
|
| 2517 | + if (!$context['user']['is_owner']) { |
|
| 2518 | + echo ' |
|
| 2423 | 2519 | modifyWarnNotify(); |
| 2424 | 2520 | $(document).ready(function() { |
| 2425 | 2521 | $("#preview_button").click(function() { |
@@ -2458,6 +2554,7 @@ discard block |
||
| 2458 | 2554 | }); |
| 2459 | 2555 | return false; |
| 2460 | 2556 | }'; |
| 2557 | + } |
|
| 2461 | 2558 | |
| 2462 | 2559 | echo ' |
| 2463 | 2560 | </script>'; |
@@ -2480,16 +2577,18 @@ discard block |
||
| 2480 | 2577 | </div>'; |
| 2481 | 2578 | |
| 2482 | 2579 | // If deleting another account give them a lovely info box. |
| 2483 | - if (!$context['user']['is_owner']) |
|
| 2484 | - echo ' |
|
| 2580 | + if (!$context['user']['is_owner']) { |
|
| 2581 | + echo ' |
|
| 2485 | 2582 | <p class="information">', $txt['deleteAccount_desc'], '</p>'; |
| 2583 | + } |
|
| 2486 | 2584 | echo ' |
| 2487 | 2585 | <div class="windowbg2">'; |
| 2488 | 2586 | |
| 2489 | 2587 | // If they are deleting their account AND the admin needs to approve it - give them another piece of info ;) |
| 2490 | - if ($context['needs_approval']) |
|
| 2491 | - echo ' |
|
| 2588 | + if ($context['needs_approval']) { |
|
| 2589 | + echo ' |
|
| 2492 | 2590 | <div class="errorbox">', $txt['deleteAccount_approval'], '</div>'; |
| 2591 | + } |
|
| 2493 | 2592 | |
| 2494 | 2593 | // If the user is deleting their own account warn them first - and require a password! |
| 2495 | 2594 | if ($context['user']['is_owner']) |
@@ -2501,9 +2600,10 @@ discard block |
||
| 2501 | 2600 | <input type="password" name="oldpasswrd" size="20"> |
| 2502 | 2601 | <input type="submit" value="', $txt['yes'], '" class="button">'; |
| 2503 | 2602 | |
| 2504 | - if (!empty($context['token_check'])) |
|
| 2505 | - echo ' |
|
| 2603 | + if (!empty($context['token_check'])) { |
|
| 2604 | + echo ' |
|
| 2506 | 2605 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 2606 | + } |
|
| 2507 | 2607 | |
| 2508 | 2608 | echo ' |
| 2509 | 2609 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -2529,9 +2629,10 @@ discard block |
||
| 2529 | 2629 | <option value="topics">', $txt['deleteAccount_topics'], '</option> |
| 2530 | 2630 | </select>'; |
| 2531 | 2631 | |
| 2532 | - if ($context['show_perma_delete']) |
|
| 2533 | - echo ' |
|
| 2632 | + if ($context['show_perma_delete']) { |
|
| 2633 | + echo ' |
|
| 2534 | 2634 | <br><label for="perma_delete"><input type="checkbox" name="perma_delete" id="perma_delete" value="1">', $txt['deleteAccount_permanent'], ':</label>'; |
| 2635 | + } |
|
| 2535 | 2636 | |
| 2536 | 2637 | echo ' |
| 2537 | 2638 | </div>'; |
@@ -2544,9 +2645,10 @@ discard block |
||
| 2544 | 2645 | <div> |
| 2545 | 2646 | <input type="submit" value="', $txt['delete'], '" class="button">'; |
| 2546 | 2647 | |
| 2547 | - if (!empty($context['token_check'])) |
|
| 2548 | - echo ' |
|
| 2648 | + if (!empty($context['token_check'])) { |
|
| 2649 | + echo ' |
|
| 2549 | 2650 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 2651 | + } |
|
| 2550 | 2652 | |
| 2551 | 2653 | echo ' |
| 2552 | 2654 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -2572,8 +2674,8 @@ discard block |
||
| 2572 | 2674 | <hr>'; |
| 2573 | 2675 | |
| 2574 | 2676 | // Only show the password box if it's actually needed. |
| 2575 | - if ($context['require_password']) |
|
| 2576 | - echo ' |
|
| 2677 | + if ($context['require_password']) { |
|
| 2678 | + echo ' |
|
| 2577 | 2679 | <dl class="settings"> |
| 2578 | 2680 | <dt> |
| 2579 | 2681 | <strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br> |
@@ -2583,13 +2685,15 @@ discard block |
||
| 2583 | 2685 | <input type="password" name="oldpasswrd" size="20" style="margin-right: 4ex;"> |
| 2584 | 2686 | </dd> |
| 2585 | 2687 | </dl>'; |
| 2688 | + } |
|
| 2586 | 2689 | |
| 2587 | 2690 | echo ' |
| 2588 | 2691 | <div class="righttext">'; |
| 2589 | 2692 | |
| 2590 | - if (!empty($context['token_check'])) |
|
| 2591 | - echo ' |
|
| 2693 | + if (!empty($context['token_check'])) { |
|
| 2694 | + echo ' |
|
| 2592 | 2695 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 2696 | + } |
|
| 2593 | 2697 | |
| 2594 | 2698 | echo ' |
| 2595 | 2699 | <input type="submit" value="', $txt['change_profile'], '" class="button"> |
@@ -2616,9 +2720,10 @@ discard block |
||
| 2616 | 2720 | <ul id="list_errors">'; |
| 2617 | 2721 | |
| 2618 | 2722 | // Cycle through each error and display an error message. |
| 2619 | - foreach ($context['post_errors'] as $error) |
|
| 2620 | - echo ' |
|
| 2723 | + foreach ($context['post_errors'] as $error) { |
|
| 2724 | + echo ' |
|
| 2621 | 2725 | <li>', isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : $error, '</li>'; |
| 2726 | + } |
|
| 2622 | 2727 | |
| 2623 | 2728 | echo ' |
| 2624 | 2729 | </ul>'; |
@@ -2644,12 +2749,13 @@ discard block |
||
| 2644 | 2749 | <select name="id_group" ', ($context['user']['is_owner'] && $context['member']['group_id'] == 1 ? 'onchange="if (this.value != 1 && !confirm(\'' . $txt['deadmin_confirm'] . '\')) this.value = 1;"' : ''), '>'; |
| 2645 | 2750 | |
| 2646 | 2751 | // Fill the select box with all primary member groups that can be assigned to a member. |
| 2647 | - foreach ($context['member_groups'] as $member_group) |
|
| 2648 | - if (!empty($member_group['can_be_primary'])) |
|
| 2752 | + foreach ($context['member_groups'] as $member_group) { |
|
| 2753 | + if (!empty($member_group['can_be_primary'])) |
|
| 2649 | 2754 | echo ' |
| 2650 | 2755 | <option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected' : '', '> |
| 2651 | 2756 | ', $member_group['name'], ' |
| 2652 | 2757 | </option>'; |
| 2758 | + } |
|
| 2653 | 2759 | echo ' |
| 2654 | 2760 | </select> |
| 2655 | 2761 | </dd> |
@@ -2661,10 +2767,11 @@ discard block |
||
| 2661 | 2767 | <input type="hidden" name="additional_groups[]" value="0">'; |
| 2662 | 2768 | |
| 2663 | 2769 | // For each membergroup show a checkbox so members can be assigned to more than one group. |
| 2664 | - foreach ($context['member_groups'] as $member_group) |
|
| 2665 | - if ($member_group['can_be_additional']) |
|
| 2770 | + foreach ($context['member_groups'] as $member_group) { |
|
| 2771 | + if ($member_group['can_be_additional']) |
|
| 2666 | 2772 | echo ' |
| 2667 | 2773 | <label for="additional_groups-', $member_group['id'], '"><input type="checkbox" name="additional_groups[]" value="', $member_group['id'], '" id="additional_groups-', $member_group['id'], '"', $member_group['is_additional'] ? ' checked' : '', '> ', $member_group['name'], '</label><br>'; |
| 2774 | + } |
|
| 2668 | 2775 | echo ' |
| 2669 | 2776 | </span> |
| 2670 | 2777 | <a href="javascript:void(0);" onclick="document.getElementById(\'additional_groupsList\').style.display = \'block\'; document.getElementById(\'additional_groupsLink\').style.display = \'none\'; return false;" id="additional_groupsLink" style="display: none;" class="toggle_down">', $txt['additional_membergroups_show'], '</a> |
@@ -2724,9 +2831,10 @@ discard block |
||
| 2724 | 2831 | <span class="smalltext">', $txt['sig_info'], '</span><br> |
| 2725 | 2832 | <br>'; |
| 2726 | 2833 | |
| 2727 | - if ($context['show_spellchecking']) |
|
| 2728 | - echo ' |
|
| 2834 | + if ($context['show_spellchecking']) { |
|
| 2835 | + echo ' |
|
| 2729 | 2836 | <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" class="button">'; |
| 2837 | + } |
|
| 2730 | 2838 | |
| 2731 | 2839 | echo ' |
| 2732 | 2840 | </dt> |
@@ -2734,17 +2842,20 @@ discard block |
||
| 2734 | 2842 | <textarea class="editor" onkeyup="calcCharLeft();" id="signature" name="signature" rows="5" cols="50" style="min-width: 50%; max-width: 99%;">', $context['member']['signature'], '</textarea><br>'; |
| 2735 | 2843 | |
| 2736 | 2844 | // If there is a limit at all! |
| 2737 | - if (!empty($context['signature_limits']['max_length'])) |
|
| 2738 | - echo ' |
|
| 2845 | + if (!empty($context['signature_limits']['max_length'])) { |
|
| 2846 | + echo ' |
|
| 2739 | 2847 | <span class="smalltext">', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' <span id="signatureLeft">', $context['signature_limits']['max_length'], '</span></span><br>'; |
| 2848 | + } |
|
| 2740 | 2849 | |
| 2741 | - if (!empty($context['show_preview_button'])) |
|
| 2742 | - echo ' |
|
| 2850 | + if (!empty($context['show_preview_button'])) { |
|
| 2851 | + echo ' |
|
| 2743 | 2852 | <input type="button" name="preview_signature" id="preview_button" value="', $txt['preview_signature'], '" class="button">'; |
| 2853 | + } |
|
| 2744 | 2854 | |
| 2745 | - if ($context['signature_warning']) |
|
| 2746 | - echo ' |
|
| 2855 | + if ($context['signature_warning']) { |
|
| 2856 | + echo ' |
|
| 2747 | 2857 | <span class="smalltext">', $context['signature_warning'], '</span>'; |
| 2858 | + } |
|
| 2748 | 2859 | |
| 2749 | 2860 | // Some javascript used to count how many characters have been used so far in the signature. |
| 2750 | 2861 | echo ' |
@@ -2788,9 +2899,10 @@ discard block |
||
| 2788 | 2899 | <div> |
| 2789 | 2900 | <select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');">'; |
| 2790 | 2901 | // This lists all the file categories. |
| 2791 | - foreach ($context['avatars'] as $avatar) |
|
| 2792 | - echo ' |
|
| 2902 | + foreach ($context['avatars'] as $avatar) { |
|
| 2903 | + echo ' |
|
| 2793 | 2904 | <option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected' : ''), '>', $avatar['name'], '</option>'; |
| 2905 | + } |
|
| 2794 | 2906 | echo ' |
| 2795 | 2907 | </select> |
| 2796 | 2908 | </div> |
@@ -2845,16 +2957,17 @@ discard block |
||
| 2845 | 2957 | <div id="avatar_gravatar"> |
| 2846 | 2958 | <img src="' . $context['member']['avatar']['href'] . '" alt="" />'; |
| 2847 | 2959 | |
| 2848 | - if (empty($modSettings['gravatarAllowExtraEmail'])) |
|
| 2849 | - echo ' |
|
| 2960 | + if (empty($modSettings['gravatarAllowExtraEmail'])) { |
|
| 2961 | + echo ' |
|
| 2850 | 2962 | <div class="smalltext">', $txt['gravatar_noAlternateEmail'], '</div>'; |
| 2851 | - else |
|
| 2963 | + } else |
|
| 2852 | 2964 | { |
| 2853 | 2965 | // Depending on other stuff, the stored value here might have some odd things in it from other areas. |
| 2854 | - if ($context['member']['avatar']['external'] == $context['member']['email']) |
|
| 2855 | - $textbox_value = ''; |
|
| 2856 | - else |
|
| 2857 | - $textbox_value = $context['member']['avatar']['external']; |
|
| 2966 | + if ($context['member']['avatar']['external'] == $context['member']['email']) { |
|
| 2967 | + $textbox_value = ''; |
|
| 2968 | + } else { |
|
| 2969 | + $textbox_value = $context['member']['avatar']['external']; |
|
| 2970 | + } |
|
| 2858 | 2971 | |
| 2859 | 2972 | echo ' |
| 2860 | 2973 | <div class="smalltext">', $txt['gravatar_alternateEmail'], '</div> |
@@ -2926,8 +3039,9 @@ discard block |
||
| 2926 | 3039 | $h = !empty($modSettings['avatar_max_height_' . $type]) ? comma_format($modSettings['avatar_max_height_' . $type]) : 0; |
| 2927 | 3040 | |
| 2928 | 3041 | $suffix = (!empty($w) ? 'w' : '') . (!empty($h) ? 'h' : ''); |
| 2929 | - if (empty($suffix)) |
|
| 2930 | - return; |
|
| 3042 | + if (empty($suffix)) { |
|
| 3043 | + return; |
|
| 3044 | + } |
|
| 2931 | 3045 | |
| 2932 | 3046 | echo ' |
| 2933 | 3047 | <div class="smalltext">', sprintf($txt['avatar_max_size_' . $suffix], $w, $h), '</div>'; |
@@ -2949,9 +3063,10 @@ discard block |
||
| 2949 | 3063 | <dd> |
| 2950 | 3064 | <select name="easyformat" id="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;" style="margin-bottom: 4px;">'; |
| 2951 | 3065 | // Help the user by showing a list of common time formats. |
| 2952 | - foreach ($context['easy_timeformats'] as $time_format) |
|
| 2953 | - echo ' |
|
| 3066 | + foreach ($context['easy_timeformats'] as $time_format) { |
|
| 3067 | + echo ' |
|
| 2954 | 3068 | <option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected' : '', '>', $time_format['title'], '</option>'; |
| 3069 | + } |
|
| 2955 | 3070 | echo ' |
| 2956 | 3071 | </select><br> |
| 2957 | 3072 | <input type="text" name="time_format" id="time_format" value="', $context['member']['time_format'], '" size="30"> |
@@ -2987,9 +3102,10 @@ discard block |
||
| 2987 | 3102 | </dt> |
| 2988 | 3103 | <dd> |
| 2989 | 3104 | <select name="smiley_set" id="smiley_set" onchange="document.getElementById(\'smileypr\').src = this.selectedIndex == 0 ? \'', $settings['images_url'], '/blank.png\' : \'', $modSettings['smileys_url'], '/\' + (this.selectedIndex != 1 ? this.options[this.selectedIndex].value : \'', !empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'], '\') + \'/smiley.gif\';">'; |
| 2990 | - foreach ($context['smiley_sets'] as $set) |
|
| 2991 | - echo ' |
|
| 3105 | + foreach ($context['smiley_sets'] as $set) { |
|
| 3106 | + echo ' |
|
| 2992 | 3107 | <option value="', $set['id'], '"', $set['selected'] ? ' selected' : '', '>', $set['name'], '</option>'; |
| 3108 | + } |
|
| 2993 | 3109 | echo ' |
| 2994 | 3110 | </select> <img id="smileypr" class="centericon" src="', $context['member']['smiley_set']['id'] != 'none' ? $modSettings['smileys_url'] . '/' . ($context['member']['smiley_set']['id'] != '' ? $context['member']['smiley_set']['id'] : (!empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'])) . '/smiley.gif' : $settings['images_url'] . '/blank.png', '" alt=":)" style="padding-left: 20px;"> |
| 2995 | 3111 | </dd>'; |
@@ -3040,10 +3156,11 @@ discard block |
||
| 3040 | 3156 | </div> |
| 3041 | 3157 | <div class="clear"></div>'; |
| 3042 | 3158 | |
| 3043 | - if (!empty($context['from_ajax'])) |
|
| 3044 | - echo ' |
|
| 3159 | + if (!empty($context['from_ajax'])) { |
|
| 3160 | + echo ' |
|
| 3045 | 3161 | <br> |
| 3046 | 3162 | <a href="javascript:self.close();"></a>'; |
| 3163 | + } |
|
| 3047 | 3164 | |
| 3048 | 3165 | echo ' |
| 3049 | 3166 | </div> |
@@ -3082,15 +3199,16 @@ discard block |
||
| 3082 | 3199 | <br><div class="smalltext">', $txt['tfa_profile_desc'], '</div> |
| 3083 | 3200 | </dt> |
| 3084 | 3201 | <dd>'; |
| 3085 | - if (!$context['tfa_enabled'] && $context['user']['is_owner']) |
|
| 3086 | - echo ' |
|
| 3202 | + if (!$context['tfa_enabled'] && $context['user']['is_owner']) { |
|
| 3203 | + echo ' |
|
| 3087 | 3204 | <a href="', !empty($modSettings['force_ssl']) && $modSettings['force_ssl'] < 2 ? strtr($scripturl, array('http://' => 'https://')) : $scripturl, '?action=profile;area=tfasetup" id="enable_tfa">', $txt['tfa_profile_enable'], '</a>'; |
| 3088 | - elseif (!$context['tfa_enabled']) |
|
| 3089 | - echo ' |
|
| 3205 | + } elseif (!$context['tfa_enabled']) { |
|
| 3206 | + echo ' |
|
| 3090 | 3207 | ', $txt['tfa_profile_disabled']; |
| 3091 | - else |
|
| 3092 | - echo ' |
|
| 3208 | + } else { |
|
| 3209 | + echo ' |
|
| 3093 | 3210 | ', sprintf($txt['tfa_profile_enabled'], $scripturl . '?action=profile;u=' . $context['id_member'] . ';area=tfasetup;disable'); |
| 3211 | + } |
|
| 3094 | 3212 | echo ' |
| 3095 | 3213 | </dd>'; |
| 3096 | 3214 | } |