@@ -185,17 +185,21 @@ discard block |
||
| 185 | 185 | $tasksdir = $sourcedir . '/tasks'; |
| 186 | 186 | |
| 187 | 187 | # Make sure the paths are correct... at least try to fix them. |
| 188 | -if (!file_exists($boarddir) && file_exists(dirname(__FILE__) . '/agreement.txt')) |
|
| 188 | +if (!file_exists($boarddir) && file_exists(dirname(__FILE__) . '/agreement.txt')) { |
|
| 189 | 189 | $boarddir = dirname(__FILE__); |
| 190 | -if (!file_exists($sourcedir) && file_exists($boarddir . '/Sources')) |
|
| 190 | +} |
|
| 191 | +if (!file_exists($sourcedir) && file_exists($boarddir . '/Sources')) { |
|
| 191 | 192 | $sourcedir = $boarddir . '/Sources'; |
| 192 | -if (!file_exists($cachedir) && file_exists($boarddir . '/cache')) |
|
| 193 | +} |
|
| 194 | +if (!file_exists($cachedir) && file_exists($boarddir . '/cache')) { |
|
| 193 | 195 | $cachedir = $boarddir . '/cache'; |
| 196 | +} |
|
| 194 | 197 | |
| 195 | 198 | ########## Error-Catching ########## |
| 196 | 199 | # Note: You shouldn't touch these settings. |
| 197 | -if (file_exists((isset($cachedir) ? $cachedir : dirname(__FILE__)) . '/db_last_error.php')) |
|
| 200 | +if (file_exists((isset($cachedir) ? $cachedir : dirname(__FILE__)) . '/db_last_error.php')) { |
|
| 198 | 201 | include((isset($cachedir) ? $cachedir : dirname(__FILE__)) . '/db_last_error.php'); |
| 202 | +} |
|
| 199 | 203 | |
| 200 | 204 | if (!isset($db_last_error)) |
| 201 | 205 | { |
@@ -207,10 +211,11 @@ discard block |
||
| 207 | 211 | if (file_exists(dirname(__FILE__) . '/install.php')) |
| 208 | 212 | { |
| 209 | 213 | $secure = false; |
| 210 | - if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') |
|
| 211 | - $secure = true; |
|
| 212 | - elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') |
|
| 213 | - $secure = true; |
|
| 214 | + if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { |
|
| 215 | + $secure = true; |
|
| 216 | + } elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') { |
|
| 217 | + $secure = true; |
|
| 218 | + } |
|
| 214 | 219 | |
| 215 | 220 | header('location: http' . ($secure ? 's' : '') . '://' . (empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] . (empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT']) : $_SERVER['HTTP_HOST']) . (strtr(dirname($_SERVER['PHP_SELF']), '\\', '/') == '/' ? '' : strtr(dirname($_SERVER['PHP_SELF']), '\\', '/')) . '/install.php'); exit; |
| 216 | 221 | } |
@@ -12,7 +12,8 @@ |
||
| 12 | 12 | header('location: ' . $boardurl); |
| 13 | 13 | } |
| 14 | 14 | // Can't find it... just forget it. |
| 15 | -else |
|
| 15 | +else { |
|
| 16 | 16 | exit; |
| 17 | +} |
|
| 17 | 18 | |
| 18 | 19 | ?> |
| 19 | 20 | \ No newline at end of file |
@@ -12,7 +12,8 @@ |
||
| 12 | 12 | header('location: ' . $boardurl); |
| 13 | 13 | } |
| 14 | 14 | // Can't find it... just forget it. |
| 15 | -else |
|
| 15 | +else { |
|
| 16 | 16 | exit; |
| 17 | +} |
|
| 17 | 18 | |
| 18 | 19 | ?> |
| 19 | 20 | \ No newline at end of file |
@@ -12,7 +12,8 @@ |
||
| 12 | 12 | header('location: ' . $boardurl); |
| 13 | 13 | } |
| 14 | 14 | // Can't find it... just forget it. |
| 15 | -else |
|
| 15 | +else { |
|
| 16 | 16 | exit; |
| 17 | +} |
|
| 17 | 18 | |
| 18 | 19 | ?> |
| 19 | 20 | \ No newline at end of file |
@@ -12,7 +12,8 @@ |
||
| 12 | 12 | header('location: ' . $boardurl); |
| 13 | 13 | } |
| 14 | 14 | // Can't find it... just forget it. |
| 15 | -else |
|
| 15 | +else { |
|
| 16 | 16 | exit; |
| 17 | +} |
|
| 17 | 18 | |
| 18 | 19 | ?> |
| 19 | 20 | \ No newline at end of file |
@@ -12,7 +12,8 @@ |
||
| 12 | 12 | header('location: ' . $boardurl); |
| 13 | 13 | } |
| 14 | 14 | // Can't find it... just forget it. |
| 15 | -else |
|
| 15 | +else { |
|
| 16 | 16 | exit; |
| 17 | +} |
|
| 17 | 18 | |
| 18 | 19 | ?> |
| 19 | 20 | \ No newline at end of file |
@@ -12,7 +12,8 @@ |
||
| 12 | 12 | header('location: ' . $boardurl); |
| 13 | 13 | } |
| 14 | 14 | // Can't find it... just forget it. |
| 15 | -else |
|
| 15 | +else { |
|
| 16 | 16 | exit; |
| 17 | +} |
|
| 17 | 18 | |
| 18 | 19 | ?> |
| 19 | 20 | \ No newline at end of file |
@@ -12,7 +12,8 @@ |
||
| 12 | 12 | header('location: ' . $boardurl); |
| 13 | 13 | } |
| 14 | 14 | // Can't find it... just forget it. |
| 15 | -else |
|
| 15 | +else { |
|
| 16 | 16 | exit; |
| 17 | +} |
|
| 17 | 18 | |
| 18 | 19 | ?> |
| 19 | 20 | \ No newline at end of file |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | |
| 232 | 232 | foreach ($message['custom_fields']['above_member'] as $custom) |
| 233 | 233 | echo ' |
| 234 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 234 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 235 | 235 | |
| 236 | 236 | echo ' |
| 237 | 237 | </ul> |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | if (!empty($message['custom_fields']['below_avatar'])) |
| 281 | 281 | foreach ($message['custom_fields']['below_avatar'] as $custom) |
| 282 | 282 | echo ' |
| 283 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 283 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 284 | 284 | |
| 285 | 285 | if (!$message['member']['is_guest']) |
| 286 | 286 | echo ' |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | |
| 323 | 323 | foreach ($message['custom_fields']['icons'] as $custom) |
| 324 | 324 | echo ' |
| 325 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 325 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 326 | 326 | |
| 327 | 327 | echo ' |
| 328 | 328 | </ol> |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | if (!empty($message['custom_fields']['standard'])) |
| 387 | 387 | foreach ($message['custom_fields']['standard'] as $custom) |
| 388 | 388 | echo ' |
| 389 | - <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
| 389 | + <li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
| 390 | 390 | |
| 391 | 391 | // Are we showing the warning status? |
| 392 | 392 | if ($message['member']['can_see_warning']) |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | if (!empty($message['custom_fields']['bottom_poster'])) |
| 398 | 398 | foreach ($message['custom_fields']['bottom_poster'] as $custom) |
| 399 | 399 | echo ' |
| 400 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 400 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | // Done with the information about the poster... on to the post itself. |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | |
| 499 | 499 | foreach ($message['custom_fields']['above_signature'] as $custom) |
| 500 | 500 | echo ' |
| 501 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 501 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 502 | 502 | |
| 503 | 503 | echo ' |
| 504 | 504 | </ul> |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | |
| 522 | 522 | foreach ($message['custom_fields']['below_signature'] as $custom) |
| 523 | 523 | echo ' |
| 524 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 524 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 525 | 525 | |
| 526 | 526 | echo ' |
| 527 | 527 | </ul> |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | while ($message = $context['get_pmessage']('subject')) |
| 658 | 658 | { |
| 659 | 659 | echo ' |
| 660 | - <tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','"> |
|
| 660 | + <tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '"> |
|
| 661 | 661 | <td class="table_icon"> |
| 662 | 662 | <script> |
| 663 | 663 | currentLabels[', $message['id'], '] = {'; |
@@ -946,13 +946,13 @@ discard block |
||
| 946 | 946 | // You can only reply if they are not a guest... |
| 947 | 947 | if (!$message['member']['is_guest']) |
| 948 | 948 | echo ' |
| 949 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], ' |
|
| 950 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator']; |
|
| 949 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button, '</a>', $context['menu_separator'], ' |
|
| 950 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button, '</a> ', $context['menu_separator']; |
|
| 951 | 951 | |
| 952 | 952 | // This is for "forwarding" - even if the member is gone. |
| 953 | 953 | else |
| 954 | 954 | echo ' |
| 955 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator']; |
|
| 955 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button, '</a>', $context['menu_separator']; |
|
| 956 | 956 | } |
| 957 | 957 | |
| 958 | 958 | echo ' |
@@ -1054,7 +1054,7 @@ discard block |
||
| 1054 | 1054 | <div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors"> |
| 1055 | 1055 | <dl> |
| 1056 | 1056 | <dt> |
| 1057 | - <strong id="error_serious">', $txt['error_while_submitting'] , '</strong> |
|
| 1057 | + <strong id="error_serious">', $txt['error_while_submitting'], '</strong> |
|
| 1058 | 1058 | </dt> |
| 1059 | 1059 | <dd class="error" id="error_list"> |
| 1060 | 1060 | ', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), ' |
@@ -1110,7 +1110,7 @@ discard block |
||
| 1110 | 1110 | <span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span> |
| 1111 | 1111 | </dt> |
| 1112 | 1112 | <dd id="pm_subject"> |
| 1113 | - <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : '', '> |
|
| 1113 | + <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '> |
|
| 1114 | 1114 | </dd> |
| 1115 | 1115 | </dl>'; |
| 1116 | 1116 | |
@@ -1463,7 +1463,7 @@ discard block |
||
| 1463 | 1463 | echo ' |
| 1464 | 1464 | <div class="padding"> |
| 1465 | 1465 | <input type="submit" name="save" value="', $txt['save'], '" class="button"> |
| 1466 | - <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure"> |
|
| 1466 | + <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button you_sure"> |
|
| 1467 | 1467 | </div>'; |
| 1468 | 1468 | |
| 1469 | 1469 | echo ' |
@@ -1628,7 +1628,7 @@ discard block |
||
| 1628 | 1628 | if (!empty($context['rules'])) |
| 1629 | 1629 | echo ' |
| 1630 | 1630 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1631 | - <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">'; |
|
| 1631 | + <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button smalltext you_sure">'; |
|
| 1632 | 1632 | |
| 1633 | 1633 | echo ' |
| 1634 | 1634 | </div> |
@@ -1871,9 +1871,9 @@ discard block |
||
| 1871 | 1871 | |
| 1872 | 1872 | echo ' |
| 1873 | 1873 | <select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();"> |
| 1874 | - <option value="">', $txt['pm_rule_sel_action'] , ':</option> |
|
| 1875 | - <option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option> |
|
| 1876 | - <option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option> |
|
| 1874 | + <option value="">', $txt['pm_rule_sel_action'], ':</option> |
|
| 1875 | + <option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option> |
|
| 1876 | + <option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option> |
|
| 1877 | 1877 | </select> |
| 1878 | 1878 | <span id="labdiv', $k, '"> |
| 1879 | 1879 | <select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();"> |
@@ -1985,7 +1985,7 @@ discard block |
||
| 1985 | 1985 | </div> |
| 1986 | 1986 | <ul class="quickbuttons"> |
| 1987 | 1987 | <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;id_draft=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons modifybutton"></span>', $txt['draft_edit'], '</a></li> |
| 1988 | - <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'] ,'?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li> |
|
| 1988 | + <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'], '?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li> |
|
| 1989 | 1989 | </ul> |
| 1990 | 1990 | </div><!-- .windowbg -->'; |
| 1991 | 1991 | } |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | <div id="personal_messages">'; |
| 22 | 22 | |
| 23 | 23 | // Show the capacity bar, if available. |
| 24 | - if (!empty($context['limit_bar'])) |
|
| 25 | - echo ' |
|
| 24 | + if (!empty($context['limit_bar'])) { |
|
| 25 | + echo ' |
|
| 26 | 26 | <div class="cat_bar"> |
| 27 | 27 | <h3 class="catbg"> |
| 28 | 28 | <span class="floatleft">', $txt['pm_capacity'], ':</span> |
@@ -32,14 +32,16 @@ discard block |
||
| 32 | 32 | <span class="floatright', $context['limit_bar']['percent'] > 90 ? ' alert' : '', '">', $context['limit_bar']['text'], '</span> |
| 33 | 33 | </h3> |
| 34 | 34 | </div>'; |
| 35 | + } |
|
| 35 | 36 | |
| 36 | 37 | // Message sent? Show a small indication. |
| 37 | - if (isset($context['pm_sent'])) |
|
| 38 | - echo ' |
|
| 38 | + if (isset($context['pm_sent'])) { |
|
| 39 | + echo ' |
|
| 39 | 40 | <div class="infobox"> |
| 40 | 41 | ', $txt['pm_sent'], ' |
| 41 | 42 | </div>'; |
| 42 | -} |
|
| 43 | + } |
|
| 44 | + } |
|
| 43 | 45 | |
| 44 | 46 | /** |
| 45 | 47 | * Just the end of the index bar, nothing special. |
@@ -68,13 +70,13 @@ discard block |
||
| 68 | 70 | </div> |
| 69 | 71 | <div class="pm_unread">'; |
| 70 | 72 | |
| 71 | - if (empty($context['unread_pms'])) |
|
| 72 | - echo ' |
|
| 73 | + if (empty($context['unread_pms'])) { |
|
| 74 | + echo ' |
|
| 73 | 75 | <div class="no_unread">', $txt['pm_no_unread'], '</div>'; |
| 74 | - else |
|
| 76 | + } else |
|
| 75 | 77 | { |
| 76 | - foreach ($context['unread_pms'] as $id_pm => $pm_details) |
|
| 77 | - echo ' |
|
| 78 | + foreach ($context['unread_pms'] as $id_pm => $pm_details) { |
|
| 79 | + echo ' |
|
| 78 | 80 | <div class="unread"> |
| 79 | 81 | ', !empty($pm_details['member']) ? $pm_details['member']['avatar']['image'] : '', ' |
| 80 | 82 | <div class="details"> |
@@ -85,6 +87,7 @@ discard block |
||
| 85 | 87 | </div> |
| 86 | 88 | </div> |
| 87 | 89 | </div>'; |
| 90 | + } |
|
| 88 | 91 | } |
| 89 | 92 | |
| 90 | 93 | echo ' |
@@ -193,14 +196,15 @@ discard block |
||
| 193 | 196 | if ($context['get_pmessage']('message', true)) |
| 194 | 197 | { |
| 195 | 198 | // Show the helpful titlebar - generally. |
| 196 | - if ($context['display_mode'] != 1) |
|
| 197 | - echo ' |
|
| 199 | + if ($context['display_mode'] != 1) { |
|
| 200 | + echo ' |
|
| 198 | 201 | <div class="cat_bar"> |
| 199 | 202 | <h3 class="catbg"> |
| 200 | 203 | <span id="author">', $txt['author'], '</span> |
| 201 | 204 | <span id="topic_title">', $txt[$context['display_mode'] == 0 ? 'messages' : 'conversation'], '</span> |
| 202 | 205 | </h3> |
| 203 | 206 | </div>'; |
| 207 | + } |
|
| 204 | 208 | |
| 205 | 209 | // Show a few buttons if we are in conversation mode and outputting the first message. |
| 206 | 210 | if ($context['display_mode'] == 2) |
@@ -228,9 +232,10 @@ discard block |
||
| 228 | 232 | <div class="custom_fields_above_member"> |
| 229 | 233 | <ul class="nolist">'; |
| 230 | 234 | |
| 231 | - foreach ($message['custom_fields']['above_member'] as $custom) |
|
| 232 | - echo ' |
|
| 235 | + foreach ($message['custom_fields']['above_member'] as $custom) { |
|
| 236 | + echo ' |
|
| 233 | 237 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 238 | + } |
|
| 234 | 239 | |
| 235 | 240 | echo ' |
| 236 | 241 | </ul> |
@@ -242,25 +247,28 @@ discard block |
||
| 242 | 247 | <a id="msg', $message['id'], '"></a>'; |
| 243 | 248 | |
| 244 | 249 | // Show online and offline buttons? |
| 245 | - if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) |
|
| 246 | - echo ' |
|
| 250 | + if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) { |
|
| 251 | + echo ' |
|
| 247 | 252 | <span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>'; |
| 253 | + } |
|
| 248 | 254 | |
| 249 | 255 | // Custom fields BEFORE the username? |
| 250 | - if (!empty($message['custom_fields']['before_member'])) |
|
| 251 | - foreach ($message['custom_fields']['before_member'] as $custom) |
|
| 256 | + if (!empty($message['custom_fields']['before_member'])) { |
|
| 257 | + foreach ($message['custom_fields']['before_member'] as $custom) |
|
| 252 | 258 | echo ' |
| 253 | 259 | <span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>'; |
| 260 | + } |
|
| 254 | 261 | |
| 255 | 262 | // Show a link to the member's profile. |
| 256 | 263 | echo ' |
| 257 | 264 | ', $message['member']['link']; |
| 258 | 265 | |
| 259 | 266 | // Custom fields AFTER the username? |
| 260 | - if (!empty($message['custom_fields']['after_member'])) |
|
| 261 | - foreach ($message['custom_fields']['after_member'] as $custom) |
|
| 267 | + if (!empty($message['custom_fields']['after_member'])) { |
|
| 268 | + foreach ($message['custom_fields']['after_member'] as $custom) |
|
| 262 | 269 | echo ' |
| 263 | 270 | <span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>'; |
| 271 | + } |
|
| 264 | 272 | |
| 265 | 273 | echo ' |
| 266 | 274 | </h4>'; |
@@ -269,48 +277,56 @@ discard block |
||
| 269 | 277 | <ul class="user_info">'; |
| 270 | 278 | |
| 271 | 279 | // Show the user's avatar. |
| 272 | - if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) |
|
| 273 | - echo ' |
|
| 280 | + if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { |
|
| 281 | + echo ' |
|
| 274 | 282 | <li class="avatar"> |
| 275 | 283 | <a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">', $message['member']['avatar']['image'], '</a> |
| 276 | 284 | </li>'; |
| 285 | + } |
|
| 277 | 286 | |
| 278 | 287 | // Are there any custom fields below the avatar? |
| 279 | - if (!empty($message['custom_fields']['below_avatar'])) |
|
| 280 | - foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
| 288 | + if (!empty($message['custom_fields']['below_avatar'])) { |
|
| 289 | + foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
| 281 | 290 | echo ' |
| 282 | 291 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 292 | + } |
|
| 283 | 293 | |
| 284 | - if (!$message['member']['is_guest']) |
|
| 285 | - echo ' |
|
| 294 | + if (!$message['member']['is_guest']) { |
|
| 295 | + echo ' |
|
| 286 | 296 | <li class="icons">', $message['member']['group_icons'], '</li>'; |
| 297 | + } |
|
| 287 | 298 | // Show the member's primary group (like 'Administrator') if they have one. |
| 288 | - if (isset($message['member']['group']) && $message['member']['group'] != '') |
|
| 289 | - echo ' |
|
| 299 | + if (isset($message['member']['group']) && $message['member']['group'] != '') { |
|
| 300 | + echo ' |
|
| 290 | 301 | <li class="membergroup">', $message['member']['group'], '</li>'; |
| 302 | + } |
|
| 291 | 303 | |
| 292 | 304 | // Show the member's custom title, if they have one. |
| 293 | - if (isset($message['member']['title']) && $message['member']['title'] != '') |
|
| 294 | - echo ' |
|
| 305 | + if (isset($message['member']['title']) && $message['member']['title'] != '') { |
|
| 306 | + echo ' |
|
| 295 | 307 | <li class="title">', $message['member']['title'], '</li>'; |
| 308 | + } |
|
| 296 | 309 | |
| 297 | 310 | // Don't show these things for guests. |
| 298 | 311 | if (!$message['member']['is_guest']) |
| 299 | 312 | { |
| 300 | 313 | // Show the post group if and only if they have no other group or the option is on, and they are in a post group. |
| 301 | - if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') |
|
| 302 | - echo ' |
|
| 314 | + if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') { |
|
| 315 | + echo ' |
|
| 303 | 316 | <li class="postgroup">', $message['member']['post_group'], '</li>'; |
| 317 | + } |
|
| 304 | 318 | |
| 305 | 319 | // Show how many posts they have made. |
| 306 | - if (!isset($context['disabled_fields']['posts'])) |
|
| 307 | - echo ' |
|
| 320 | + if (!isset($context['disabled_fields']['posts'])) { |
|
| 321 | + echo ' |
|
| 308 | 322 | <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; |
| 323 | + } |
|
| 309 | 324 | |
| 310 | 325 | // Show their personal text? |
| 311 | - if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') |
|
| 312 | - echo ' |
|
| 326 | + if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') { |
|
| 327 | + echo ' |
|
| 313 | 328 | <li class="blurb">', $message['member']['blurb'], '</li>'; |
| 329 | + } |
|
| 314 | 330 | |
| 315 | 331 | // Any custom fields to show as icons? |
| 316 | 332 | if (!empty($message['custom_fields']['icons'])) |
@@ -319,9 +335,10 @@ discard block |
||
| 319 | 335 | <li class="im_icons"> |
| 320 | 336 | <ol>'; |
| 321 | 337 | |
| 322 | - foreach ($message['custom_fields']['icons'] as $custom) |
|
| 323 | - echo ' |
|
| 338 | + foreach ($message['custom_fields']['icons'] as $custom) { |
|
| 339 | + echo ' |
|
| 324 | 340 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 341 | + } |
|
| 325 | 342 | |
| 326 | 343 | echo ' |
| 327 | 344 | </ol> |
@@ -329,25 +346,28 @@ discard block |
||
| 329 | 346 | } |
| 330 | 347 | |
| 331 | 348 | // Show the IP to this user for this post - because you can moderate? |
| 332 | - if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) |
|
| 333 | - echo ' |
|
| 349 | + if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { |
|
| 350 | + echo ' |
|
| 334 | 351 | <li class="poster_ip"> |
| 335 | 352 | <a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a> |
| 336 | 353 | </li>'; |
| 354 | + } |
|
| 337 | 355 | |
| 338 | 356 | // Or, should we show it because this is you? |
| 339 | - elseif ($message['can_see_ip']) |
|
| 340 | - echo ' |
|
| 357 | + elseif ($message['can_see_ip']) { |
|
| 358 | + echo ' |
|
| 341 | 359 | <li class="poster_ip"> |
| 342 | 360 | <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a> |
| 343 | 361 | </li>'; |
| 362 | + } |
|
| 344 | 363 | |
| 345 | 364 | // Okay, you are logged in, then we can show something about why IPs are logged... |
| 346 | - else |
|
| 347 | - echo ' |
|
| 365 | + else { |
|
| 366 | + echo ' |
|
| 348 | 367 | <li class="poster_ip"> |
| 349 | 368 | <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a> |
| 350 | 369 | </li>'; |
| 370 | + } |
|
| 351 | 371 | |
| 352 | 372 | // Show the profile, website, email address, and personal message buttons. |
| 353 | 373 | if ($message['member']['show_profile_buttons']) |
@@ -357,24 +377,28 @@ discard block |
||
| 357 | 377 | <ol class="profile_icons">'; |
| 358 | 378 | |
| 359 | 379 | // Show the profile button |
| 360 | - if ($message['member']['can_view_profile']) |
|
| 361 | - echo ' |
|
| 380 | + if ($message['member']['can_view_profile']) { |
|
| 381 | + echo ' |
|
| 362 | 382 | <li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '">' : $txt['view_profile']), '</a></li>'; |
| 383 | + } |
|
| 363 | 384 | |
| 364 | 385 | // Don't show an icon if they haven't specified a website. |
| 365 | - if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) |
|
| 366 | - echo ' |
|
| 386 | + if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) { |
|
| 387 | + echo ' |
|
| 367 | 388 | <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" rel="noopener">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
| 389 | + } |
|
| 368 | 390 | |
| 369 | 391 | // Don't show the email address if they want it hidden. |
| 370 | - if ($message['member']['show_email']) |
|
| 371 | - echo ' |
|
| 392 | + if ($message['member']['show_email']) { |
|
| 393 | + echo ' |
|
| 372 | 394 | <li><a href="mailto:', $message['member']['email'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
| 395 | + } |
|
| 373 | 396 | |
| 374 | 397 | // Since we know this person isn't a guest, you *can* message them. |
| 375 | - if ($context['can_send_pm']) |
|
| 376 | - echo ' |
|
| 398 | + if ($context['can_send_pm']) { |
|
| 399 | + echo ' |
|
| 377 | 400 | <li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<span class="generic_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span> ' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>'; |
| 401 | + } |
|
| 378 | 402 | |
| 379 | 403 | echo ' |
| 380 | 404 | </ol> |
@@ -382,21 +406,24 @@ discard block |
||
| 382 | 406 | } |
| 383 | 407 | |
| 384 | 408 | // Any custom fields for standard placement? |
| 385 | - if (!empty($message['custom_fields']['standard'])) |
|
| 386 | - foreach ($message['custom_fields']['standard'] as $custom) |
|
| 409 | + if (!empty($message['custom_fields']['standard'])) { |
|
| 410 | + foreach ($message['custom_fields']['standard'] as $custom) |
|
| 387 | 411 | echo ' |
| 388 | 412 | <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
| 413 | + } |
|
| 389 | 414 | |
| 390 | 415 | // Are we showing the warning status? |
| 391 | - if ($message['member']['can_see_warning']) |
|
| 392 | - echo ' |
|
| 416 | + if ($message['member']['can_see_warning']) { |
|
| 417 | + echo ' |
|
| 393 | 418 | <li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<span class="generic_icons warning_', $message['member']['warning_status'], '"></span>', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>'; |
| 419 | + } |
|
| 394 | 420 | |
| 395 | 421 | // Are there any custom fields to show at the bottom of the poster info? |
| 396 | - if (!empty($message['custom_fields']['bottom_poster'])) |
|
| 397 | - foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
| 422 | + if (!empty($message['custom_fields']['bottom_poster'])) { |
|
| 423 | + foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
| 398 | 424 | echo ' |
| 399 | 425 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 426 | + } |
|
| 400 | 427 | } |
| 401 | 428 | |
| 402 | 429 | // Done with the information about the poster... on to the post itself. |
@@ -415,25 +442,29 @@ discard block |
||
| 415 | 442 | <span class="smalltext">« <strong> ', $txt['sent_to'], ':</strong> '; |
| 416 | 443 | |
| 417 | 444 | // People it was sent directly to.... |
| 418 | - if (!empty($message['recipients']['to'])) |
|
| 419 | - echo implode(', ', $message['recipients']['to']); |
|
| 445 | + if (!empty($message['recipients']['to'])) { |
|
| 446 | + echo implode(', ', $message['recipients']['to']); |
|
| 447 | + } |
|
| 420 | 448 | |
| 421 | 449 | // Otherwise, we're just going to say "some people"... |
| 422 | - elseif ($context['folder'] != 'sent') |
|
| 423 | - echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 450 | + elseif ($context['folder'] != 'sent') { |
|
| 451 | + echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 452 | + } |
|
| 424 | 453 | |
| 425 | 454 | echo ' |
| 426 | 455 | <strong> ', $txt['on'], ':</strong> ', $message['time'], ' » |
| 427 | 456 | </span>'; |
| 428 | 457 | |
| 429 | 458 | // If we're in the sent items, show who it was sent to besides the "To:" people. |
| 430 | - if (!empty($message['recipients']['bcc'])) |
|
| 431 | - echo '<br> |
|
| 459 | + if (!empty($message['recipients']['bcc'])) { |
|
| 460 | + echo '<br> |
|
| 432 | 461 | <span class="smalltext">« <strong> ', $txt['pm_bcc'], ':</strong> ', implode(', ', $message['recipients']['bcc']), ' »</span>'; |
| 462 | + } |
|
| 433 | 463 | |
| 434 | - if (!empty($message['is_replied_to'])) |
|
| 435 | - echo '<br> |
|
| 464 | + if (!empty($message['is_replied_to'])) { |
|
| 465 | + echo '<br> |
|
| 436 | 466 | <span class="smalltext">« ', $context['folder'] == 'sent' ? $txt['pm_sent_is_replied_to'] : $txt['pm_is_replied_to'], ' »</span>'; |
| 467 | + } |
|
| 437 | 468 | |
| 438 | 469 | echo ' |
| 439 | 470 | </div><!-- .keyinfo --> |
@@ -443,13 +474,15 @@ discard block |
||
| 443 | 474 | ', $message['body'], ' |
| 444 | 475 | </div>'; |
| 445 | 476 | |
| 446 | - if ($message['can_report'] || $context['can_send_pm']) |
|
| 447 | - echo ' |
|
| 477 | + if ($message['can_report'] || $context['can_send_pm']) { |
|
| 478 | + echo ' |
|
| 448 | 479 | <div class="under_message">'; |
| 480 | + } |
|
| 449 | 481 | |
| 450 | - if ($message['can_report']) |
|
| 451 | - echo ' |
|
| 482 | + if ($message['can_report']) { |
|
| 483 | + echo ' |
|
| 452 | 484 | <a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '" class="floatright">' . $txt['pm_report_to_admin'] . '</a>'; |
| 485 | + } |
|
| 453 | 486 | |
| 454 | 487 | echo ' |
| 455 | 488 | <ul class="quickbuttons">'; |
@@ -461,32 +494,36 @@ discard block |
||
| 461 | 494 | if (!$message['member']['is_guest']) |
| 462 | 495 | { |
| 463 | 496 | // Is there than more than one recipient you can reply to? |
| 464 | - if ($message['number_recipients'] > 1) |
|
| 465 | - echo ' |
|
| 497 | + if ($message['number_recipients'] > 1) { |
|
| 498 | + echo ' |
|
| 466 | 499 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all"><span class="generic_icons reply_all_button"></span>', $txt['reply_to_all'], '</a></li>'; |
| 500 | + } |
|
| 467 | 501 | |
| 468 | 502 | echo ' |
| 469 | 503 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li> |
| 470 | 504 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
| 471 | 505 | } |
| 472 | 506 | // This is for "forwarding" - even if the member is gone. |
| 473 | - else |
|
| 474 | - echo ' |
|
| 507 | + else { |
|
| 508 | + echo ' |
|
| 475 | 509 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote"><span class="generic_icons quote"></span>', $txt['reply_quote'], '</a></li>'; |
| 510 | + } |
|
| 476 | 511 | } |
| 477 | 512 | echo ' |
| 478 | 513 | <li><a href="', $scripturl, '?action=pm;sa=pmactions;pm_actions%5b', $message['id'], '%5D=delete;f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', addslashes($txt['remove_message_question']), '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['delete'], '</a></li>'; |
| 479 | 514 | |
| 480 | - if (empty($context['display_mode'])) |
|
| 481 | - echo ' |
|
| 515 | + if (empty($context['display_mode'])) { |
|
| 516 | + echo ' |
|
| 482 | 517 | <li><input type="checkbox" name="pms[]" id="deletedisplay', $message['id'], '" value="', $message['id'], '" onclick="document.getElementById(\'deletelisting', $message['id'], '\').checked = this.checked;"></li>'; |
| 518 | + } |
|
| 483 | 519 | |
| 484 | 520 | echo ' |
| 485 | 521 | </ul>'; |
| 486 | 522 | |
| 487 | - if ($message['can_report'] || $context['can_send_pm']) |
|
| 488 | - echo ' |
|
| 523 | + if ($message['can_report'] || $context['can_send_pm']) { |
|
| 524 | + echo ' |
|
| 489 | 525 | </div><!-- .under_message -->'; |
| 526 | + } |
|
| 490 | 527 | |
| 491 | 528 | // Are there any custom profile fields for above the signature? |
| 492 | 529 | if (!empty($message['custom_fields']['above_signature'])) |
@@ -495,9 +532,10 @@ discard block |
||
| 495 | 532 | <div class="custom_fields_above_signature"> |
| 496 | 533 | <ul class="nolist">'; |
| 497 | 534 | |
| 498 | - foreach ($message['custom_fields']['above_signature'] as $custom) |
|
| 499 | - echo ' |
|
| 535 | + foreach ($message['custom_fields']['above_signature'] as $custom) { |
|
| 536 | + echo ' |
|
| 500 | 537 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 538 | + } |
|
| 501 | 539 | |
| 502 | 540 | echo ' |
| 503 | 541 | </ul> |
@@ -505,11 +543,12 @@ discard block |
||
| 505 | 543 | } |
| 506 | 544 | |
| 507 | 545 | // Show the member's signature? |
| 508 | - if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) |
|
| 509 | - echo ' |
|
| 546 | + if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { |
|
| 547 | + echo ' |
|
| 510 | 548 | <div class="signature"> |
| 511 | 549 | ', $message['member']['signature'], ' |
| 512 | 550 | </div>'; |
| 551 | + } |
|
| 513 | 552 | |
| 514 | 553 | // Are there any custom profile fields for below the signature? |
| 515 | 554 | if (!empty($message['custom_fields']['below_signature'])) |
@@ -518,9 +557,10 @@ discard block |
||
| 518 | 557 | <div class="custom_fields_below_signature"> |
| 519 | 558 | <ul class="nolist">'; |
| 520 | 559 | |
| 521 | - foreach ($message['custom_fields']['below_signature'] as $custom) |
|
| 522 | - echo ' |
|
| 560 | + foreach ($message['custom_fields']['below_signature'] as $custom) { |
|
| 561 | + echo ' |
|
| 523 | 562 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 563 | + } |
|
| 524 | 564 | |
| 525 | 565 | echo ' |
| 526 | 566 | </ul> |
@@ -547,10 +587,11 @@ discard block |
||
| 547 | 587 | echo ' |
| 548 | 588 | <option value="" disabled>', $txt['pm_msg_label_apply'], ':</option>'; |
| 549 | 589 | |
| 550 | - foreach ($context['labels'] as $label) |
|
| 551 | - if (!isset($message['labels'][$label['id']])) |
|
| 590 | + foreach ($context['labels'] as $label) { |
|
| 591 | + if (!isset($message['labels'][$label['id']])) |
|
| 552 | 592 | echo ' |
| 553 | 593 | <option value="', $label['id'], '">', $label['name'], '</option>'; |
| 594 | + } |
|
| 554 | 595 | } |
| 555 | 596 | |
| 556 | 597 | // ... and are there any that can be removed? |
@@ -559,9 +600,10 @@ discard block |
||
| 559 | 600 | echo ' |
| 560 | 601 | <option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>'; |
| 561 | 602 | |
| 562 | - foreach ($message['labels'] as $label) |
|
| 563 | - echo ' |
|
| 603 | + foreach ($message['labels'] as $label) { |
|
| 604 | + echo ' |
|
| 564 | 605 | <option value="', $label['id'], '"> ', $label['name'], '</option>'; |
| 606 | + } |
|
| 565 | 607 | } |
| 566 | 608 | echo ' |
| 567 | 609 | </select> |
@@ -580,14 +622,15 @@ discard block |
||
| 580 | 622 | </div><!-- .windowbg -->'; |
| 581 | 623 | } |
| 582 | 624 | |
| 583 | - if (empty($context['display_mode'])) |
|
| 584 | - echo ' |
|
| 625 | + if (empty($context['display_mode'])) { |
|
| 626 | + echo ' |
|
| 585 | 627 | <div class="pagesection"> |
| 586 | 628 | <div class="floatleft">', $context['page_index'], '</div> |
| 587 | 629 | <div class="floatright"> |
| 588 | 630 | <input type="submit" name="del_selected" value="', $txt['quickmod_delete_selected'], '" onclick="if (!confirm(\'', $txt['delete_selected_confirm'], '\')) return false;" class="button"> |
| 589 | 631 | </div> |
| 590 | 632 | </div>'; |
| 633 | + } |
|
| 591 | 634 | |
| 592 | 635 | // Show a few buttons if we are in conversation mode and outputting the first message. |
| 593 | 636 | elseif ($context['display_mode'] == 2 && isset($context['conversation_buttons'])) |
@@ -647,11 +690,12 @@ discard block |
||
| 647 | 690 | </thead> |
| 648 | 691 | <tbody>'; |
| 649 | 692 | |
| 650 | - if (!$context['show_delete']) |
|
| 651 | - echo ' |
|
| 693 | + if (!$context['show_delete']) { |
|
| 694 | + echo ' |
|
| 652 | 695 | <tr class="windowbg"> |
| 653 | 696 | <td colspan="5">', $txt['pm_alert_none'], '</td> |
| 654 | 697 | </tr>'; |
| 698 | + } |
|
| 655 | 699 | |
| 656 | 700 | while ($message = $context['get_pmessage']('subject')) |
| 657 | 701 | { |
@@ -709,17 +753,19 @@ discard block |
||
| 709 | 753 | |
| 710 | 754 | foreach ($context['labels'] as $label) |
| 711 | 755 | { |
| 712 | - if ($label['id'] != $context['current_label_id']) |
|
| 713 | - echo ' |
|
| 756 | + if ($label['id'] != $context['current_label_id']) { |
|
| 757 | + echo ' |
|
| 714 | 758 | <option value="add_', $label['id'], '"> ', $label['name'], '</option>'; |
| 759 | + } |
|
| 715 | 760 | } |
| 716 | 761 | |
| 717 | 762 | echo ' |
| 718 | 763 | <option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>'; |
| 719 | 764 | |
| 720 | - foreach ($context['labels'] as $label) |
|
| 721 | - echo ' |
|
| 765 | + foreach ($context['labels'] as $label) { |
|
| 766 | + echo ' |
|
| 722 | 767 | <option value="rem_', $label['id'], '"> ', $label['name'], '</option>'; |
| 768 | + } |
|
| 723 | 769 | |
| 724 | 770 | echo ' |
| 725 | 771 | </select> |
@@ -750,11 +796,12 @@ discard block |
||
| 750 | 796 | <h3 class="catbg">', $txt['pm_search_title'], '</h3> |
| 751 | 797 | </div>'; |
| 752 | 798 | |
| 753 | - if (!empty($context['search_errors'])) |
|
| 754 | - echo ' |
|
| 799 | + if (!empty($context['search_errors'])) { |
|
| 800 | + echo ' |
|
| 755 | 801 | <div class="errorbox"> |
| 756 | 802 | ', implode('<br>', $context['search_errors']['messages']), ' |
| 757 | 803 | </div>'; |
| 804 | + } |
|
| 758 | 805 | |
| 759 | 806 | |
| 760 | 807 | echo ' |
@@ -803,9 +850,10 @@ discard block |
||
| 803 | 850 | </dd> |
| 804 | 851 | </dl>'; |
| 805 | 852 | |
| 806 | - if (!$context['currently_using_labels']) |
|
| 807 | - echo ' |
|
| 853 | + if (!$context['currently_using_labels']) { |
|
| 854 | + echo ' |
|
| 808 | 855 | <input type="submit" name="pm_search" value="', $txt['pm_search_go'], '" class="button">'; |
| 856 | + } |
|
| 809 | 857 | |
| 810 | 858 | echo ' |
| 811 | 859 | <br class="clear_right"> |
@@ -826,12 +874,13 @@ discard block |
||
| 826 | 874 | <div id="advanced_panel_div"> |
| 827 | 875 | <ul id="searchLabelsExpand">'; |
| 828 | 876 | |
| 829 | - foreach ($context['search_labels'] as $label) |
|
| 830 | - echo ' |
|
| 877 | + foreach ($context['search_labels'] as $label) { |
|
| 878 | + echo ' |
|
| 831 | 879 | <li> |
| 832 | 880 | <label for="searchlabel_', $label['id'], '"><input type="checkbox" id="searchlabel_', $label['id'], '" name="searchlabel[', $label['id'], ']" value="', $label['id'], '"', $label['checked'] ? ' checked' : '', '> |
| 833 | 881 | ', $label['name'], '</label> |
| 834 | 882 | </li>'; |
| 883 | + } |
|
| 835 | 884 | |
| 836 | 885 | echo ' |
| 837 | 886 | </ul> |
@@ -893,8 +942,8 @@ discard block |
||
| 893 | 942 | </div>'; |
| 894 | 943 | |
| 895 | 944 | // Complete results? |
| 896 | - if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) |
|
| 897 | - echo ' |
|
| 945 | + if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) { |
|
| 946 | + echo ' |
|
| 898 | 947 | <table class="table_grid"> |
| 899 | 948 | <thead> |
| 900 | 949 | <tr class="title_bar"> |
@@ -904,6 +953,7 @@ discard block |
||
| 904 | 953 | </tr> |
| 905 | 954 | </thead> |
| 906 | 955 | <tbody>'; |
| 956 | + } |
|
| 907 | 957 | |
| 908 | 958 | // Print each message out... |
| 909 | 959 | foreach ($context['personal_messages'] as $message) |
@@ -923,12 +973,14 @@ discard block |
||
| 923 | 973 | |
| 924 | 974 | // Show the recipients. |
| 925 | 975 | // @todo This doesn't deal with the sent item searching quite right for bcc. |
| 926 | - if (!empty($message['recipients']['to'])) |
|
| 927 | - echo implode(', ', $message['recipients']['to']); |
|
| 976 | + if (!empty($message['recipients']['to'])) { |
|
| 977 | + echo implode(', ', $message['recipients']['to']); |
|
| 978 | + } |
|
| 928 | 979 | |
| 929 | 980 | // Otherwise, we're just going to say "some people"... |
| 930 | - elseif ($context['folder'] != 'sent') |
|
| 931 | - echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 981 | + elseif ($context['folder'] != 'sent') { |
|
| 982 | + echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 983 | + } |
|
| 932 | 984 | |
| 933 | 985 | echo ' |
| 934 | 986 | </h3> |
@@ -943,15 +995,17 @@ discard block |
||
| 943 | 995 | $reply_button = create_button('im_reply.png', 'reply', 'reply', 'class="centericon"'); |
| 944 | 996 | |
| 945 | 997 | // You can only reply if they are not a guest... |
| 946 | - if (!$message['member']['is_guest']) |
|
| 947 | - echo ' |
|
| 998 | + if (!$message['member']['is_guest']) { |
|
| 999 | + echo ' |
|
| 948 | 1000 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], ' |
| 949 | 1001 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator']; |
| 1002 | + } |
|
| 950 | 1003 | |
| 951 | 1004 | // This is for "forwarding" - even if the member is gone. |
| 952 | - else |
|
| 953 | - echo ' |
|
| 1005 | + else { |
|
| 1006 | + echo ' |
|
| 954 | 1007 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator']; |
| 1008 | + } |
|
| 955 | 1009 | } |
| 956 | 1010 | |
| 957 | 1011 | echo ' |
@@ -960,27 +1014,30 @@ discard block |
||
| 960 | 1014 | } |
| 961 | 1015 | // Otherwise just a simple list! |
| 962 | 1016 | // @todo No context at all of the search? |
| 963 | - else |
|
| 964 | - echo ' |
|
| 1017 | + else { |
|
| 1018 | + echo ' |
|
| 965 | 1019 | <tr class="windowbg"> |
| 966 | 1020 | <td>', $message['time'], '</td> |
| 967 | 1021 | <td>', $message['link'], '</td> |
| 968 | 1022 | <td>', $message['member']['link'], '</td> |
| 969 | 1023 | </tr>'; |
| 1024 | + } |
|
| 970 | 1025 | } |
| 971 | 1026 | |
| 972 | 1027 | // Finish off the page... |
| 973 | - if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) |
|
| 974 | - echo ' |
|
| 1028 | + if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) { |
|
| 1029 | + echo ' |
|
| 975 | 1030 | </tbody> |
| 976 | 1031 | </table>'; |
| 1032 | + } |
|
| 977 | 1033 | |
| 978 | 1034 | // No results? |
| 979 | - if (empty($context['personal_messages'])) |
|
| 980 | - echo ' |
|
| 1035 | + if (empty($context['personal_messages'])) { |
|
| 1036 | + echo ' |
|
| 981 | 1037 | <div class="windowbg"> |
| 982 | 1038 | <p class="centertext">', $txt['pm_search_none_found'], '</p> |
| 983 | 1039 | </div>'; |
| 1040 | + } |
|
| 984 | 1041 | |
| 985 | 1042 | echo ' |
| 986 | 1043 | <div class="pagesection"> |
@@ -1005,15 +1062,17 @@ discard block |
||
| 1005 | 1062 | </div> |
| 1006 | 1063 | <div class="windowbg">'; |
| 1007 | 1064 | |
| 1008 | - if (!empty($context['send_log']['sent'])) |
|
| 1009 | - foreach ($context['send_log']['sent'] as $log_entry) |
|
| 1065 | + if (!empty($context['send_log']['sent'])) { |
|
| 1066 | + foreach ($context['send_log']['sent'] as $log_entry) |
|
| 1010 | 1067 | echo ' |
| 1011 | 1068 | <span class="error">', $log_entry, '</span><br>'; |
| 1069 | + } |
|
| 1012 | 1070 | |
| 1013 | - if (!empty($context['send_log']['failed'])) |
|
| 1014 | - foreach ($context['send_log']['failed'] as $log_entry) |
|
| 1071 | + if (!empty($context['send_log']['failed'])) { |
|
| 1072 | + foreach ($context['send_log']['failed'] as $log_entry) |
|
| 1015 | 1073 | echo ' |
| 1016 | 1074 | <span class="error">', $log_entry, '</span><br>'; |
| 1075 | + } |
|
| 1017 | 1076 | |
| 1018 | 1077 | echo ' |
| 1019 | 1078 | </div> |
@@ -1061,12 +1120,13 @@ discard block |
||
| 1061 | 1120 | </dl> |
| 1062 | 1121 | </div>'; |
| 1063 | 1122 | |
| 1064 | - if (!empty($modSettings['drafts_pm_enabled'])) |
|
| 1065 | - echo ' |
|
| 1123 | + if (!empty($modSettings['drafts_pm_enabled'])) { |
|
| 1124 | + echo ' |
|
| 1066 | 1125 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
| 1067 | 1126 | sprintf($txt['draft_pm_saved'], $scripturl . '?action=pm;sa=showpmdrafts'), ' |
| 1068 | 1127 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
| 1069 | 1128 | </div>'; |
| 1129 | + } |
|
| 1070 | 1130 | |
| 1071 | 1131 | echo ' |
| 1072 | 1132 | <dl id="post_header">'; |
@@ -1132,22 +1192,24 @@ discard block |
||
| 1132 | 1192 | <dt><strong>', $txt['subject'], '</strong></dt> |
| 1133 | 1193 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
| 1134 | 1194 | |
| 1135 | - foreach ($context['drafts'] as $draft) |
|
| 1136 | - echo ' |
|
| 1195 | + foreach ($context['drafts'] as $draft) { |
|
| 1196 | + echo ' |
|
| 1137 | 1197 | <dt>', $draft['link'], '</dt> |
| 1138 | 1198 | <dd>', $draft['poster_time'], '</dd>'; |
| 1199 | + } |
|
| 1139 | 1200 | echo ' |
| 1140 | 1201 | </dl> |
| 1141 | 1202 | </div>'; |
| 1142 | 1203 | } |
| 1143 | 1204 | |
| 1144 | 1205 | // Require an image to be typed to save spamming? |
| 1145 | - if ($context['require_verification']) |
|
| 1146 | - echo ' |
|
| 1206 | + if ($context['require_verification']) { |
|
| 1207 | + echo ' |
|
| 1147 | 1208 | <div class="post_verification"> |
| 1148 | 1209 | <strong>', $txt['pm_visual_verification_label'], ':</strong> |
| 1149 | 1210 | ', template_control_verification($context['visual_verification_id'], 'all'), ' |
| 1150 | 1211 | </div>'; |
| 1212 | + } |
|
| 1151 | 1213 | |
| 1152 | 1214 | // Send, Preview, spellcheck buttons. |
| 1153 | 1215 | echo ' |
@@ -1265,8 +1327,8 @@ discard block |
||
| 1265 | 1327 | }'; |
| 1266 | 1328 | |
| 1267 | 1329 | // Code for showing and hiding drafts |
| 1268 | - if (!empty($context['drafts'])) |
|
| 1269 | - echo ' |
|
| 1330 | + if (!empty($context['drafts'])) { |
|
| 1331 | + echo ' |
|
| 1270 | 1332 | var oSwapDraftOptions = new smc_Toggle({ |
| 1271 | 1333 | bToggleEnabled: true, |
| 1272 | 1334 | bCurrentlyCollapsed: true, |
@@ -1288,13 +1350,14 @@ discard block |
||
| 1288 | 1350 | } |
| 1289 | 1351 | ] |
| 1290 | 1352 | });'; |
| 1353 | + } |
|
| 1291 | 1354 | |
| 1292 | 1355 | echo ' |
| 1293 | 1356 | </script>'; |
| 1294 | 1357 | |
| 1295 | 1358 | // Show the message you're replying to. |
| 1296 | - if ($context['reply']) |
|
| 1297 | - echo ' |
|
| 1359 | + if ($context['reply']) { |
|
| 1360 | + echo ' |
|
| 1298 | 1361 | <br><br> |
| 1299 | 1362 | <div class="cat_bar"> |
| 1300 | 1363 | <h3 class="catbg">', $txt['subject'], ': ', $context['quoted_message']['subject'], '</h3> |
@@ -1308,6 +1371,7 @@ discard block |
||
| 1308 | 1371 | ', $context['quoted_message']['body'], ' |
| 1309 | 1372 | </div> |
| 1310 | 1373 | <br class="clear">'; |
| 1374 | + } |
|
| 1311 | 1375 | |
| 1312 | 1376 | echo ' |
| 1313 | 1377 | <script> |
@@ -1319,23 +1383,25 @@ discard block |
||
| 1319 | 1383 | sToControlId: \'to_control\', |
| 1320 | 1384 | aToRecipients: ['; |
| 1321 | 1385 | |
| 1322 | - foreach ($context['recipients']['to'] as $i => $member) |
|
| 1323 | - echo ' |
|
| 1386 | + foreach ($context['recipients']['to'] as $i => $member) { |
|
| 1387 | + echo ' |
|
| 1324 | 1388 | { |
| 1325 | 1389 | sItemId: ', JavaScriptEscape($member['id']), ', |
| 1326 | 1390 | sItemName: ', JavaScriptEscape($member['name']), ' |
| 1327 | 1391 | }', $i == count($context['recipients']['to']) - 1 ? '' : ','; |
| 1392 | + } |
|
| 1328 | 1393 | |
| 1329 | 1394 | echo ' |
| 1330 | 1395 | ], |
| 1331 | 1396 | aBccRecipients: ['; |
| 1332 | 1397 | |
| 1333 | - foreach ($context['recipients']['bcc'] as $i => $member) |
|
| 1334 | - echo ' |
|
| 1398 | + foreach ($context['recipients']['bcc'] as $i => $member) { |
|
| 1399 | + echo ' |
|
| 1335 | 1400 | { |
| 1336 | 1401 | sItemId: ', JavaScriptEscape($member['id']), ', |
| 1337 | 1402 | sItemName: ', JavaScriptEscape($member['name']), ' |
| 1338 | 1403 | }', $i == count($context['recipients']['bcc']) - 1 ? '' : ','; |
| 1404 | + } |
|
| 1339 | 1405 | |
| 1340 | 1406 | echo ' |
| 1341 | 1407 | ], |
@@ -1424,26 +1490,28 @@ discard block |
||
| 1424 | 1490 | </th> |
| 1425 | 1491 | <th class="centertext table_icon">'; |
| 1426 | 1492 | |
| 1427 | - if (count($context['labels']) > 2) |
|
| 1428 | - echo ' |
|
| 1493 | + if (count($context['labels']) > 2) { |
|
| 1494 | + echo ' |
|
| 1429 | 1495 | <input type="checkbox" onclick="invertAll(this, this.form);">'; |
| 1496 | + } |
|
| 1430 | 1497 | |
| 1431 | 1498 | echo ' |
| 1432 | 1499 | </th> |
| 1433 | 1500 | </tr> |
| 1434 | 1501 | </thead> |
| 1435 | 1502 | <tbody>'; |
| 1436 | - if (count($context['labels']) < 2) |
|
| 1437 | - echo ' |
|
| 1503 | + if (count($context['labels']) < 2) { |
|
| 1504 | + echo ' |
|
| 1438 | 1505 | <tr class="windowbg"> |
| 1439 | 1506 | <td colspan="2">', $txt['pm_labels_no_exist'], '</td> |
| 1440 | 1507 | </tr>'; |
| 1441 | - else |
|
| 1508 | + } else |
|
| 1442 | 1509 | { |
| 1443 | 1510 | foreach ($context['labels'] as $label) |
| 1444 | 1511 | { |
| 1445 | - if ($label['id'] == -1) |
|
| 1446 | - continue; |
|
| 1512 | + if ($label['id'] == -1) { |
|
| 1513 | + continue; |
|
| 1514 | + } |
|
| 1447 | 1515 | |
| 1448 | 1516 | echo ' |
| 1449 | 1517 | <tr class="windowbg"> |
@@ -1458,12 +1526,13 @@ discard block |
||
| 1458 | 1526 | </tbody> |
| 1459 | 1527 | </table>'; |
| 1460 | 1528 | |
| 1461 | - if (!count($context['labels']) < 2) |
|
| 1462 | - echo ' |
|
| 1529 | + if (!count($context['labels']) < 2) { |
|
| 1530 | + echo ' |
|
| 1463 | 1531 | <div class="padding"> |
| 1464 | 1532 | <input type="submit" name="save" value="', $txt['save'], '" class="button"> |
| 1465 | 1533 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure"> |
| 1466 | 1534 | </div>'; |
| 1535 | + } |
|
| 1467 | 1536 | |
| 1468 | 1537 | echo ' |
| 1469 | 1538 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -1520,9 +1589,10 @@ discard block |
||
| 1520 | 1589 | <select name="id_admin"> |
| 1521 | 1590 | <option value="0">', $txt['pm_report_all_admins'], '</option>'; |
| 1522 | 1591 | |
| 1523 | - foreach ($context['admins'] as $id => $name) |
|
| 1524 | - echo ' |
|
| 1592 | + foreach ($context['admins'] as $id => $name) { |
|
| 1593 | + echo ' |
|
| 1525 | 1594 | <option value="', $id, '">', $name, '</option>'; |
| 1595 | + } |
|
| 1526 | 1596 | |
| 1527 | 1597 | echo ' |
| 1528 | 1598 | </select> |
@@ -1585,9 +1655,10 @@ discard block |
||
| 1585 | 1655 | </th> |
| 1586 | 1656 | <th class="centertext table_icon">'; |
| 1587 | 1657 | |
| 1588 | - if (!empty($context['rules'])) |
|
| 1589 | - echo ' |
|
| 1658 | + if (!empty($context['rules'])) { |
|
| 1659 | + echo ' |
|
| 1590 | 1660 | <input type="checkbox" onclick="invertAll(this, this.form);">'; |
| 1661 | + } |
|
| 1591 | 1662 | |
| 1592 | 1663 | echo ' |
| 1593 | 1664 | </th> |
@@ -1595,16 +1666,17 @@ discard block |
||
| 1595 | 1666 | </thead> |
| 1596 | 1667 | <tbody>'; |
| 1597 | 1668 | |
| 1598 | - if (empty($context['rules'])) |
|
| 1599 | - echo ' |
|
| 1669 | + if (empty($context['rules'])) { |
|
| 1670 | + echo ' |
|
| 1600 | 1671 | <tr class="windowbg"> |
| 1601 | 1672 | <td colspan="2"> |
| 1602 | 1673 | ', $txt['pm_rules_none'], ' |
| 1603 | 1674 | </td> |
| 1604 | 1675 | </tr>'; |
| 1676 | + } |
|
| 1605 | 1677 | |
| 1606 | - foreach ($context['rules'] as $rule) |
|
| 1607 | - echo ' |
|
| 1678 | + foreach ($context['rules'] as $rule) { |
|
| 1679 | + echo ' |
|
| 1608 | 1680 | <tr class="windowbg"> |
| 1609 | 1681 | <td> |
| 1610 | 1682 | <a href="', $scripturl, '?action=pm;sa=manrules;add;rid=', $rule['id'], '">', $rule['name'], '</a> |
@@ -1613,6 +1685,7 @@ discard block |
||
| 1613 | 1685 | <input type="checkbox" name="delrule[', $rule['id'], ']"> |
| 1614 | 1686 | </td> |
| 1615 | 1687 | </tr>'; |
| 1688 | + } |
|
| 1616 | 1689 | |
| 1617 | 1690 | echo ' |
| 1618 | 1691 | </tbody> |
@@ -1620,14 +1693,16 @@ discard block |
||
| 1620 | 1693 | <div class="righttext"> |
| 1621 | 1694 | <a class="button" href="', $scripturl, '?action=pm;sa=manrules;add;rid=0">', $txt['pm_add_rule'], '</a>'; |
| 1622 | 1695 | |
| 1623 | - if (!empty($context['rules'])) |
|
| 1624 | - echo ' |
|
| 1696 | + if (!empty($context['rules'])) { |
|
| 1697 | + echo ' |
|
| 1625 | 1698 | [<a href="', $scripturl, '?action=pm;sa=manrules;apply;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['pm_js_apply_rules_confirm'], '\');">', $txt['pm_apply_rules'], '</a>]'; |
| 1699 | + } |
|
| 1626 | 1700 | |
| 1627 | - if (!empty($context['rules'])) |
|
| 1628 | - echo ' |
|
| 1701 | + if (!empty($context['rules'])) { |
|
| 1702 | + echo ' |
|
| 1629 | 1703 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1630 | 1704 | <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">'; |
| 1705 | + } |
|
| 1631 | 1706 | |
| 1632 | 1707 | echo ' |
| 1633 | 1708 | </div> |
@@ -1649,14 +1724,16 @@ discard block |
||
| 1649 | 1724 | var groups = new Array() |
| 1650 | 1725 | var labels = new Array()'; |
| 1651 | 1726 | |
| 1652 | - foreach ($context['groups'] as $id => $title) |
|
| 1653 | - echo ' |
|
| 1727 | + foreach ($context['groups'] as $id => $title) { |
|
| 1728 | + echo ' |
|
| 1654 | 1729 | groups[', $id, '] = "', addslashes($title), '";'; |
| 1730 | + } |
|
| 1655 | 1731 | |
| 1656 | - foreach ($context['labels'] as $label) |
|
| 1657 | - if ($label['id'] != -1) |
|
| 1732 | + foreach ($context['labels'] as $label) { |
|
| 1733 | + if ($label['id'] != -1) |
|
| 1658 | 1734 | echo ' |
| 1659 | 1735 | labels[', ($label['id']), '] = "', addslashes($label['name']), '";'; |
| 1736 | + } |
|
| 1660 | 1737 | |
| 1661 | 1738 | echo ' |
| 1662 | 1739 | function addCriteriaOption() |
@@ -1671,8 +1748,9 @@ discard block |
||
| 1671 | 1748 | |
| 1672 | 1749 | setOuterHTML(document.getElementById("criteriaAddHere"), \'<br><select name="ruletype[\' + criteriaNum + \']" id="ruletype\' + criteriaNum + \'" onchange="updateRuleDef(\' + criteriaNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_criteria_pick']), ':<\' + \'/option><option value="mid">', addslashes($txt['pm_rule_mid']), '<\' + \'/option><option value="gid">', addslashes($txt['pm_rule_gid']), '<\' + \'/option><option value="sub">', addslashes($txt['pm_rule_sub']), '<\' + \'/option><option value="msg">', addslashes($txt['pm_rule_msg']), '<\' + \'/option><option value="bud">', addslashes($txt['pm_rule_bud']), '<\' + \'/option><\' + \'/select> <span id="defdiv\' + criteriaNum + \'" style="display: none;"><input type="text" name="ruledef[\' + criteriaNum + \']" id="ruledef\' + criteriaNum + \'" onkeyup="rebuildRuleDesc();" value=""><\' + \'/span><span id="defseldiv\' + criteriaNum + \'" style="display: none;"><select name="ruledefgroup[\' + criteriaNum + \']" id="ruledefgroup\' + criteriaNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_group']), '<\' + \'/option>'; |
| 1673 | 1750 | |
| 1674 | - foreach ($context['groups'] as $id => $group) |
|
| 1675 | - echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>'; |
|
| 1751 | + foreach ($context['groups'] as $id => $group) { |
|
| 1752 | + echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>'; |
|
| 1753 | + } |
|
| 1676 | 1754 | |
| 1677 | 1755 | echo '<\' + \'/select><\' + \'/span><span id="criteriaAddHere"><\' + \'/span>\'); |
| 1678 | 1756 | } |
@@ -1689,9 +1767,10 @@ discard block |
||
| 1689 | 1767 | |
| 1690 | 1768 | setOuterHTML(document.getElementById("actionAddHere"), \'<br><select name="acttype[\' + actionNum + \']" id="acttype\' + actionNum + \'" onchange="updateActionDef(\' + actionNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_action']), ':<\' + \'/option><option value="lab">', addslashes($txt['pm_rule_label']), '<\' + \'/option><option value="del">', addslashes($txt['pm_rule_delete']), '<\' + \'/option><\' + \'/select> <span id="labdiv\' + actionNum + \'" style="display: none;"><select name="labdef[\' + actionNum + \']" id="labdef\' + actionNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_label']), '<\' + \'/option>'; |
| 1691 | 1769 | |
| 1692 | - foreach ($context['labels'] as $label) |
|
| 1693 | - if ($label['id'] != -1) |
|
| 1770 | + foreach ($context['labels'] as $label) { |
|
| 1771 | + if ($label['id'] != -1) |
|
| 1694 | 1772 | echo '<option value="', ($label['id']), '">', addslashes($label['name']), '<\' + \'/option>'; |
| 1773 | + } |
|
| 1695 | 1774 | |
| 1696 | 1775 | echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\'); |
| 1697 | 1776 | } |
@@ -1805,19 +1884,20 @@ discard block |
||
| 1805 | 1884 | $isFirst = true; |
| 1806 | 1885 | foreach ($context['rule']['criteria'] as $k => $criteria) |
| 1807 | 1886 | { |
| 1808 | - if (!$isFirst && $criteria['t'] == '') |
|
| 1809 | - echo '<div id="removeonjs1">'; |
|
| 1810 | - |
|
| 1811 | - elseif (!$isFirst) |
|
| 1812 | - echo '<br>'; |
|
| 1887 | + if (!$isFirst && $criteria['t'] == '') { |
|
| 1888 | + echo '<div id="removeonjs1">'; |
|
| 1889 | + } elseif (!$isFirst) { |
|
| 1890 | + echo '<br>'; |
|
| 1891 | + } |
|
| 1813 | 1892 | |
| 1814 | 1893 | echo ' |
| 1815 | 1894 | <select name="ruletype[', $k, ']" id="ruletype', $k, '" onchange="updateRuleDef(', $k, '); rebuildRuleDesc();"> |
| 1816 | 1895 | <option value="">', $txt['pm_rule_criteria_pick'], ':</option>'; |
| 1817 | 1896 | |
| 1818 | - foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) |
|
| 1819 | - echo ' |
|
| 1897 | + foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) { |
|
| 1898 | + echo ' |
|
| 1820 | 1899 | <option value="', $cr, '"', $criteria['t'] == $cr ? ' selected' : '', '>', $txt['pm_rule_' . $cr], '</option>'; |
| 1900 | + } |
|
| 1821 | 1901 | |
| 1822 | 1902 | echo ' |
| 1823 | 1903 | </select> |
@@ -1828,19 +1908,20 @@ discard block |
||
| 1828 | 1908 | <select name="ruledefgroup[', $k, ']" id="ruledefgroup', $k, '" onchange="rebuildRuleDesc();"> |
| 1829 | 1909 | <option value="">', $txt['pm_rule_sel_group'], '</option>'; |
| 1830 | 1910 | |
| 1831 | - foreach ($context['groups'] as $id => $group) |
|
| 1832 | - echo ' |
|
| 1911 | + foreach ($context['groups'] as $id => $group) { |
|
| 1912 | + echo ' |
|
| 1833 | 1913 | <option value="', $id, '"', $criteria['t'] == 'gid' && $criteria['v'] == $id ? ' selected' : '', '>', $group, '</option>'; |
| 1914 | + } |
|
| 1834 | 1915 | echo ' |
| 1835 | 1916 | </select> |
| 1836 | 1917 | </span>'; |
| 1837 | 1918 | |
| 1838 | 1919 | // If this is the dummy we add a means to hide for non js users. |
| 1839 | - if ($isFirst) |
|
| 1840 | - $isFirst = false; |
|
| 1841 | - |
|
| 1842 | - elseif ($criteria['t'] == '') |
|
| 1843 | - echo '</div><!-- .removeonjs1 -->'; |
|
| 1920 | + if ($isFirst) { |
|
| 1921 | + $isFirst = false; |
|
| 1922 | + } elseif ($criteria['t'] == '') { |
|
| 1923 | + echo '</div><!-- .removeonjs1 -->'; |
|
| 1924 | + } |
|
| 1844 | 1925 | } |
| 1845 | 1926 | |
| 1846 | 1927 | echo ' |
@@ -1863,10 +1944,11 @@ discard block |
||
| 1863 | 1944 | $isFirst = true; |
| 1864 | 1945 | foreach ($context['rule']['actions'] as $k => $action) |
| 1865 | 1946 | { |
| 1866 | - if (!$isFirst && $action['t'] == '') |
|
| 1867 | - echo '<div id="removeonjs2">'; |
|
| 1868 | - elseif (!$isFirst) |
|
| 1869 | - echo '<br>'; |
|
| 1947 | + if (!$isFirst && $action['t'] == '') { |
|
| 1948 | + echo '<div id="removeonjs2">'; |
|
| 1949 | + } elseif (!$isFirst) { |
|
| 1950 | + echo '<br>'; |
|
| 1951 | + } |
|
| 1870 | 1952 | |
| 1871 | 1953 | echo ' |
| 1872 | 1954 | <select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();"> |
@@ -1878,20 +1960,21 @@ discard block |
||
| 1878 | 1960 | <select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();"> |
| 1879 | 1961 | <option value="">', $txt['pm_rule_sel_label'], '</option>'; |
| 1880 | 1962 | |
| 1881 | - foreach ($context['labels'] as $label) |
|
| 1882 | - if ($label['id'] != -1) |
|
| 1963 | + foreach ($context['labels'] as $label) { |
|
| 1964 | + if ($label['id'] != -1) |
|
| 1883 | 1965 | echo ' |
| 1884 | 1966 | <option value="', ($label['id']), '"', $action['t'] == 'lab' && $action['v'] == $label['id'] ? ' selected' : '', '>', $label['name'], '</option>'; |
| 1967 | + } |
|
| 1885 | 1968 | |
| 1886 | 1969 | echo ' |
| 1887 | 1970 | </select> |
| 1888 | 1971 | </span>'; |
| 1889 | 1972 | |
| 1890 | - if ($isFirst) |
|
| 1891 | - $isFirst = false; |
|
| 1892 | - |
|
| 1893 | - elseif ($action['t'] == '') |
|
| 1894 | - echo '</div><!-- .removeonjs2 -->'; |
|
| 1973 | + if ($isFirst) { |
|
| 1974 | + $isFirst = false; |
|
| 1975 | + } elseif ($action['t'] == '') { |
|
| 1976 | + echo '</div><!-- .removeonjs2 -->'; |
|
| 1977 | + } |
|
| 1895 | 1978 | } |
| 1896 | 1979 | |
| 1897 | 1980 | echo ' |
@@ -1915,22 +1998,25 @@ discard block |
||
| 1915 | 1998 | echo ' |
| 1916 | 1999 | <script>'; |
| 1917 | 2000 | |
| 1918 | - foreach ($context['rule']['criteria'] as $k => $c) |
|
| 1919 | - echo ' |
|
| 2001 | + foreach ($context['rule']['criteria'] as $k => $c) { |
|
| 2002 | + echo ' |
|
| 1920 | 2003 | updateRuleDef(', $k, ');'; |
| 2004 | + } |
|
| 1921 | 2005 | |
| 1922 | - foreach ($context['rule']['actions'] as $k => $c) |
|
| 1923 | - echo ' |
|
| 2006 | + foreach ($context['rule']['actions'] as $k => $c) { |
|
| 2007 | + echo ' |
|
| 1924 | 2008 | updateActionDef(', $k, ');'; |
| 2009 | + } |
|
| 1925 | 2010 | |
| 1926 | 2011 | echo ' |
| 1927 | 2012 | rebuildRuleDesc();'; |
| 1928 | 2013 | |
| 1929 | 2014 | // If this isn't a new rule and we have JS enabled remove the JS compatibility stuff. |
| 1930 | - if ($context['rid']) |
|
| 1931 | - echo ' |
|
| 2015 | + if ($context['rid']) { |
|
| 2016 | + echo ' |
|
| 1932 | 2017 | document.getElementById("removeonjs1").style.display = "none"; |
| 1933 | 2018 | document.getElementById("removeonjs2").style.display = "none";'; |
| 2019 | + } |
|
| 1934 | 2020 | |
| 1935 | 2021 | echo ' |
| 1936 | 2022 | document.getElementById("addonjs1").style.display = ""; |
@@ -1958,12 +2044,12 @@ discard block |
||
| 1958 | 2044 | </div>'; |
| 1959 | 2045 | |
| 1960 | 2046 | // No drafts? Just show an informative message. |
| 1961 | - if (empty($context['drafts'])) |
|
| 1962 | - echo ' |
|
| 2047 | + if (empty($context['drafts'])) { |
|
| 2048 | + echo ' |
|
| 1963 | 2049 | <div class="windowbg centertext"> |
| 1964 | 2050 | ', $txt['draft_none'], ' |
| 1965 | 2051 | </div>'; |
| 1966 | - else |
|
| 2052 | + } else |
|
| 1967 | 2053 | { |
| 1968 | 2054 | // For every draft to be displayed, give it its own div, and show the important details of the draft. |
| 1969 | 2055 | foreach ($context['drafts'] as $draft) |