@@ -116,9 +116,10 @@ discard block |
||
| 116 | 116 | <h3 class="catbg">', $txt['attachment_transfer'], '</h3> |
| 117 | 117 | </div>'; |
| 118 | 118 | |
| 119 | - if (!empty($context['results'])) |
|
| 120 | - echo ' |
|
| 119 | + if (!empty($context['results'])) { |
|
| 120 | + echo ' |
|
| 121 | 121 | <div class="noticebox">', $context['results'], '</div>'; |
| 122 | + } |
|
| 122 | 123 | |
| 123 | 124 | echo ' |
| 124 | 125 | <div class="windowbg2 noup"> |
@@ -129,9 +130,10 @@ discard block |
||
| 129 | 130 | <dd><select name="from"> |
| 130 | 131 | <option value="0">', $txt['attachment_transfer_select'], '</option>'; |
| 131 | 132 | |
| 132 | - foreach ($context['attach_dirs'] as $id => $dir) |
|
| 133 | - echo ' |
|
| 133 | + foreach ($context['attach_dirs'] as $id => $dir) { |
|
| 134 | + echo ' |
|
| 134 | 135 | <option value="', $id, '">', $dir, '</option>'; |
| 136 | + } |
|
| 135 | 137 | echo ' |
| 136 | 138 | </select></dd> |
| 137 | 139 | <dt>', $txt['attachment_transfer_auto'], '</dt> |
@@ -139,13 +141,14 @@ discard block |
||
| 139 | 141 | <option value="0">', $txt['attachment_transfer_auto_select'], '</option> |
| 140 | 142 | <option value="-1">', $txt['attachment_transfer_forum_root'], '</option>'; |
| 141 | 143 | |
| 142 | - if (!empty($context['base_dirs'])) |
|
| 143 | - foreach ($context['base_dirs'] as $id => $dir) |
|
| 144 | + if (!empty($context['base_dirs'])) { |
|
| 145 | + foreach ($context['base_dirs'] as $id => $dir) |
|
| 144 | 146 | echo ' |
| 145 | 147 | <option value="', $id, '">', $dir, '</option>'; |
| 146 | - else |
|
| 147 | - echo ' |
|
| 148 | + } else { |
|
| 149 | + echo ' |
|
| 148 | 150 | <option value="0" disabled>', $txt['attachment_transfer_no_base'], '</option>'; |
| 151 | + } |
|
| 149 | 152 | |
| 150 | 153 | echo ' |
| 151 | 154 | </select></dd> |
@@ -153,16 +156,18 @@ discard block |
||
| 153 | 156 | <dd><select name="to"> |
| 154 | 157 | <option value="0">', $txt['attachment_transfer_select'], '</option>'; |
| 155 | 158 | |
| 156 | - foreach ($context['attach_dirs'] as $id => $dir) |
|
| 157 | - echo ' |
|
| 159 | + foreach ($context['attach_dirs'] as $id => $dir) { |
|
| 160 | + echo ' |
|
| 158 | 161 | <option value="', $id, '">', $dir, '</option>'; |
| 162 | + } |
|
| 159 | 163 | echo ' |
| 160 | 164 | </select></dd>'; |
| 161 | 165 | |
| 162 | - if (!empty($modSettings['attachmentDirFileLimit'])) |
|
| 163 | - echo ' |
|
| 166 | + if (!empty($modSettings['attachmentDirFileLimit'])) { |
|
| 167 | + echo ' |
|
| 164 | 168 | <dt>', $txt['attachment_transfer_empty'], '</dt> |
| 165 | 169 | <dd><input type="checkbox" name="empty_it"', $context['checked'] ? ' checked' : '', '></dd>'; |
| 170 | + } |
|
| 166 | 171 | echo ' |
| 167 | 172 | </dl> |
| 168 | 173 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -238,10 +243,11 @@ discard block |
||
| 238 | 243 | // Loop through each error reporting the status |
| 239 | 244 | foreach ($context['repair_errors'] as $error => $number) |
| 240 | 245 | { |
| 241 | - if (!empty($number)) |
|
| 242 | - echo ' |
|
| 246 | + if (!empty($number)) { |
|
| 247 | + echo ' |
|
| 243 | 248 | <input type="checkbox" name="to_fix[]" id="', $error, '" value="', $error, '"> |
| 244 | 249 | <label for="', $error, '">', sprintf($txt['attach_repair_' . $error], $number), '</label><br>'; |
| 250 | + } |
|
| 245 | 251 | } |
| 246 | 252 | |
| 247 | 253 | echo ' <br> |
@@ -18,11 +18,12 @@ discard block |
||
| 18 | 18 | global $context, $txt, $scripturl, $modSettings; |
| 19 | 19 | |
| 20 | 20 | // If maintenance has finished tell the user. |
| 21 | - if (!empty($context['maintenance_finished'])) |
|
| 22 | - echo ' |
|
| 21 | + if (!empty($context['maintenance_finished'])) { |
|
| 22 | + echo ' |
|
| 23 | 23 | <div class="infobox"> |
| 24 | 24 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
| 25 | 25 | </div>'; |
| 26 | + } |
|
| 26 | 27 | |
| 27 | 28 | echo ' |
| 28 | 29 | <div id="manage_maintenance"> |
@@ -107,11 +108,12 @@ discard block |
||
| 107 | 108 | <div id="manage_maintenance">'; |
| 108 | 109 | |
| 109 | 110 | // If maintenance has finished tell the user. |
| 110 | - if (!empty($context['maintenance_finished'])) |
|
| 111 | - echo ' |
|
| 111 | + if (!empty($context['maintenance_finished'])) { |
|
| 112 | + echo ' |
|
| 112 | 113 | <div class="infobox"> |
| 113 | 114 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
| 114 | 115 | </div>'; |
| 116 | + } |
|
| 115 | 117 | |
| 116 | 118 | echo ' |
| 117 | 119 | <div class="cat_bar"> |
@@ -238,11 +240,12 @@ discard block |
||
| 238 | 240 | <div id="manage_maintenance">'; |
| 239 | 241 | |
| 240 | 242 | // If maintenance has finished tell the user. |
| 241 | - if (!empty($context['maintenance_finished'])) |
|
| 242 | - echo ' |
|
| 243 | + if (!empty($context['maintenance_finished'])) { |
|
| 244 | + echo ' |
|
| 243 | 245 | <div class="infobox"> |
| 244 | 246 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
| 245 | 247 | </div>'; |
| 248 | + } |
|
| 246 | 249 | |
| 247 | 250 | echo ' |
| 248 | 251 | <div class="cat_bar"> |
@@ -300,9 +303,10 @@ discard block |
||
| 300 | 303 | <p><a href="#membersLink" onclick="swapMembers();"><img src="', $settings['images_url'], '/selected.png" alt="+" id="membersIcon"></a> <a href="#membersLink" onclick="swapMembers();" id="membersText" style="font-weight: bold;">', $txt['maintain_members_all'], '</a></p> |
| 301 | 304 | <div style="display: none; padding: 3px" id="membersPanel">'; |
| 302 | 305 | |
| 303 | - foreach ($context['membergroups'] as $group) |
|
| 304 | - echo ' |
|
| 306 | + foreach ($context['membergroups'] as $group) { |
|
| 307 | + echo ' |
|
| 305 | 308 | <label for="groups', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups', $group['id'], '" checked> ', $group['name'], '</label><br>'; |
| 309 | + } |
|
| 306 | 310 | |
| 307 | 311 | echo ' |
| 308 | 312 | </div> |
@@ -346,11 +350,12 @@ discard block |
||
| 346 | 350 | global $scripturl, $txt, $context, $settings, $modSettings; |
| 347 | 351 | |
| 348 | 352 | // If maintenance has finished tell the user. |
| 349 | - if (!empty($context['maintenance_finished'])) |
|
| 350 | - echo ' |
|
| 353 | + if (!empty($context['maintenance_finished'])) { |
|
| 354 | + echo ' |
|
| 351 | 355 | <div class="infobox"> |
| 352 | 356 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
| 353 | 357 | </div>'; |
| 358 | + } |
|
| 354 | 359 | |
| 355 | 360 | // Bit of javascript for showing which boards to prune in an otherwise hidden list. |
| 356 | 361 | echo ' |
@@ -418,19 +423,21 @@ discard block |
||
| 418 | 423 | <ul>'; |
| 419 | 424 | |
| 420 | 425 | // Display a checkbox with every board. |
| 421 | - foreach ($category['boards'] as $board) |
|
| 422 | - echo ' |
|
| 426 | + foreach ($category['boards'] as $board) { |
|
| 427 | + echo ' |
|
| 423 | 428 | <li style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'] * 1.5, 'em;"><label for="boards_', $board['id'], '"><input type="checkbox" name="boards[', $board['id'], ']" id="boards_', $board['id'], '" checked>', $board['name'], '</label></li>'; |
| 429 | + } |
|
| 424 | 430 | |
| 425 | 431 | echo ' |
| 426 | 432 | </ul> |
| 427 | 433 | </fieldset>'; |
| 428 | 434 | |
| 429 | 435 | // Increase $i, and check if we're at the middle yet. |
| 430 | - if (++$i == $middle) |
|
| 431 | - echo ' |
|
| 436 | + if (++$i == $middle) { |
|
| 437 | + echo ' |
|
| 432 | 438 | </div> |
| 433 | 439 | <div class="floatright" style="width: 49%;">'; |
| 440 | + } |
|
| 434 | 441 | } |
| 435 | 442 | |
| 436 | 443 | echo ' |
@@ -469,9 +476,10 @@ discard block |
||
| 469 | 476 | echo ' |
| 470 | 477 | <optgroup label="', $category['name'], '">'; |
| 471 | 478 | |
| 472 | - foreach ($category['boards'] as $board) |
|
| 473 | - echo ' |
|
| 479 | + foreach ($category['boards'] as $board) { |
|
| 480 | + echo ' |
|
| 474 | 481 | <option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>'; |
| 482 | + } |
|
| 475 | 483 | |
| 476 | 484 | echo ' |
| 477 | 485 | </optgroup>'; |
@@ -489,9 +497,10 @@ discard block |
||
| 489 | 497 | echo ' |
| 490 | 498 | <optgroup label="', $category['name'], '">'; |
| 491 | 499 | |
| 492 | - foreach ($category['boards'] as $board) |
|
| 493 | - echo ' |
|
| 500 | + foreach ($category['boards'] as $board) { |
|
| 501 | + echo ' |
|
| 494 | 502 | <option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>'; |
| 503 | + } |
|
| 495 | 504 | |
| 496 | 505 | echo ' |
| 497 | 506 | </optgroup>'; |
@@ -531,9 +540,10 @@ discard block |
||
| 531 | 540 | ', $txt['database_optimize_attempt'], '<br>'; |
| 532 | 541 | |
| 533 | 542 | // List each table being optimized... |
| 534 | - foreach ($context['optimized_tables'] as $table) |
|
| 535 | - echo ' |
|
| 543 | + foreach ($context['optimized_tables'] as $table) { |
|
| 544 | + echo ' |
|
| 536 | 545 | ', sprintf($txt['database_optimizing'], $table['name'], $table['data_freed']), '<br>'; |
| 546 | + } |
|
| 537 | 547 | |
| 538 | 548 | // How did we go? |
| 539 | 549 | echo ' |
@@ -590,13 +600,14 @@ discard block |
||
| 590 | 600 | ', implode('</li><li>', $context['exceeding_messages']), ' |
| 591 | 601 | </li> |
| 592 | 602 | </ul>'; |
| 593 | - if (!empty($context['exceeding_messages_morethan'])) |
|
| 594 | - echo ' |
|
| 603 | + if (!empty($context['exceeding_messages_morethan'])) { |
|
| 604 | + echo ' |
|
| 595 | 605 | <p>', $context['exceeding_messages_morethan'], '</p>'; |
| 596 | - } |
|
| 597 | - else |
|
| 598 | - echo ' |
|
| 606 | + } |
|
| 607 | + } else { |
|
| 608 | + echo ' |
|
| 599 | 609 | <p class="infobox">', $txt['convert_to_text'], '</p>'; |
| 610 | + } |
|
| 600 | 611 | |
| 601 | 612 | echo ' |
| 602 | 613 | <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertmsgbody" method="post" accept-charset="', $context['character_set'], '"> |
@@ -29,9 +29,10 @@ discard block |
||
| 29 | 29 | // Go through each type of report they can run. |
| 30 | 30 | foreach ($context['report_types'] as $type) |
| 31 | 31 | { |
| 32 | - if (isset($type['description'])) |
|
| 33 | - echo ' |
|
| 32 | + if (isset($type['description'])) { |
|
| 33 | + echo ' |
|
| 34 | 34 | <dt>', $type['description'], '</dt>'; |
| 35 | + } |
|
| 35 | 36 | echo ' |
| 36 | 37 | <dd> |
| 37 | 38 | <input type="radio" id="rt_', $type['id'], '" name="rt" value="', $type['id'], '"', $type['is_first'] ? ' checked' : '', '> |
@@ -61,8 +62,9 @@ discard block |
||
| 61 | 62 | </div> |
| 62 | 63 | <div id="report_buttons">'; |
| 63 | 64 | |
| 64 | - if (!empty($context['report_buttons'])) |
|
| 65 | - template_button_strip($context['report_buttons'], 'right'); |
|
| 65 | + if (!empty($context['report_buttons'])) { |
|
| 66 | + template_button_strip($context['report_buttons'], 'right'); |
|
| 67 | + } |
|
| 66 | 68 | |
| 67 | 69 | echo ' |
| 68 | 70 | </div>'; |
@@ -73,25 +75,27 @@ discard block |
||
| 73 | 75 | echo ' |
| 74 | 76 | <table class="table_grid report_results">'; |
| 75 | 77 | |
| 76 | - if (!empty($table['title'])) |
|
| 77 | - echo ' |
|
| 78 | + if (!empty($table['title'])) { |
|
| 79 | + echo ' |
|
| 78 | 80 | <thead> |
| 79 | 81 | <tr class="title_bar"> |
| 80 | 82 | <th scope="col" colspan="', $table['column_count'], '">', $table['title'], '</th> |
| 81 | 83 | </tr> |
| 82 | 84 | </thead> |
| 83 | 85 | <tbody>'; |
| 86 | + } |
|
| 84 | 87 | |
| 85 | 88 | // Now do each row! |
| 86 | 89 | $row_number = 0; |
| 87 | 90 | foreach ($table['data'] as $row) |
| 88 | 91 | { |
| 89 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
| 90 | - echo ' |
|
| 92 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
| 93 | + echo ' |
|
| 91 | 94 | <tr class="windowbg table_caption">'; |
| 92 | - else |
|
| 93 | - echo ' |
|
| 95 | + } else { |
|
| 96 | + echo ' |
|
| 94 | 97 | <tr class="', !empty($row[0]['separator']) ? 'title_bar' : 'windowbg', '">'; |
| 98 | + } |
|
| 95 | 99 | |
| 96 | 100 | // Now do each column. |
| 97 | 101 | $column_number = 0; |
@@ -109,16 +113,17 @@ discard block |
||
| 109 | 113 | } |
| 110 | 114 | |
| 111 | 115 | // Shaded? |
| 112 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
| 113 | - echo ' |
|
| 116 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
| 117 | + echo ' |
|
| 114 | 118 | <td class="table_caption ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
| 115 | 119 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
| 116 | 120 | </td>'; |
| 117 | - else |
|
| 118 | - echo ' |
|
| 121 | + } else { |
|
| 122 | + echo ' |
|
| 119 | 123 | <td class="smalltext centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
| 120 | 124 | ', $data['v'], ' |
| 121 | 125 | </td>'; |
| 126 | + } |
|
| 122 | 127 | |
| 123 | 128 | $column_number++; |
| 124 | 129 | } |
@@ -167,24 +172,26 @@ discard block |
||
| 167 | 172 | <div style="overflow: visible;', $table['max_width'] != 'auto' ? ' width: ' . $table['max_width'] . 'px;' : '', '"> |
| 168 | 173 | <table class="bordercolor">'; |
| 169 | 174 | |
| 170 | - if (!empty($table['title'])) |
|
| 171 | - echo ' |
|
| 175 | + if (!empty($table['title'])) { |
|
| 176 | + echo ' |
|
| 172 | 177 | <tr class="title_bar"> |
| 173 | 178 | <td colspan="', $table['column_count'], '"> |
| 174 | 179 | ', $table['title'], ' |
| 175 | 180 | </td> |
| 176 | 181 | </tr>'; |
| 182 | + } |
|
| 177 | 183 | |
| 178 | 184 | // Now do each row! |
| 179 | 185 | $row_number = 0; |
| 180 | 186 | foreach ($table['data'] as $row) |
| 181 | 187 | { |
| 182 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
| 183 | - echo ' |
|
| 188 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
| 189 | + echo ' |
|
| 184 | 190 | <tr class="titlebg">'; |
| 185 | - else |
|
| 186 | - echo ' |
|
| 191 | + } else { |
|
| 192 | + echo ' |
|
| 187 | 193 | <tr class="windowbg">'; |
| 194 | + } |
|
| 188 | 195 | |
| 189 | 196 | // Now do each column!! |
| 190 | 197 | $column_number = 0; |
@@ -201,16 +208,17 @@ discard block |
||
| 201 | 208 | } |
| 202 | 209 | |
| 203 | 210 | // Shaded? |
| 204 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
| 205 | - echo ' |
|
| 211 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
| 212 | + echo ' |
|
| 206 | 213 | <td class="titlebg ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
| 207 | 214 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
| 208 | 215 | </td>'; |
| 209 | - else |
|
| 210 | - echo ' |
|
| 216 | + } else { |
|
| 217 | + echo ' |
|
| 211 | 218 | <td class="centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
| 212 | 219 | ', $data['v'], ' |
| 213 | 220 | </td>'; |
| 221 | + } |
|
| 214 | 222 | |
| 215 | 223 | $column_number++; |
| 216 | 224 | } |
@@ -26,9 +26,10 @@ discard block |
||
| 26 | 26 | </h3> |
| 27 | 27 | </div>'; |
| 28 | 28 | |
| 29 | - if ($context['ban']['is_new']) |
|
| 30 | - echo ' |
|
| 29 | + if ($context['ban']['is_new']) { |
|
| 30 | + echo ' |
|
| 31 | 31 | <div class="information noup">', $txt['ban_add_notes'], '</div>'; |
| 32 | + } |
|
| 32 | 33 | |
| 33 | 34 | // If there were errors creating the ban, show them. |
| 34 | 35 | if (!empty($context['error_messages'])) |
@@ -38,9 +39,10 @@ discard block |
||
| 38 | 39 | <strong>', $txt['ban_errors_detected'], '</strong> |
| 39 | 40 | <ul>'; |
| 40 | 41 | |
| 41 | - foreach ($context['error_messages'] as $error) |
|
| 42 | - echo ' |
|
| 42 | + foreach ($context['error_messages'] as $error) { |
|
| 43 | + echo ' |
|
| 43 | 44 | <li class="error">', $error, '</li>'; |
| 45 | + } |
|
| 44 | 46 | |
| 45 | 47 | echo ' |
| 46 | 48 | </ul> |
@@ -57,8 +59,8 @@ discard block |
||
| 57 | 59 | <input type="text" id="ban_name" name="ban_name" value="', $context['ban']['name'], '" size="45" maxlength="60"> |
| 58 | 60 | </dd>'; |
| 59 | 61 | |
| 60 | - if (isset($context['ban']['reason'])) |
|
| 61 | - echo ' |
|
| 62 | + if (isset($context['ban']['reason'])) { |
|
| 63 | + echo ' |
|
| 62 | 64 | <dt> |
| 63 | 65 | <strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br> |
| 64 | 66 | <span class="smalltext">', $txt['ban_reason_desc'], '</span> |
@@ -66,9 +68,10 @@ discard block |
||
| 66 | 68 | <dd> |
| 67 | 69 | <textarea name="reason" id="reason" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['reason'], '</textarea> |
| 68 | 70 | </dd>'; |
| 71 | + } |
|
| 69 | 72 | |
| 70 | - if (isset($context['ban']['notes'])) |
|
| 71 | - echo ' |
|
| 73 | + if (isset($context['ban']['notes'])) { |
|
| 74 | + echo ' |
|
| 72 | 75 | <dt> |
| 73 | 76 | <strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br> |
| 74 | 77 | <span class="smalltext">', $txt['ban_notes_desc'], '</span> |
@@ -76,6 +79,7 @@ discard block |
||
| 76 | 79 | <dd> |
| 77 | 80 | <textarea name="notes" id="ban_notes" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['notes'], '</textarea> |
| 78 | 81 | </dd>'; |
| 82 | + } |
|
| 79 | 83 | |
| 80 | 84 | echo ' |
| 81 | 85 | </dl> |
@@ -115,8 +119,8 @@ discard block |
||
| 115 | 119 | <input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;"> |
| 116 | 120 | </dd>'; |
| 117 | 121 | |
| 118 | - if (empty($modSettings['disableHostnameLookup'])) |
|
| 119 | - echo ' |
|
| 122 | + if (empty($modSettings['disableHostnameLookup'])) { |
|
| 123 | + echo ' |
|
| 120 | 124 | <dt> |
| 121 | 125 | <input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', !empty($context['ban_suggestions']['hostname']) ? ' checked' : '', '> |
| 122 | 126 | <label for="hostname_check">', $txt['ban_on_hostname'], '</label> |
@@ -124,6 +128,7 @@ discard block |
||
| 124 | 128 | <dd> |
| 125 | 129 | <input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;"> |
| 126 | 130 | </dd>'; |
| 131 | + } |
|
| 127 | 132 | |
| 128 | 133 | echo ' |
| 129 | 134 | <dt> |
@@ -153,14 +158,15 @@ discard block |
||
| 153 | 158 | <dl class="settings">'; |
| 154 | 159 | |
| 155 | 160 | $count = 0; |
| 156 | - foreach ($ban_ips as $ip) |
|
| 157 | - echo ' |
|
| 161 | + foreach ($ban_ips as $ip) { |
|
| 162 | + echo ' |
|
| 158 | 163 | <dt> |
| 159 | 164 | <input type="checkbox" id="suggestions_', $key, '_', $count, '" name="ban_suggestions[', $key, '][]"', !empty($context['ban_suggestions']['saved_triggers'][$key]) && in_array($ip, $context['ban_suggestions']['saved_triggers'][$key]) ? ' checked' : '', ' value="', $ip, '"> |
| 160 | 165 | </dt> |
| 161 | 166 | <dd> |
| 162 | 167 | <label for="suggestions_', $key, '_', $count++, '">', $ip, '</label> |
| 163 | 168 | </dd>'; |
| 169 | + } |
|
| 164 | 170 | |
| 165 | 171 | echo ' |
| 166 | 172 | </dl>'; |
@@ -202,8 +208,8 @@ discard block |
||
| 202 | 208 | addLoadEvent(fUpdateStatus);'; |
| 203 | 209 | |
| 204 | 210 | // Auto suggest only needed for adding new bans, not editing |
| 205 | - if ($context['ban']['is_new'] && empty($_REQUEST['u'])) |
|
| 206 | - echo ' |
|
| 211 | + if ($context['ban']['is_new'] && empty($_REQUEST['u'])) { |
|
| 212 | + echo ' |
|
| 207 | 213 | var oAddMemberSuggest = new smc_AutoSuggest({ |
| 208 | 214 | sSelf: \'oAddMemberSuggest\', |
| 209 | 215 | sSessionId: smf_session_id, |
@@ -221,6 +227,7 @@ discard block |
||
| 221 | 227 | return true; |
| 222 | 228 | } |
| 223 | 229 | oAddMemberSuggest.registerCallback(\'onBeforeUpdate\', \'onUpdateName\');'; |
| 230 | + } |
|
| 224 | 231 | |
| 225 | 232 | echo ' |
| 226 | 233 | function confirmBan(aForm) |
@@ -268,8 +275,8 @@ discard block |
||
| 268 | 275 | <input type="text" name="main_ip" value="', $context['ban_trigger']['ip']['value'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;"> |
| 269 | 276 | </dd>'; |
| 270 | 277 | |
| 271 | - if (empty($modSettings['disableHostnameLookup'])) |
|
| 272 | - echo ' |
|
| 278 | + if (empty($modSettings['disableHostnameLookup'])) { |
|
| 279 | + echo ' |
|
| 273 | 280 | <dt> |
| 274 | 281 | <input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', $context['ban_trigger']['hostname']['selected'] ? ' checked' : '', '> |
| 275 | 282 | <label for="hostname_check">', $txt['ban_on_hostname'], '</label> |
@@ -277,6 +284,7 @@ discard block |
||
| 277 | 284 | <dd> |
| 278 | 285 | <input type="text" name="hostname" value="', $context['ban_trigger']['hostname']['value'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;"> |
| 279 | 286 | </dd>'; |
| 287 | + } |
|
| 280 | 288 | |
| 281 | 289 | echo ' |
| 282 | 290 | <dt> |
@@ -18,9 +18,10 @@ discard block |
||
| 18 | 18 | global $context, $txt, $scripturl; |
| 19 | 19 | |
| 20 | 20 | // Are we done sending the newsletter? |
| 21 | - if (!empty($context['newsletter_sent'])) |
|
| 22 | - echo ' |
|
| 21 | + if (!empty($context['newsletter_sent'])) { |
|
| 22 | + echo ' |
|
| 23 | 23 | <div class="infobox">', $txt['admin_news_newsletter_' . $context['newsletter_sent']], '</div>'; |
| 24 | + } |
|
| 24 | 25 | |
| 25 | 26 | echo ' |
| 26 | 27 | <div id="admincenter"> |
@@ -39,9 +40,10 @@ discard block |
||
| 39 | 40 | </dt> |
| 40 | 41 | <dd>'; |
| 41 | 42 | |
| 42 | - foreach ($context['groups'] as $group) |
|
| 43 | - echo ' |
|
| 43 | + foreach ($context['groups'] as $group) { |
|
| 44 | + echo ' |
|
| 44 | 45 | <label for="groups_', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups_', $group['id'], '" value="', $group['id'], '" checked> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>'; |
| 46 | + } |
|
| 45 | 47 | |
| 46 | 48 | echo ' |
| 47 | 49 | <br> |
@@ -82,9 +84,10 @@ discard block |
||
| 82 | 84 | </dt> |
| 83 | 85 | <dd>'; |
| 84 | 86 | |
| 85 | - foreach ($context['groups'] as $group) |
|
| 86 | - echo ' |
|
| 87 | + foreach ($context['groups'] as $group) { |
|
| 88 | + echo ' |
|
| 87 | 89 | <label for="exclude_groups_', $group['id'], '"><input type="checkbox" name="exclude_groups[', $group['id'], ']" id="exclude_groups_', $group['id'], '" value="', $group['id'], '"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>'; |
| 90 | + } |
|
| 88 | 91 | |
| 89 | 92 | echo ' |
| 90 | 93 | <br> |
@@ -228,9 +231,10 @@ discard block |
||
| 228 | 231 | <div id="bbcBox_message"></div>'; |
| 229 | 232 | |
| 230 | 233 | // What about smileys? |
| 231 | - if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) |
|
| 232 | - echo ' |
|
| 234 | + if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { |
|
| 235 | + echo ' |
|
| 233 | 236 | <div id="smileyBox_message"></div>'; |
| 237 | + } |
|
| 234 | 238 | |
| 235 | 239 | // Show BBC buttons, smileys and textbox. |
| 236 | 240 | echo ' |
@@ -251,9 +255,10 @@ discard block |
||
| 251 | 255 | <input type="hidden" name="email_force" value="', $context['email_force'], '"> |
| 252 | 256 | <input type="hidden" name="total_emails" value="', $context['total_emails'], '">'; |
| 253 | 257 | |
| 254 | - foreach ($context['recipients'] as $key => $values) |
|
| 255 | - echo ' |
|
| 258 | + foreach ($context['recipients'] as $key => $values) { |
|
| 259 | + echo ' |
|
| 256 | 260 | <input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">'; |
| 261 | + } |
|
| 257 | 262 | |
| 258 | 263 | echo ' |
| 259 | 264 | <script>'; |
@@ -408,9 +413,10 @@ discard block |
||
| 408 | 413 | <input type="hidden" name="parse_html" value="', $context['parse_html'], '">'; |
| 409 | 414 | |
| 410 | 415 | // All the things we must remember! |
| 411 | - foreach ($context['recipients'] as $key => $values) |
|
| 412 | - echo ' |
|
| 416 | + foreach ($context['recipients'] as $key => $values) { |
|
| 417 | + echo ' |
|
| 413 | 418 | <input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">'; |
| 419 | + } |
|
| 414 | 420 | |
| 415 | 421 | echo ' |
| 416 | 422 | </div> |
@@ -443,9 +449,10 @@ discard block |
||
| 443 | 449 | { |
| 444 | 450 | global $context, $txt; |
| 445 | 451 | |
| 446 | - if (!empty($context['saved_successful'])) |
|
| 447 | - echo ' |
|
| 452 | + if (!empty($context['saved_successful'])) { |
|
| 453 | + echo ' |
|
| 448 | 454 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 455 | + } |
|
| 449 | 456 | |
| 450 | 457 | template_show_list('news_lists'); |
| 451 | 458 | } |
@@ -148,8 +148,8 @@ discard block |
||
| 148 | 148 | </thead> |
| 149 | 149 | <tbody>'; |
| 150 | 150 | |
| 151 | - foreach ($context['membergroups'] as $membergroup) |
|
| 152 | - echo ' |
|
| 151 | + foreach ($context['membergroups'] as $membergroup) { |
|
| 152 | + echo ' |
|
| 153 | 153 | <tr class="windowbg"> |
| 154 | 154 | <td>', $membergroup['name'], '</td> |
| 155 | 155 | <td class="centercol"> |
@@ -159,6 +159,7 @@ discard block |
||
| 159 | 159 | ', $membergroup['can_be_additional'] ? '<input type="checkbox" name="membergroups[2][]" value="' . $membergroup['id'] . '" checked>' : '', ' |
| 160 | 160 | </td> |
| 161 | 161 | </tr>'; |
| 162 | + } |
|
| 162 | 163 | |
| 163 | 164 | echo ' |
| 164 | 165 | <tr class="windowbg"> |
@@ -185,8 +186,8 @@ discard block |
||
| 185 | 186 | </thead> |
| 186 | 187 | <tbody>'; |
| 187 | 188 | |
| 188 | - foreach ($context['postgroups'] as $postgroup) |
|
| 189 | - echo ' |
|
| 189 | + foreach ($context['postgroups'] as $postgroup) { |
|
| 190 | + echo ' |
|
| 190 | 191 | <tr class="windowbg"> |
| 191 | 192 | <td> |
| 192 | 193 | ', $postgroup['name'], ' |
@@ -195,6 +196,7 @@ discard block |
||
| 195 | 196 | <input type="checkbox" name="postgroups[]" value="', $postgroup['id'], '" checked> |
| 196 | 197 | </td> |
| 197 | 198 | </tr>'; |
| 199 | + } |
|
| 198 | 200 | |
| 199 | 201 | echo ' |
| 200 | 202 | <tr class="windowbg"> |
@@ -54,8 +54,9 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | // Prepare the comments... |
| 56 | 56 | $comments = array(); |
| 57 | - foreach ($report['comments'] as $comment) |
|
| 58 | - $comments[$comment['member']['id']] = $comment['member']['link']; |
|
| 57 | + foreach ($report['comments'] as $comment) { |
|
| 58 | + $comments[$comment['member']['id']] = $comment['member']['link']; |
|
| 59 | + } |
|
| 59 | 60 | |
| 60 | 61 | echo ' |
| 61 | 62 | ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), ' |
@@ -69,18 +70,21 @@ discard block |
||
| 69 | 70 | <li><a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>'; |
| 70 | 71 | |
| 71 | 72 | // Delete message button. |
| 72 | - if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) |
|
| 73 | - echo ' |
|
| 73 | + if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) { |
|
| 74 | + echo ' |
|
| 74 | 75 | <li><a href="', $scripturl, '?action=deletemsg;topic=', $report['topic']['id'], '.0;msg=', $report['topic']['id_msg'], ';modcenter;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['mc_reportedp_delete_confirm'], '" class="you_sure">', $delete_button, '</a></li>'; |
| 76 | + } |
|
| 75 | 77 | |
| 76 | 78 | // Ban this user button. |
| 77 | - if (!$report['closed'] && !empty($context['report_manage_bans'])) |
|
| 78 | - echo ' |
|
| 79 | + if (!$report['closed'] && !empty($context['report_manage_bans'])) { |
|
| 80 | + echo ' |
|
| 79 | 81 | <li><a href="', $scripturl, '?action=admin;area=ban;sa=add', (!empty($report['author']['id']) ? ';u=' . $report['author']['id'] : ';msg=' . $report['topic']['id_msg']), ';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
| 82 | + } |
|
| 80 | 83 | |
| 81 | - if (!$context['view_closed']) |
|
| 82 | - echo ' |
|
| 84 | + if (!$context['view_closed']) { |
|
| 85 | + echo ' |
|
| 83 | 86 | <li><input type="checkbox" name="close[]" value="' . $report['id'] . '"></li>'; |
| 87 | + } |
|
| 84 | 88 | |
| 85 | 89 | echo ' |
| 86 | 90 | </ul> |
@@ -88,11 +92,12 @@ discard block |
||
| 88 | 92 | } |
| 89 | 93 | |
| 90 | 94 | // Were none found? |
| 91 | - if (empty($context['reports'])) |
|
| 92 | - echo ' |
|
| 95 | + if (empty($context['reports'])) { |
|
| 96 | + echo ' |
|
| 93 | 97 | <div class="windowbg2"> |
| 94 | 98 | <p class="centertext">', $txt['mc_reportedp_none_found'], '</p> |
| 95 | 99 | </div>'; |
| 100 | + } |
|
| 96 | 101 | |
| 97 | 102 | echo ' |
| 98 | 103 | <div class="pagesection"> |
@@ -125,18 +130,20 @@ discard block |
||
| 125 | 130 | <div class="modbox"> |
| 126 | 131 | <ul>'; |
| 127 | 132 | |
| 128 | - foreach ($context['reported_posts'] as $report) |
|
| 129 | - echo ' |
|
| 133 | + foreach ($context['reported_posts'] as $report) { |
|
| 134 | + echo ' |
|
| 130 | 135 | <li class="smalltext"> |
| 131 | 136 | <a href="', $report['report_href'], '">', $report['subject'], '</a> ', $txt['mc_reportedp_by'], ' ', $report['author']['link'], ' |
| 132 | 137 | </li>'; |
| 138 | + } |
|
| 133 | 139 | |
| 134 | 140 | // Don't have any watched users right now? |
| 135 | - if (empty($context['reported_posts'])) |
|
| 136 | - echo ' |
|
| 141 | + if (empty($context['reported_posts'])) { |
|
| 142 | + echo ' |
|
| 137 | 143 | <li> |
| 138 | 144 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
| 139 | 145 | </li>'; |
| 146 | + } |
|
| 140 | 147 | |
| 141 | 148 | echo ' |
| 142 | 149 | </ul> |
@@ -226,12 +233,13 @@ discard block |
||
| 226 | 233 | <h3 class="catbg">', $txt['mc_modreport_whoreported_title'], '</h3> |
| 227 | 234 | </div>'; |
| 228 | 235 | |
| 229 | - foreach ($context['report']['comments'] as $comment) |
|
| 230 | - echo ' |
|
| 236 | + foreach ($context['report']['comments'] as $comment) { |
|
| 237 | + echo ' |
|
| 231 | 238 | <div class="windowbg"> |
| 232 | 239 | <p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p> |
| 233 | 240 | <p>', $comment['message'], '</p> |
| 234 | 241 | </div>'; |
| 242 | + } |
|
| 235 | 243 | |
| 236 | 244 | echo ' |
| 237 | 245 | <br> |
@@ -240,11 +248,12 @@ discard block |
||
| 240 | 248 | </div> |
| 241 | 249 | <div>'; |
| 242 | 250 | |
| 243 | - if (empty($context['report']['mod_comments'])) |
|
| 244 | - echo ' |
|
| 251 | + if (empty($context['report']['mod_comments'])) { |
|
| 252 | + echo ' |
|
| 245 | 253 | <div class="information"> |
| 246 | 254 | <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p> |
| 247 | 255 | </div>'; |
| 256 | + } |
|
| 248 | 257 | |
| 249 | 258 | foreach ($context['report']['mod_comments'] as $comment) |
| 250 | 259 | { |
@@ -334,18 +343,20 @@ discard block |
||
| 334 | 343 | <div class="modbox"> |
| 335 | 344 | <ul>'; |
| 336 | 345 | |
| 337 | - foreach ($context['reported_members'] as $report) |
|
| 338 | - echo ' |
|
| 346 | + foreach ($context['reported_members'] as $report) { |
|
| 347 | + echo ' |
|
| 339 | 348 | <li class="smalltext"> |
| 340 | 349 | <a href="', $report['report_href'], '">', $report['user_name'], '</a> |
| 341 | 350 | </li>'; |
| 351 | + } |
|
| 342 | 352 | |
| 343 | 353 | // Don't have any reported members right now? |
| 344 | - if (empty($context['reported_members'])) |
|
| 345 | - echo ' |
|
| 354 | + if (empty($context['reported_members'])) { |
|
| 355 | + echo ' |
|
| 346 | 356 | <li> |
| 347 | 357 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
| 348 | 358 | </li>'; |
| 359 | + } |
|
| 349 | 360 | |
| 350 | 361 | echo ' |
| 351 | 362 | </ul> |
@@ -431,8 +442,9 @@ discard block |
||
| 431 | 442 | |
| 432 | 443 | // Prepare the comments... |
| 433 | 444 | $comments = array(); |
| 434 | - foreach ($report['comments'] as $comment) |
|
| 435 | - $comments[$comment['member']['id']] = $comment['member']['link']; |
|
| 445 | + foreach ($report['comments'] as $comment) { |
|
| 446 | + $comments[$comment['member']['id']] = $comment['member']['link']; |
|
| 447 | + } |
|
| 436 | 448 | |
| 437 | 449 | echo ' |
| 438 | 450 | ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), ' |
@@ -444,13 +456,15 @@ discard block |
||
| 444 | 456 | <li><a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>'; |
| 445 | 457 | |
| 446 | 458 | // Ban this user button. |
| 447 | - if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) |
|
| 448 | - echo ' |
|
| 459 | + if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) { |
|
| 460 | + echo ' |
|
| 449 | 461 | <li><a href="', $scripturl, '?action=admin;area=ban;sa=add;u=', $report['user']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
| 462 | + } |
|
| 450 | 463 | |
| 451 | - if (!$context['view_closed']) |
|
| 452 | - echo ' |
|
| 464 | + if (!$context['view_closed']) { |
|
| 465 | + echo ' |
|
| 453 | 466 | <li><input type="checkbox" name="close[]" value="' . $report['id'] . '"></li>'; |
| 467 | + } |
|
| 454 | 468 | |
| 455 | 469 | echo ' |
| 456 | 470 | </ul> |
@@ -458,11 +472,12 @@ discard block |
||
| 458 | 472 | } |
| 459 | 473 | |
| 460 | 474 | // Were none found? |
| 461 | - if (empty($context['reports'])) |
|
| 462 | - echo ' |
|
| 475 | + if (empty($context['reports'])) { |
|
| 476 | + echo ' |
|
| 463 | 477 | <div class="windowbg2"> |
| 464 | 478 | <p class="centertext">', $txt['mc_reportedp_none_found'], '</p> |
| 465 | 479 | </div>'; |
| 480 | + } |
|
| 466 | 481 | |
| 467 | 482 | echo ' |
| 468 | 483 | <div class="pagesection"> |
@@ -522,12 +537,13 @@ discard block |
||
| 522 | 537 | <h3 class="catbg">', $txt['mc_memberreport_whoreported_title'], '</h3> |
| 523 | 538 | </div>'; |
| 524 | 539 | |
| 525 | - foreach ($context['report']['comments'] as $comment) |
|
| 526 | - echo ' |
|
| 540 | + foreach ($context['report']['comments'] as $comment) { |
|
| 541 | + echo ' |
|
| 527 | 542 | <div class="windowbg"> |
| 528 | 543 | <p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p> |
| 529 | 544 | <p>', $comment['message'], '</p> |
| 530 | 545 | </div>'; |
| 546 | + } |
|
| 531 | 547 | |
| 532 | 548 | echo ' |
| 533 | 549 | <br> |
@@ -536,11 +552,12 @@ discard block |
||
| 536 | 552 | </div> |
| 537 | 553 | <div>'; |
| 538 | 554 | |
| 539 | - if (empty($context['report']['mod_comments'])) |
|
| 540 | - echo ' |
|
| 555 | + if (empty($context['report']['mod_comments'])) { |
|
| 556 | + echo ' |
|
| 541 | 557 | <div class="information"> |
| 542 | 558 | <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p> |
| 543 | 559 | </div>'; |
| 560 | + } |
|
| 544 | 561 | |
| 545 | 562 | foreach ($context['report']['mod_comments'] as $comment) |
| 546 | 563 | { |
@@ -13,8 +13,9 @@ discard block |
||
| 13 | 13 | * @version 2.1 Beta 4 |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -if (!defined('SMF')) |
|
| 16 | +if (!defined('SMF')) { |
|
| 17 | 17 | die('No direct access...'); |
| 18 | +} |
|
| 18 | 19 | |
| 19 | 20 | /** |
| 20 | 21 | * The news dispatcher; doesn't do anything, just delegates. |
@@ -67,8 +68,9 @@ discard block |
||
| 67 | 68 | ); |
| 68 | 69 | |
| 69 | 70 | // Force the right area... |
| 70 | - if (substr($_REQUEST['sa'], 0, 7) == 'mailing') |
|
| 71 | - $context[$context['admin_menu_name']]['current_subsection'] = 'mailingmembers'; |
|
| 71 | + if (substr($_REQUEST['sa'], 0, 7) == 'mailing') { |
|
| 72 | + $context[$context['admin_menu_name']]['current_subsection'] = 'mailingmembers'; |
|
| 73 | + } |
|
| 72 | 74 | |
| 73 | 75 | call_helper($subActions[$_REQUEST['sa']][0]); |
| 74 | 76 | } |
@@ -99,9 +101,10 @@ discard block |
||
| 99 | 101 | $temp_news = explode("\n", $modSettings['news']); |
| 100 | 102 | |
| 101 | 103 | // Remove the items that were selected. |
| 102 | - foreach ($temp_news as $i => $news) |
|
| 103 | - if (in_array($i, $_POST['remove'])) |
|
| 104 | + foreach ($temp_news as $i => $news) { |
|
| 105 | + if (in_array($i, $_POST['remove'])) |
|
| 104 | 106 | unset($temp_news[$i]); |
| 107 | + } |
|
| 105 | 108 | |
| 106 | 109 | // Update the database. |
| 107 | 110 | updateSettings(array('news' => implode("\n", $temp_news))); |
@@ -117,9 +120,9 @@ discard block |
||
| 117 | 120 | |
| 118 | 121 | foreach ($_POST['news'] as $i => $news) |
| 119 | 122 | { |
| 120 | - if (trim($news) == '') |
|
| 121 | - unset($_POST['news'][$i]); |
|
| 122 | - else |
|
| 123 | + if (trim($news) == '') { |
|
| 124 | + unset($_POST['news'][$i]); |
|
| 125 | + } else |
|
| 123 | 126 | { |
| 124 | 127 | $_POST['news'][$i] = $smcFunc['htmlspecialchars']($_POST['news'][$i], ENT_QUOTES); |
| 125 | 128 | preparsecode($_POST['news'][$i]); |
@@ -154,11 +157,12 @@ discard block |
||
| 154 | 157 | 'data' => array( |
| 155 | 158 | 'function' => function($news) |
| 156 | 159 | { |
| 157 | - if (is_numeric($news['id'])) |
|
| 158 | - return '<textarea id="data_' . $news['id'] . '" rows="3" cols="50" name="news[]" class="padding block">' . $news['unparsed'] . '</textarea> |
|
| 160 | + if (is_numeric($news['id'])) { |
|
| 161 | + return '<textarea id="data_' . $news['id'] . '" rows="3" cols="50" name="news[]" class="padding block">' . $news['unparsed'] . '</textarea> |
|
| 159 | 162 | <div class="floatleft" id="preview_' . $news['id'] . '"></div>'; |
| 160 | - else |
|
| 161 | - return $news['unparsed']; |
|
| 163 | + } else { |
|
| 164 | + return $news['unparsed']; |
|
| 165 | + } |
|
| 162 | 166 | }, |
| 163 | 167 | 'style' => 'width: 50%;', |
| 164 | 168 | ), |
@@ -183,10 +187,11 @@ discard block |
||
| 183 | 187 | 'data' => array( |
| 184 | 188 | 'function' => function($news) |
| 185 | 189 | { |
| 186 | - if (is_numeric($news['id'])) |
|
| 187 | - return '<input type="checkbox" name="remove[]" value="' . $news['id'] . '">'; |
|
| 188 | - else |
|
| 189 | - return ''; |
|
| 190 | + if (is_numeric($news['id'])) { |
|
| 191 | + return '<input type="checkbox" name="remove[]" value="' . $news['id'] . '">'; |
|
| 192 | + } else { |
|
| 193 | + return ''; |
|
| 194 | + } |
|
| 190 | 195 | }, |
| 191 | 196 | 'class' => 'centercol', |
| 192 | 197 | ), |
@@ -280,12 +285,13 @@ discard block |
||
| 280 | 285 | |
| 281 | 286 | $admin_current_news = array(); |
| 282 | 287 | // Ready the current news. |
| 283 | - foreach (explode("\n", $modSettings['news']) as $id => $line) |
|
| 284 | - $admin_current_news[$id] = array( |
|
| 288 | + foreach (explode("\n", $modSettings['news']) as $id => $line) { |
|
| 289 | + $admin_current_news[$id] = array( |
|
| 285 | 290 | 'id' => $id, |
| 286 | 291 | 'unparsed' => un_preparsecode($line), |
| 287 | 292 | 'parsed' => preg_replace('~<([/]?)form[^>]*?[>]*>~i', '<em class="smalltext"><$1form></em>', parse_bbc($line)), |
| 288 | 293 | ); |
| 294 | + } |
|
| 289 | 295 | |
| 290 | 296 | $admin_current_news['last'] = array( |
| 291 | 297 | 'id' => 'last', |
@@ -352,10 +358,11 @@ discard block |
||
| 352 | 358 | 'member_count' => 0, |
| 353 | 359 | ); |
| 354 | 360 | |
| 355 | - if ($row['min_posts'] == -1) |
|
| 356 | - $normalGroups[$row['id_group']] = $row['id_group']; |
|
| 357 | - else |
|
| 358 | - $postGroups[$row['id_group']] = $row['id_group']; |
|
| 361 | + if ($row['min_posts'] == -1) { |
|
| 362 | + $normalGroups[$row['id_group']] = $row['id_group']; |
|
| 363 | + } else { |
|
| 364 | + $postGroups[$row['id_group']] = $row['id_group']; |
|
| 365 | + } |
|
| 359 | 366 | } |
| 360 | 367 | $smcFunc['db_free_result']($request); |
| 361 | 368 | |
@@ -371,8 +378,9 @@ discard block |
||
| 371 | 378 | 'post_group_list' => $postGroups, |
| 372 | 379 | ) |
| 373 | 380 | ); |
| 374 | - while ($row = $smcFunc['db_fetch_assoc']($query)) |
|
| 375 | - $context['groups'][$row['id_group']]['member_count'] += $row['member_count']; |
|
| 381 | + while ($row = $smcFunc['db_fetch_assoc']($query)) { |
|
| 382 | + $context['groups'][$row['id_group']]['member_count'] += $row['member_count']; |
|
| 383 | + } |
|
| 376 | 384 | $smcFunc['db_free_result']($query); |
| 377 | 385 | } |
| 378 | 386 | |
@@ -388,8 +396,9 @@ discard block |
||
| 388 | 396 | 'normal_group_list' => $normalGroups, |
| 389 | 397 | ) |
| 390 | 398 | ); |
| 391 | - while ($row = $smcFunc['db_fetch_assoc']($query)) |
|
| 392 | - $context['groups'][$row['id_group']]['member_count'] += $row['member_count']; |
|
| 399 | + while ($row = $smcFunc['db_fetch_assoc']($query)) { |
|
| 400 | + $context['groups'][$row['id_group']]['member_count'] += $row['member_count']; |
|
| 401 | + } |
|
| 393 | 402 | $smcFunc['db_free_result']($query); |
| 394 | 403 | |
| 395 | 404 | // Also do those who have it as an additional membergroup - this ones more yucky... |
@@ -406,8 +415,9 @@ discard block |
||
| 406 | 415 | 'blank_string' => '', |
| 407 | 416 | ) |
| 408 | 417 | ); |
| 409 | - while ($row = $smcFunc['db_fetch_assoc']($query)) |
|
| 410 | - $context['groups'][$row['id_group']]['member_count'] += $row['member_count']; |
|
| 418 | + while ($row = $smcFunc['db_fetch_assoc']($query)) { |
|
| 419 | + $context['groups'][$row['id_group']]['member_count'] += $row['member_count']; |
|
| 420 | + } |
|
| 411 | 421 | $smcFunc['db_free_result']($query); |
| 412 | 422 | } |
| 413 | 423 | |
@@ -458,10 +468,11 @@ discard block |
||
| 458 | 468 | { |
| 459 | 469 | $context[$key] = !empty($_REQUEST[$post]) ? $_REQUEST[$post] : ''; |
| 460 | 470 | |
| 461 | - if (empty($context[$key]) && empty($_REQUEST['xml'])) |
|
| 462 | - $context['post_error']['messages'][] = $txt['error_no_' . $post]; |
|
| 463 | - elseif (!empty($_REQUEST['xml'])) |
|
| 464 | - continue; |
|
| 471 | + if (empty($context[$key]) && empty($_REQUEST['xml'])) { |
|
| 472 | + $context['post_error']['messages'][] = $txt['error_no_' . $post]; |
|
| 473 | + } elseif (!empty($_REQUEST['xml'])) { |
|
| 474 | + continue; |
|
| 475 | + } |
|
| 465 | 476 | |
| 466 | 477 | preparsecode($context[$key]); |
| 467 | 478 | if ($html) |
@@ -540,10 +551,12 @@ discard block |
||
| 540 | 551 | |
| 541 | 552 | // Start by finding any members! |
| 542 | 553 | $toClean = array(); |
| 543 | - if (!empty($_POST['members'])) |
|
| 544 | - $toClean[] = 'members'; |
|
| 545 | - if (!empty($_POST['exclude_members'])) |
|
| 546 | - $toClean[] = 'exclude_members'; |
|
| 554 | + if (!empty($_POST['members'])) { |
|
| 555 | + $toClean[] = 'members'; |
|
| 556 | + } |
|
| 557 | + if (!empty($_POST['exclude_members'])) { |
|
| 558 | + $toClean[] = 'exclude_members'; |
|
| 559 | + } |
|
| 547 | 560 | if (!empty($toClean)) |
| 548 | 561 | { |
| 549 | 562 | require_once($sourcedir . '/Subs-Auth.php'); |
@@ -555,11 +568,13 @@ discard block |
||
| 555 | 568 | preg_match_all('~"([^"]+)"~', $_POST[$type], $matches); |
| 556 | 569 | $_POST[$type] = array_unique(array_merge($matches[1], explode(',', preg_replace('~"[^"]+"~', '', $_POST[$type])))); |
| 557 | 570 | |
| 558 | - foreach ($_POST[$type] as $index => $member) |
|
| 559 | - if (strlen(trim($member)) > 0) |
|
| 571 | + foreach ($_POST[$type] as $index => $member) { |
|
| 572 | + if (strlen(trim($member)) > 0) |
|
| 560 | 573 | $_POST[$type][$index] = $smcFunc['htmlspecialchars']($smcFunc['strtolower'](trim($member))); |
| 561 | - else |
|
| 562 | - unset($_POST[$type][$index]); |
|
| 574 | + } |
|
| 575 | + else { |
|
| 576 | + unset($_POST[$type][$index]); |
|
| 577 | + } |
|
| 563 | 578 | |
| 564 | 579 | // Find the members |
| 565 | 580 | $_POST[$type] = implode(',', array_keys(findMembers($_POST[$type]))); |
@@ -569,16 +584,18 @@ discard block |
||
| 569 | 584 | if (isset($_POST['member_list']) && is_array($_POST['member_list'])) |
| 570 | 585 | { |
| 571 | 586 | $members = array(); |
| 572 | - foreach ($_POST['member_list'] as $member_id) |
|
| 573 | - $members[] = (int) $member_id; |
|
| 587 | + foreach ($_POST['member_list'] as $member_id) { |
|
| 588 | + $members[] = (int) $member_id; |
|
| 589 | + } |
|
| 574 | 590 | $_POST['members'] = implode(',', $members); |
| 575 | 591 | } |
| 576 | 592 | |
| 577 | 593 | if (isset($_POST['exclude_member_list']) && is_array($_POST['exclude_member_list'])) |
| 578 | 594 | { |
| 579 | 595 | $members = array(); |
| 580 | - foreach ($_POST['exclude_member_list'] as $member_id) |
|
| 581 | - $members[] = (int) $member_id; |
|
| 596 | + foreach ($_POST['exclude_member_list'] as $member_id) { |
|
| 597 | + $members[] = (int) $member_id; |
|
| 598 | + } |
|
| 582 | 599 | $_POST['exclude_members'] = implode(',', $members); |
| 583 | 600 | } |
| 584 | 601 | |
@@ -602,8 +619,9 @@ discard block |
||
| 602 | 619 | 'current_time' => time(), |
| 603 | 620 | ) |
| 604 | 621 | ); |
| 605 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
| 606 | - $context['recipients']['exclude_members'][] = $row['id_member']; |
|
| 622 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
| 623 | + $context['recipients']['exclude_members'][] = $row['id_member']; |
|
| 624 | + } |
|
| 607 | 625 | $smcFunc['db_free_result']($request); |
| 608 | 626 | |
| 609 | 627 | $request = $smcFunc['db_query']('', ' |
@@ -638,8 +656,9 @@ discard block |
||
| 638 | 656 | WHERE email_address IN(' . implode(', ', $condition_array) . ')', |
| 639 | 657 | $condition_array_params |
| 640 | 658 | ); |
| 641 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
| 642 | - $context['recipients']['exclude_members'][] = $row['id_member']; |
|
| 659 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
| 660 | + $context['recipients']['exclude_members'][] = $row['id_member']; |
|
| 661 | + } |
|
| 643 | 662 | $smcFunc['db_free_result']($request); |
| 644 | 663 | } |
| 645 | 664 | |
@@ -657,10 +676,11 @@ discard block |
||
| 657 | 676 | ); |
| 658 | 677 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 659 | 678 | { |
| 660 | - if (in_array(3, $context['recipients'])) |
|
| 661 | - $context['recipients']['exclude_members'][] = $row['identifier']; |
|
| 662 | - else |
|
| 663 | - $context['recipients']['members'][] = $row['identifier']; |
|
| 679 | + if (in_array(3, $context['recipients'])) { |
|
| 680 | + $context['recipients']['exclude_members'][] = $row['identifier']; |
|
| 681 | + } else { |
|
| 682 | + $context['recipients']['members'][] = $row['identifier']; |
|
| 683 | + } |
|
| 664 | 684 | } |
| 665 | 685 | $smcFunc['db_free_result']($request); |
| 666 | 686 | } |
@@ -707,8 +727,9 @@ discard block |
||
| 707 | 727 | $num_at_once = 1000; |
| 708 | 728 | |
| 709 | 729 | // If by PM's I suggest we half the above number. |
| 710 | - if (!empty($_POST['send_pm'])) |
|
| 711 | - $num_at_once /= 2; |
|
| 730 | + if (!empty($_POST['send_pm'])) { |
|
| 731 | + $num_at_once /= 2; |
|
| 732 | + } |
|
| 712 | 733 | |
| 713 | 734 | checkSession(); |
| 714 | 735 | |
@@ -731,8 +752,7 @@ discard block |
||
| 731 | 752 | ); |
| 732 | 753 | list ($context['total_members']) = $smcFunc['db_fetch_row']($request); |
| 733 | 754 | $smcFunc['db_free_result']($request); |
| 734 | - } |
|
| 735 | - else |
|
| 755 | + } else |
|
| 736 | 756 | { |
| 737 | 757 | $context['total_members'] = (int) $_REQUEST['total_members']; |
| 738 | 758 | } |
@@ -750,32 +770,35 @@ discard block |
||
| 750 | 770 | if (!empty($_POST['exclude_members'])) |
| 751 | 771 | { |
| 752 | 772 | $members = explode(',', $_POST['exclude_members']); |
| 753 | - foreach ($members as $member) |
|
| 754 | - if ($member >= $context['start']) |
|
| 773 | + foreach ($members as $member) { |
|
| 774 | + if ($member >= $context['start']) |
|
| 755 | 775 | $context['recipients']['exclude_members'][] = (int) $member; |
| 776 | + } |
|
| 756 | 777 | } |
| 757 | 778 | |
| 758 | 779 | // What about members we *must* do? |
| 759 | 780 | if (!empty($_POST['members'])) |
| 760 | 781 | { |
| 761 | 782 | $members = explode(',', $_POST['members']); |
| 762 | - foreach ($members as $member) |
|
| 763 | - if ($member >= $context['start']) |
|
| 783 | + foreach ($members as $member) { |
|
| 784 | + if ($member >= $context['start']) |
|
| 764 | 785 | $context['recipients']['members'][] = (int) $member; |
| 786 | + } |
|
| 765 | 787 | } |
| 766 | 788 | // Cleaning groups is simple - although deal with both checkbox and commas. |
| 767 | 789 | if (isset($_POST['groups'])) |
| 768 | 790 | { |
| 769 | 791 | if (is_array($_POST['groups'])) |
| 770 | 792 | { |
| 771 | - foreach ($_POST['groups'] as $group => $dummy) |
|
| 772 | - $context['recipients']['groups'][] = (int) $group; |
|
| 773 | - } |
|
| 774 | - else |
|
| 793 | + foreach ($_POST['groups'] as $group => $dummy) { |
|
| 794 | + $context['recipients']['groups'][] = (int) $group; |
|
| 795 | + } |
|
| 796 | + } else |
|
| 775 | 797 | { |
| 776 | 798 | $groups = explode(',', $_POST['groups']); |
| 777 | - foreach ($groups as $group) |
|
| 778 | - $context['recipients']['groups'][] = (int) $group; |
|
| 799 | + foreach ($groups as $group) { |
|
| 800 | + $context['recipients']['groups'][] = (int) $group; |
|
| 801 | + } |
|
| 779 | 802 | } |
| 780 | 803 | } |
| 781 | 804 | // Same for excluded groups |
@@ -783,15 +806,17 @@ discard block |
||
| 783 | 806 | { |
| 784 | 807 | if (is_array($_POST['exclude_groups'])) |
| 785 | 808 | { |
| 786 | - foreach ($_POST['exclude_groups'] as $group => $dummy) |
|
| 787 | - $context['recipients']['exclude_groups'][] = (int) $group; |
|
| 809 | + foreach ($_POST['exclude_groups'] as $group => $dummy) { |
|
| 810 | + $context['recipients']['exclude_groups'][] = (int) $group; |
|
| 811 | + } |
|
| 788 | 812 | } |
| 789 | 813 | // Ignore an empty string - we don't want to exclude "Regular Members" unless it's specifically selected |
| 790 | 814 | elseif ($_POST['exclude_groups'] != '') |
| 791 | 815 | { |
| 792 | 816 | $groups = explode(',', $_POST['exclude_groups']); |
| 793 | - foreach ($groups as $group) |
|
| 794 | - $context['recipients']['exclude_groups'][] = (int) $group; |
|
| 817 | + foreach ($groups as $group) { |
|
| 818 | + $context['recipients']['exclude_groups'][] = (int) $group; |
|
| 819 | + } |
|
| 795 | 820 | } |
| 796 | 821 | } |
| 797 | 822 | // Finally - emails! |
@@ -801,14 +826,16 @@ discard block |
||
| 801 | 826 | foreach ($addressed as $curmem) |
| 802 | 827 | { |
| 803 | 828 | $curmem = trim($curmem); |
| 804 | - if ($curmem != '' && filter_var($curmem, FILTER_VALIDATE_EMAIL)) |
|
| 805 | - $context['recipients']['emails'][$curmem] = $curmem; |
|
| 829 | + if ($curmem != '' && filter_var($curmem, FILTER_VALIDATE_EMAIL)) { |
|
| 830 | + $context['recipients']['emails'][$curmem] = $curmem; |
|
| 831 | + } |
|
| 806 | 832 | } |
| 807 | 833 | } |
| 808 | 834 | |
| 809 | 835 | // If we're only cleaning drop out here. |
| 810 | - if ($clean_only) |
|
| 811 | - return; |
|
| 836 | + if ($clean_only) { |
|
| 837 | + return; |
|
| 838 | + } |
|
| 812 | 839 | |
| 813 | 840 | require_once($sourcedir . '/Subs-Post.php'); |
| 814 | 841 | |
@@ -824,16 +851,18 @@ discard block |
||
| 824 | 851 | if (!$context['send_pm'] && !empty($_POST['send_html'])) |
| 825 | 852 | { |
| 826 | 853 | // Prepare the message for HTML. |
| 827 | - if (!empty($_POST['parse_html'])) |
|
| 828 | - $_POST['message'] = str_replace(array("\n", ' '), array('<br>' . "\n", ' '), $_POST['message']); |
|
| 854 | + if (!empty($_POST['parse_html'])) { |
|
| 855 | + $_POST['message'] = str_replace(array("\n", ' '), array('<br>' . "\n", ' '), $_POST['message']); |
|
| 856 | + } |
|
| 829 | 857 | |
| 830 | 858 | // This is here to prevent spam filters from tagging this as spam. |
| 831 | 859 | if (preg_match('~\<html~i', $_POST['message']) == 0) |
| 832 | 860 | { |
| 833 | - if (preg_match('~\<body~i', $_POST['message']) == 0) |
|
| 834 | - $_POST['message'] = '<html><head><title>' . $_POST['subject'] . '</title></head>' . "\n" . '<body>' . $_POST['message'] . '</body></html>'; |
|
| 835 | - else |
|
| 836 | - $_POST['message'] = '<html>' . $_POST['message'] . '</html>'; |
|
| 861 | + if (preg_match('~\<body~i', $_POST['message']) == 0) { |
|
| 862 | + $_POST['message'] = '<html><head><title>' . $_POST['subject'] . '</title></head>' . "\n" . '<body>' . $_POST['message'] . '</body></html>'; |
|
| 863 | + } else { |
|
| 864 | + $_POST['message'] = '<html>' . $_POST['message'] . '</html>'; |
|
| 865 | + } |
|
| 837 | 866 | } |
| 838 | 867 | } |
| 839 | 868 | |
@@ -887,15 +916,17 @@ discard block |
||
| 887 | 916 | foreach ($context['recipients']['emails'] as $k => $email) |
| 888 | 917 | { |
| 889 | 918 | // Done as many as we can? |
| 890 | - if ($i >= $num_at_once) |
|
| 891 | - break; |
|
| 919 | + if ($i >= $num_at_once) { |
|
| 920 | + break; |
|
| 921 | + } |
|
| 892 | 922 | |
| 893 | 923 | // Don't sent it twice! |
| 894 | 924 | unset($context['recipients']['emails'][$k]); |
| 895 | 925 | |
| 896 | 926 | // Dammit - can't PM emails! |
| 897 | - if ($context['send_pm']) |
|
| 898 | - continue; |
|
| 927 | + if ($context['send_pm']) { |
|
| 928 | + continue; |
|
| 929 | + } |
|
| 899 | 930 | |
| 900 | 931 | $to_member = array( |
| 901 | 932 | $email, |
@@ -929,8 +960,9 @@ discard block |
||
| 929 | 960 | $queryBuild[] = 'mem.id_post_group = {int:group_' . $group . '}'; |
| 930 | 961 | } |
| 931 | 962 | } |
| 932 | - if (!empty($queryBuild)) |
|
| 933 | - $sendQuery .= implode(' OR ', $queryBuild); |
|
| 963 | + if (!empty($queryBuild)) { |
|
| 964 | + $sendQuery .= implode(' OR ', $queryBuild); |
|
| 965 | + } |
|
| 934 | 966 | } |
| 935 | 967 | if (!empty($context['recipients']['members'])) |
| 936 | 968 | { |
@@ -949,8 +981,9 @@ discard block |
||
| 949 | 981 | } |
| 950 | 982 | |
| 951 | 983 | // Anything to exclude? |
| 952 | - if (!empty($context['recipients']['exclude_groups']) && in_array(0, $context['recipients']['exclude_groups'])) |
|
| 953 | - $sendQuery .= ' AND mem.id_group != {int:regular_group}'; |
|
| 984 | + if (!empty($context['recipients']['exclude_groups']) && in_array(0, $context['recipients']['exclude_groups'])) { |
|
| 985 | + $sendQuery .= ' AND mem.id_group != {int:regular_group}'; |
|
| 986 | + } |
|
| 954 | 987 | if (!empty($context['recipients']['exclude_members'])) |
| 955 | 988 | { |
| 956 | 989 | $sendQuery .= ' AND mem.id_member NOT IN ({array_int:exclude_members})'; |
@@ -986,21 +1019,24 @@ discard block |
||
| 986 | 1019 | foreach ($rows as $row) |
| 987 | 1020 | { |
| 988 | 1021 | // Force them to have it? |
| 989 | - if (empty($context['email_force']) && empty($prefs[$row['id_member']]['announcements'])) |
|
| 990 | - continue; |
|
| 1022 | + if (empty($context['email_force']) && empty($prefs[$row['id_member']]['announcements'])) { |
|
| 1023 | + continue; |
|
| 1024 | + } |
|
| 991 | 1025 | |
| 992 | 1026 | // What groups are we looking at here? |
| 993 | - if (empty($row['additional_groups'])) |
|
| 994 | - $groups = array($row['id_group'], $row['id_post_group']); |
|
| 995 | - else |
|
| 996 | - $groups = array_merge( |
|
| 1027 | + if (empty($row['additional_groups'])) { |
|
| 1028 | + $groups = array($row['id_group'], $row['id_post_group']); |
|
| 1029 | + } else { |
|
| 1030 | + $groups = array_merge( |
|
| 997 | 1031 | array($row['id_group'], $row['id_post_group']), |
| 998 | 1032 | explode(',', $row['additional_groups']) |
| 999 | 1033 | ); |
| 1034 | + } |
|
| 1000 | 1035 | |
| 1001 | 1036 | // Excluded groups? |
| 1002 | - if (array_intersect($groups, $context['recipients']['exclude_groups'])) |
|
| 1003 | - continue; |
|
| 1037 | + if (array_intersect($groups, $context['recipients']['exclude_groups'])) { |
|
| 1038 | + continue; |
|
| 1039 | + } |
|
| 1004 | 1040 | |
| 1005 | 1041 | // We might need this |
| 1006 | 1042 | $cleanMemberName = empty($_POST['send_html']) || $context['send_pm'] ? un_htmlspecialchars($row['real_name']) : $row['real_name']; |
@@ -1023,10 +1059,11 @@ discard block |
||
| 1023 | 1059 | ), $_POST['subject']); |
| 1024 | 1060 | |
| 1025 | 1061 | // Send the actual email - or a PM! |
| 1026 | - if (!$context['send_pm']) |
|
| 1027 | - sendmail($row['email_address'], $subject, $message, null, 'news', !empty($_POST['send_html']), 5); |
|
| 1028 | - else |
|
| 1029 | - sendpm(array('to' => array($row['id_member']), 'bcc' => array()), $subject, $message); |
|
| 1062 | + if (!$context['send_pm']) { |
|
| 1063 | + sendmail($row['email_address'], $subject, $message, null, 'news', !empty($_POST['send_html']), 5); |
|
| 1064 | + } else { |
|
| 1065 | + sendpm(array('to' => array($row['id_member']), 'bcc' => array()), $subject, $message); |
|
| 1066 | + } |
|
| 1030 | 1067 | } |
| 1031 | 1068 | } |
| 1032 | 1069 | |
@@ -1076,8 +1113,9 @@ discard block |
||
| 1076 | 1113 | |
| 1077 | 1114 | call_integration_hook('integrate_modify_news_settings', array(&$config_vars)); |
| 1078 | 1115 | |
| 1079 | - if ($return_config) |
|
| 1080 | - return $config_vars; |
|
| 1116 | + if ($return_config) { |
|
| 1117 | + return $config_vars; |
|
| 1118 | + } |
|
| 1081 | 1119 | |
| 1082 | 1120 | $context['page_title'] = $txt['admin_edit_news'] . ' - ' . $txt['settings']; |
| 1083 | 1121 | $context['sub_template'] = 'show_settings'; |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | 'class' => 'centercol', |
| 257 | 257 | ), |
| 258 | 258 | 'data' => array( |
| 259 | - 'function' => function ($entry) |
|
| 259 | + 'function' => function($entry) |
|
| 260 | 260 | { |
| 261 | 261 | return '<input type="checkbox" name="delete[]" value="' . $entry['id'] . '"' . ($entry['editable'] ? '' : ' disabled') . '>'; |
| 262 | 262 | }, |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | if (empty($entries[$k]['action_text'])) |
| 639 | 639 | $entries[$k]['action_text'] = isset($txt['modlog_ac_' . $entry['action']]) ? $txt['modlog_ac_' . $entry['action']] : $entry['action']; |
| 640 | 640 | $entries[$k]['action_text'] = preg_replace_callback('~\{([A-Za-z\d_]+)\}~i', |
| 641 | - function ($matches) use ($entries, $k) |
|
| 641 | + function($matches) use ($entries, $k) |
|
| 642 | 642 | { |
| 643 | 643 | return isset($entries[$k]['extra'][$matches[1]]) ? $entries[$k]['extra'][$matches[1]] : ''; |
| 644 | 644 | }, $entries[$k]['action_text']); |
@@ -14,8 +14,9 @@ discard block |
||
| 14 | 14 | * @version 2.1 Beta 4 |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | -if (!defined('SMF')) |
|
| 17 | +if (!defined('SMF')) { |
|
| 18 | 18 | die('No direct access...'); |
| 19 | +} |
|
| 19 | 20 | |
| 20 | 21 | /** |
| 21 | 22 | * Prepares the information from the moderation log for viewing. |
@@ -32,14 +33,16 @@ discard block |
||
| 32 | 33 | |
| 33 | 34 | // Are we looking at the moderation log or the administration log. |
| 34 | 35 | $context['log_type'] = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'adminlog' ? 3 : 1; |
| 35 | - if ($context['log_type'] == 3) |
|
| 36 | - isAllowedTo('admin_forum'); |
|
| 36 | + if ($context['log_type'] == 3) { |
|
| 37 | + isAllowedTo('admin_forum'); |
|
| 38 | + } |
|
| 37 | 39 | |
| 38 | 40 | // These change dependant on whether we are viewing the moderation or admin log. |
| 39 | - if ($context['log_type'] == 3 || $_REQUEST['action'] == 'admin') |
|
| 40 | - $context['url_start'] = '?action=admin;area=logs;sa=' . ($context['log_type'] == 3 ? 'adminlog' : 'modlog') . ';type=' . $context['log_type']; |
|
| 41 | - else |
|
| 42 | - $context['url_start'] = '?action=moderate;area=modlog;type=' . $context['log_type']; |
|
| 41 | + if ($context['log_type'] == 3 || $_REQUEST['action'] == 'admin') { |
|
| 42 | + $context['url_start'] = '?action=admin;area=logs;sa=' . ($context['log_type'] == 3 ? 'adminlog' : 'modlog') . ';type=' . $context['log_type']; |
|
| 43 | + } else { |
|
| 44 | + $context['url_start'] = '?action=moderate;area=modlog;type=' . $context['log_type']; |
|
| 45 | + } |
|
| 43 | 46 | |
| 44 | 47 | $context['can_delete'] = allowedTo('admin_forum'); |
| 45 | 48 | |
@@ -67,8 +70,7 @@ discard block |
||
| 67 | 70 | $log_type = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'adminlog' ? 'admin' : 'moderate'; |
| 68 | 71 | logAction('clearlog_' . $log_type, array(), $log_type); |
| 69 | 72 | |
| 70 | - } |
|
| 71 | - elseif (!empty($_POST['remove']) && isset($_POST['delete']) && $context['can_delete']) |
|
| 73 | + } elseif (!empty($_POST['remove']) && isset($_POST['delete']) && $context['can_delete']) |
|
| 72 | 74 | { |
| 73 | 75 | checkSession(); |
| 74 | 76 | validateToken('mod-ml'); |
@@ -114,15 +116,17 @@ discard block |
||
| 114 | 116 | 'ip' => array('sql' => 'lm.ip', 'label' => $txt['modlog_ip']) |
| 115 | 117 | ); |
| 116 | 118 | |
| 117 | - if (!isset($search_params['string']) || (!empty($_REQUEST['search']) && $search_params['string'] != $_REQUEST['search'])) |
|
| 118 | - $search_params_string = empty($_REQUEST['search']) ? '' : $_REQUEST['search']; |
|
| 119 | - else |
|
| 120 | - $search_params_string = $search_params['string']; |
|
| 119 | + if (!isset($search_params['string']) || (!empty($_REQUEST['search']) && $search_params['string'] != $_REQUEST['search'])) { |
|
| 120 | + $search_params_string = empty($_REQUEST['search']) ? '' : $_REQUEST['search']; |
|
| 121 | + } else { |
|
| 122 | + $search_params_string = $search_params['string']; |
|
| 123 | + } |
|
| 121 | 124 | |
| 122 | - if (isset($_REQUEST['search_type']) || empty($search_params['type']) || !isset($searchTypes[$search_params['type']])) |
|
| 123 | - $search_params_type = isset($_REQUEST['search_type']) && isset($searchTypes[$_REQUEST['search_type']]) ? $_REQUEST['search_type'] : (isset($searchTypes[$context['order']]) ? $context['order'] : 'member'); |
|
| 124 | - else |
|
| 125 | - $search_params_type = $search_params['type']; |
|
| 125 | + if (isset($_REQUEST['search_type']) || empty($search_params['type']) || !isset($searchTypes[$search_params['type']])) { |
|
| 126 | + $search_params_type = isset($_REQUEST['search_type']) && isset($searchTypes[$_REQUEST['search_type']]) ? $_REQUEST['search_type'] : (isset($searchTypes[$context['order']]) ? $context['order'] : 'member'); |
|
| 127 | + } else { |
|
| 128 | + $search_params_type = $search_params['type']; |
|
| 129 | + } |
|
| 126 | 130 | |
| 127 | 131 | $search_params_column = $searchTypes[$search_params_type]['sql']; |
| 128 | 132 | $search_params = array( |
@@ -301,15 +305,16 @@ discard block |
||
| 301 | 305 | $context['default_list'] = 'moderation_log_list'; |
| 302 | 306 | |
| 303 | 307 | // If a hook has changed this, respect it. |
| 304 | - if (!empty($moderation_menu_name)) |
|
| 305 | - $context[$context['moderation_menu_name']]['tab_data'] = $moderation_menu_name; |
|
| 306 | - elseif (isset($context['moderation_menu_name'])) |
|
| 307 | - $context[$context['moderation_menu_name']]['tab_data'] = array( |
|
| 308 | + if (!empty($moderation_menu_name)) { |
|
| 309 | + $context[$context['moderation_menu_name']]['tab_data'] = $moderation_menu_name; |
|
| 310 | + } elseif (isset($context['moderation_menu_name'])) { |
|
| 311 | + $context[$context['moderation_menu_name']]['tab_data'] = array( |
|
| 308 | 312 | 'title' => $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : 'moderation') . '_log'], |
| 309 | 313 | 'help' => $context['log_type'] == 3 ? 'adminlog' : 'modlog', |
| 310 | 314 | 'description' => $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : 'moderation') . '_log_desc'] |
| 311 | 315 | ); |
| 312 | -} |
|
| 316 | + } |
|
| 317 | + } |
|
| 313 | 318 | |
| 314 | 319 | /** |
| 315 | 320 | * Get the number of mod log entries. |
@@ -413,30 +418,35 @@ discard block |
||
| 413 | 418 | // Add on some of the column stuff info |
| 414 | 419 | if (!empty($row['id_board'])) |
| 415 | 420 | { |
| 416 | - if ($row['action'] == 'move') |
|
| 417 | - $row['extra']['board_to'] = $row['id_board']; |
|
| 418 | - else |
|
| 419 | - $row['extra']['board'] = $row['id_board']; |
|
| 421 | + if ($row['action'] == 'move') { |
|
| 422 | + $row['extra']['board_to'] = $row['id_board']; |
|
| 423 | + } else { |
|
| 424 | + $row['extra']['board'] = $row['id_board']; |
|
| 425 | + } |
|
| 420 | 426 | } |
| 421 | 427 | |
| 422 | - if (!empty($row['id_topic'])) |
|
| 423 | - $row['extra']['topic'] = $row['id_topic']; |
|
| 424 | - if (!empty($row['id_msg'])) |
|
| 425 | - $row['extra']['message'] = $row['id_msg']; |
|
| 428 | + if (!empty($row['id_topic'])) { |
|
| 429 | + $row['extra']['topic'] = $row['id_topic']; |
|
| 430 | + } |
|
| 431 | + if (!empty($row['id_msg'])) { |
|
| 432 | + $row['extra']['message'] = $row['id_msg']; |
|
| 433 | + } |
|
| 426 | 434 | |
| 427 | 435 | // Is this associated with a topic? |
| 428 | - if (isset($row['extra']['topic'])) |
|
| 429 | - $topics[(int) $row['extra']['topic']][] = $row['id_action']; |
|
| 430 | - if (isset($row['extra']['new_topic'])) |
|
| 431 | - $topics[(int) $row['extra']['new_topic']][] = $row['id_action']; |
|
| 436 | + if (isset($row['extra']['topic'])) { |
|
| 437 | + $topics[(int) $row['extra']['topic']][] = $row['id_action']; |
|
| 438 | + } |
|
| 439 | + if (isset($row['extra']['new_topic'])) { |
|
| 440 | + $topics[(int) $row['extra']['new_topic']][] = $row['id_action']; |
|
| 441 | + } |
|
| 432 | 442 | |
| 433 | 443 | // How about a member? |
| 434 | 444 | if (isset($row['extra']['member'])) |
| 435 | 445 | { |
| 436 | 446 | // Guests don't have names! |
| 437 | - if (empty($row['extra']['member'])) |
|
| 438 | - $row['extra']['member'] = $txt['modlog_parameter_guest']; |
|
| 439 | - else |
|
| 447 | + if (empty($row['extra']['member'])) { |
|
| 448 | + $row['extra']['member'] = $txt['modlog_parameter_guest']; |
|
| 449 | + } else |
|
| 440 | 450 | { |
| 441 | 451 | // Try to find it... |
| 442 | 452 | $members[(int) $row['extra']['member']][] = $row['id_action']; |
@@ -444,35 +454,42 @@ discard block |
||
| 444 | 454 | } |
| 445 | 455 | |
| 446 | 456 | // Associated with a board? |
| 447 | - if (isset($row['extra']['board_to'])) |
|
| 448 | - $boards[(int) $row['extra']['board_to']][] = $row['id_action']; |
|
| 449 | - if (isset($row['extra']['board_from'])) |
|
| 450 | - $boards[(int) $row['extra']['board_from']][] = $row['id_action']; |
|
| 451 | - if (isset($row['extra']['board'])) |
|
| 452 | - $boards[(int) $row['extra']['board']][] = $row['id_action']; |
|
| 457 | + if (isset($row['extra']['board_to'])) { |
|
| 458 | + $boards[(int) $row['extra']['board_to']][] = $row['id_action']; |
|
| 459 | + } |
|
| 460 | + if (isset($row['extra']['board_from'])) { |
|
| 461 | + $boards[(int) $row['extra']['board_from']][] = $row['id_action']; |
|
| 462 | + } |
|
| 463 | + if (isset($row['extra']['board'])) { |
|
| 464 | + $boards[(int) $row['extra']['board']][] = $row['id_action']; |
|
| 465 | + } |
|
| 453 | 466 | |
| 454 | 467 | // A message? |
| 455 | - if (isset($row['extra']['message'])) |
|
| 456 | - $messages[(int) $row['extra']['message']][] = $row['id_action']; |
|
| 468 | + if (isset($row['extra']['message'])) { |
|
| 469 | + $messages[(int) $row['extra']['message']][] = $row['id_action']; |
|
| 470 | + } |
|
| 457 | 471 | |
| 458 | 472 | // IP Info? |
| 459 | - if (isset($row['extra']['ip_range'])) |
|
| 460 | - if ($seeIP) |
|
| 473 | + if (isset($row['extra']['ip_range'])) { |
|
| 474 | + if ($seeIP) |
|
| 461 | 475 | $row['extra']['ip_range'] = '<a href="' . $scripturl . '?action=trackip;searchip=' . $row['extra']['ip_range'] . '">' . $row['extra']['ip_range'] . '</a>'; |
| 462 | - else |
|
| 463 | - $row['extra']['ip_range'] = $txt['logged']; |
|
| 476 | + } else { |
|
| 477 | + $row['extra']['ip_range'] = $txt['logged']; |
|
| 478 | + } |
|
| 464 | 479 | |
| 465 | 480 | // Email? |
| 466 | - if (isset($row['extra']['email'])) |
|
| 467 | - $row['extra']['email'] = '<a href="mailto:' . $row['extra']['email'] . '">' . $row['extra']['email'] . '</a>'; |
|
| 481 | + if (isset($row['extra']['email'])) { |
|
| 482 | + $row['extra']['email'] = '<a href="mailto:' . $row['extra']['email'] . '">' . $row['extra']['email'] . '</a>'; |
|
| 483 | + } |
|
| 468 | 484 | |
| 469 | 485 | // Bans are complex. |
| 470 | 486 | if ($row['action'] == 'ban' || $row['action'] == 'banremove') |
| 471 | 487 | { |
| 472 | 488 | $row['action_text'] = $txt['modlog_ac_ban' . ($row['action'] == 'banremove' ? '_remove' : '')]; |
| 473 | - foreach (array('member', 'email', 'ip_range', 'hostname') as $type) |
|
| 474 | - if (isset($row['extra'][$type])) |
|
| 489 | + foreach (array('member', 'email', 'ip_range', 'hostname') as $type) { |
|
| 490 | + if (isset($row['extra'][$type])) |
|
| 475 | 491 | $row['action_text'] .= $txt['modlog_ac_ban_trigger_' . $type]; |
| 492 | + } |
|
| 476 | 493 | } |
| 477 | 494 | |
| 478 | 495 | // The array to go to the template. Note here that action is set to a "default" value of the action doesn't match anything in the descriptions. Allows easy adding of logging events with basic details. |
@@ -508,12 +525,13 @@ discard block |
||
| 508 | 525 | foreach ($boards[$row['id_board']] as $action) |
| 509 | 526 | { |
| 510 | 527 | // Make the board number into a link - dealing with moving too. |
| 511 | - if (isset($entries[$action]['extra']['board_to']) && $entries[$action]['extra']['board_to'] == $row['id_board']) |
|
| 512 | - $entries[$action]['extra']['board_to'] = '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['name'] . '</a>'; |
|
| 513 | - elseif (isset($entries[$action]['extra']['board_from']) && $entries[$action]['extra']['board_from'] == $row['id_board']) |
|
| 514 | - $entries[$action]['extra']['board_from'] = '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['name'] . '</a>'; |
|
| 515 | - elseif (isset($entries[$action]['extra']['board']) && $entries[$action]['extra']['board'] == $row['id_board']) |
|
| 516 | - $entries[$action]['extra']['board'] = '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['name'] . '</a>'; |
|
| 528 | + if (isset($entries[$action]['extra']['board_to']) && $entries[$action]['extra']['board_to'] == $row['id_board']) { |
|
| 529 | + $entries[$action]['extra']['board_to'] = '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['name'] . '</a>'; |
|
| 530 | + } elseif (isset($entries[$action]['extra']['board_from']) && $entries[$action]['extra']['board_from'] == $row['id_board']) { |
|
| 531 | + $entries[$action]['extra']['board_from'] = '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['name'] . '</a>'; |
|
| 532 | + } elseif (isset($entries[$action]['extra']['board']) && $entries[$action]['extra']['board'] == $row['id_board']) { |
|
| 533 | + $entries[$action]['extra']['board'] = '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['name'] . '</a>'; |
|
| 534 | + } |
|
| 517 | 535 | } |
| 518 | 536 | } |
| 519 | 537 | $smcFunc['db_free_result']($request); |
@@ -547,10 +565,11 @@ discard block |
||
| 547 | 565 | ); |
| 548 | 566 | |
| 549 | 567 | // Make the topic number into a link - dealing with splitting too. |
| 550 | - if (isset($this_action['extra']['topic']) && $this_action['extra']['topic'] == $row['id_topic']) |
|
| 551 | - $this_action['extra']['topic'] = '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.' . (isset($this_action['extra']['message']) ? 'msg' . $this_action['extra']['message'] . '#msg' . $this_action['extra']['message'] : '0') . '">' . $row['subject'] . '</a>'; |
|
| 552 | - elseif (isset($this_action['extra']['new_topic']) && $this_action['extra']['new_topic'] == $row['id_topic']) |
|
| 553 | - $this_action['extra']['new_topic'] = '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.' . (isset($this_action['extra']['message']) ? 'msg' . $this_action['extra']['message'] . '#msg' . $this_action['extra']['message'] : '0') . '">' . $row['subject'] . '</a>'; |
|
| 568 | + if (isset($this_action['extra']['topic']) && $this_action['extra']['topic'] == $row['id_topic']) { |
|
| 569 | + $this_action['extra']['topic'] = '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.' . (isset($this_action['extra']['message']) ? 'msg' . $this_action['extra']['message'] . '#msg' . $this_action['extra']['message'] : '0') . '">' . $row['subject'] . '</a>'; |
|
| 570 | + } elseif (isset($this_action['extra']['new_topic']) && $this_action['extra']['new_topic'] == $row['id_topic']) { |
|
| 571 | + $this_action['extra']['new_topic'] = '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.' . (isset($this_action['extra']['message']) ? 'msg' . $this_action['extra']['message'] . '#msg' . $this_action['extra']['message'] : '0') . '">' . $row['subject'] . '</a>'; |
|
| 572 | + } |
|
| 554 | 573 | } |
| 555 | 574 | } |
| 556 | 575 | $smcFunc['db_free_result']($request); |
@@ -583,8 +602,9 @@ discard block |
||
| 583 | 602 | ); |
| 584 | 603 | |
| 585 | 604 | // Make the message number into a link. |
| 586 | - if (isset($this_action['extra']['message']) && $this_action['extra']['message'] == $row['id_msg']) |
|
| 587 | - $this_action['extra']['message'] = '<a href="' . $scripturl . '?msg=' . $row['id_msg'] . '">' . $row['subject'] . '</a>'; |
|
| 605 | + if (isset($this_action['extra']['message']) && $this_action['extra']['message'] == $row['id_msg']) { |
|
| 606 | + $this_action['extra']['message'] = '<a href="' . $scripturl . '?msg=' . $row['id_msg'] . '">' . $row['subject'] . '</a>'; |
|
| 607 | + } |
|
| 588 | 608 | } |
| 589 | 609 | } |
| 590 | 610 | $smcFunc['db_free_result']($request); |
@@ -624,25 +644,29 @@ discard block |
||
| 624 | 644 | foreach ($entries as $k => $entry) |
| 625 | 645 | { |
| 626 | 646 | // Make any message info links so its easier to go find that message. |
| 627 | - if (isset($entry['extra']['message']) && (empty($entry['message']) || empty($entry['message']['id']))) |
|
| 628 | - $entries[$k]['extra']['message'] = '<a href="' . $scripturl . '?msg=' . $entry['extra']['message'] . '">' . $entry['extra']['message'] . '</a>'; |
|
| 647 | + if (isset($entry['extra']['message']) && (empty($entry['message']) || empty($entry['message']['id']))) { |
|
| 648 | + $entries[$k]['extra']['message'] = '<a href="' . $scripturl . '?msg=' . $entry['extra']['message'] . '">' . $entry['extra']['message'] . '</a>'; |
|
| 649 | + } |
|
| 629 | 650 | |
| 630 | 651 | // Mark up any deleted members, topics and boards. |
| 631 | - foreach (array('board', 'board_from', 'board_to', 'member', 'topic', 'new_topic') as $type) |
|
| 632 | - if (!empty($entry['extra'][$type]) && is_numeric($entry['extra'][$type])) |
|
| 652 | + foreach (array('board', 'board_from', 'board_to', 'member', 'topic', 'new_topic') as $type) { |
|
| 653 | + if (!empty($entry['extra'][$type]) && is_numeric($entry['extra'][$type])) |
|
| 633 | 654 | $entries[$k]['extra'][$type] = sprintf($txt['modlog_id'], $entry['extra'][$type]); |
| 655 | + } |
|
| 634 | 656 | |
| 635 | 657 | if (isset($entry['extra']['report'])) |
| 636 | 658 | { |
| 637 | 659 | // Member profile reports go in a different area |
| 638 | - if (stristr($entry['action'], 'user_report')) |
|
| 639 | - $entries[$k]['extra']['report'] = '<a href="' . $scripturl . '?action=moderate;area=reportedmembers;sa=details;rid=' . $entry['extra']['report'] . '">' . $txt['modlog_report'] . '</a>'; |
|
| 640 | - else |
|
| 641 | - $entries[$k]['extra']['report'] = '<a href="' . $scripturl . '?action=moderate;area=reportedposts;sa=details;rid=' . $entry['extra']['report'] . '">' . $txt['modlog_report'] . '</a>'; |
|
| 660 | + if (stristr($entry['action'], 'user_report')) { |
|
| 661 | + $entries[$k]['extra']['report'] = '<a href="' . $scripturl . '?action=moderate;area=reportedmembers;sa=details;rid=' . $entry['extra']['report'] . '">' . $txt['modlog_report'] . '</a>'; |
|
| 662 | + } else { |
|
| 663 | + $entries[$k]['extra']['report'] = '<a href="' . $scripturl . '?action=moderate;area=reportedposts;sa=details;rid=' . $entry['extra']['report'] . '">' . $txt['modlog_report'] . '</a>'; |
|
| 664 | + } |
|
| 642 | 665 | } |
| 643 | 666 | |
| 644 | - if (empty($entries[$k]['action_text'])) |
|
| 645 | - $entries[$k]['action_text'] = isset($txt['modlog_ac_' . $entry['action']]) ? $txt['modlog_ac_' . $entry['action']] : $entry['action']; |
|
| 667 | + if (empty($entries[$k]['action_text'])) { |
|
| 668 | + $entries[$k]['action_text'] = isset($txt['modlog_ac_' . $entry['action']]) ? $txt['modlog_ac_' . $entry['action']] : $entry['action']; |
|
| 669 | + } |
|
| 646 | 670 | $entries[$k]['action_text'] = preg_replace_callback('~\{([A-Za-z\d_]+)\}~i', |
| 647 | 671 | function ($matches) use ($entries, $k) |
| 648 | 672 | { |