@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | 'no_member' => 0, |
42 | 42 | ] |
43 | 43 | )->fetch_callback( |
44 | - function ($row) use (&$themes) { |
|
44 | + function($row) use (&$themes) { |
|
45 | 45 | if (!isset($themes[$row['id_theme']])) |
46 | 46 | { |
47 | 47 | $themes[$row['id_theme']] = [ |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | 'index_compare_explode' => 'value LIKE \'%' . implode('\' OR value LIKE \'%', $indexes) . '\'', |
85 | 85 | ]) |
86 | 86 | )->fetch_callback( |
87 | - function ($row) use (&$themes, $indexes) { |
|
87 | + function($row) use (&$themes, $indexes) { |
|
88 | 88 | // Find the right one. |
89 | 89 | foreach ($indexes as $index) |
90 | 90 | { |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | 'name' => 'name', |
125 | 125 | ] |
126 | 126 | )->fetch_callback( |
127 | - function ($row) use (&$themelist) { |
|
127 | + function($row) use (&$themelist) { |
|
128 | 128 | $themelist[$row['id_theme']] = $row['value']; |
129 | 129 | } |
130 | 130 | ); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | 'theme_dir' => 'theme_dir', |
166 | 166 | ] |
167 | 167 | )->fetch_callback( |
168 | - function ($row) use (&$themes) { |
|
168 | + function($row) use (&$themes) { |
|
169 | 169 | $themes[$row['id_theme']][$row['variable']] = $row['value']; |
170 | 170 | } |
171 | 171 | ); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | 'theme_dir' => 'theme_dir', |
214 | 214 | ] |
215 | 215 | )->fetch_callback( |
216 | - function ($row) use (&$theme_paths) { |
|
216 | + function($row) use (&$theme_paths) { |
|
217 | 217 | $theme_paths[(int) $row['id_theme']][$row['variable']] = $row['value']; |
218 | 218 | } |
219 | 219 | ); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | 'name' => 'name', |
248 | 248 | ] |
249 | 249 | )->fetch_callback( |
250 | - function ($row) use (&$themes, $knownThemes) { |
|
250 | + function($row) use (&$themes, $knownThemes) { |
|
251 | 251 | $themes[] = [ |
252 | 252 | 'id' => $row['id_theme'], |
253 | 253 | 'name' => $row['name'], |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | 'install_id' => $id, |
282 | 282 | ] |
283 | 283 | )->fetch_callback( |
284 | - function ($row) use (&$themes) { |
|
284 | + function($row) use (&$themes) { |
|
285 | 285 | $themes = explode(',', $row['themes_installed']); |
286 | 286 | } |
287 | 287 | ); |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | 'known_themes' => !empty($modSettings['theme_allow']) || allowedTo('admin_forum') ? explode(',', $modSettings['knownThemes']) : [$modSettings['theme_guests']], |
351 | 351 | ] |
352 | 352 | )->fetch_callback( |
353 | - function ($row) use (&$available_themes, $current_theme) { |
|
353 | + function($row) use (&$available_themes, $current_theme) { |
|
354 | 354 | if (!isset($available_themes[$row['id_theme']])) |
355 | 355 | { |
356 | 356 | $row['id_theme'] = (int) $row['id_theme']; |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | ORDER BY id_theme DESC', |
388 | 388 | [] |
389 | 389 | )->fetch_callback( |
390 | - function ($row) use (&$available_themes, $guest_theme) { |
|
390 | + function($row) use (&$available_themes, $guest_theme) { |
|
391 | 391 | global $modSettings; |
392 | 392 | |
393 | 393 | // Figure out which theme it is they are REALLY using. |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | 'id_member' => isset($_REQUEST['sa']) && $_REQUEST['sa'] === 'pick' ? [-1, $current_member] : [-1], |
428 | 428 | ] |
429 | 429 | )->fetch_callback( |
430 | - function ($row) use (&$variant_preferences) { |
|
430 | + function($row) use (&$variant_preferences) { |
|
431 | 431 | $variant_preferences[$row['id_theme']] = $row['value']; |
432 | 432 | } |
433 | 433 | ); |
@@ -851,7 +851,7 @@ discard block |
||
851 | 851 | 'variables' => $variables, |
852 | 852 | ] |
853 | 853 | )->fetch_callback( |
854 | - function ($row) use (&$options) { |
|
854 | + function($row) use (&$options) { |
|
855 | 855 | $options[$row['variable']] = $row['value']; |
856 | 856 | } |
857 | 857 | ); |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | 'is_active' => 1, |
369 | 369 | ) |
370 | 370 | )->fetch_callback( |
371 | - function ($row) use (&$custom_fields) { |
|
371 | + function($row) use (&$custom_fields) { |
|
372 | 372 | $custom_fields[] = $row['col_name']; |
373 | 373 | } |
374 | 374 | ); |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | 'id_board' => 0, |
524 | 524 | ) |
525 | 525 | )->fetch_callback( |
526 | - function ($row) use (&$notification_current) { |
|
526 | + function($row) use (&$notification_current) { |
|
527 | 527 | $notification_current[] = $row['id_board']; |
528 | 528 | } |
529 | 529 | ); |
@@ -1387,7 +1387,7 @@ discard block |
||
1387 | 1387 | 'is_protected' => 1, |
1388 | 1388 | ) |
1389 | 1389 | )->fetch_callback( |
1390 | - function ($row) use (&$protected_groups) { |
|
1390 | + function($row) use (&$protected_groups) { |
|
1391 | 1391 | $protected_groups[] = (int) $row['id_group']; |
1392 | 1392 | } |
1393 | 1393 | ); |
@@ -1513,7 +1513,7 @@ discard block |
||
1513 | 1513 | 'warning' => 'warning', |
1514 | 1514 | ) |
1515 | 1515 | )->fetch_callback( |
1516 | - function ($row) use (&$previous_warnings) { |
|
1516 | + function($row) use (&$previous_warnings) { |
|
1517 | 1517 | $previous_warnings[] = array( |
1518 | 1518 | 'issuer' => array( |
1519 | 1519 | 'id' => $row['id_member'], |
@@ -1617,7 +1617,7 @@ discard block |
||
1617 | 1617 | 'limit' => $items_per_page, |
1618 | 1618 | ) |
1619 | 1619 | )->fetch_callback( |
1620 | - function ($row) use (&$attachments) { |
|
1620 | + function($row) use (&$attachments) { |
|
1621 | 1621 | global $txt, $settings, $modSettings; |
1622 | 1622 | |
1623 | 1623 | $row['subject'] = censor($row['subject']); |
@@ -1732,7 +1732,7 @@ discard block |
||
1732 | 1732 | 'limit' => $items_per_page, |
1733 | 1733 | ) |
1734 | 1734 | )->fetch_callback( |
1735 | - function ($row) use (&$topics) { |
|
1735 | + function($row) use (&$topics) { |
|
1736 | 1736 | $topics[] = $row['id_topic']; |
1737 | 1737 | } |
1738 | 1738 | ); |
@@ -1754,7 +1754,7 @@ discard block |
||
1754 | 1754 | 'topics' => $topics, |
1755 | 1755 | ) |
1756 | 1756 | )->fetch_callback( |
1757 | - function ($row) use (&$topicsInfo) { |
|
1757 | + function($row) use (&$topicsInfo) { |
|
1758 | 1758 | $topicsInfo[] = $row; |
1759 | 1759 | } |
1760 | 1760 | ); |
@@ -2115,7 +2115,7 @@ discard block |
||
2115 | 2115 | 'newbie_group' => 4, |
2116 | 2116 | ) |
2117 | 2117 | )->fetch_callback( |
2118 | - function ($row) use (&$general_permission) { |
|
2118 | + function($row) use (&$general_permission) { |
|
2119 | 2119 | global $txt; |
2120 | 2120 | |
2121 | 2121 | // We don't know about this permission, it doesn't exist :P. |
@@ -2199,7 +2199,7 @@ discard block |
||
2199 | 2199 | 'moderator_group' => 3, |
2200 | 2200 | ) |
2201 | 2201 | )->fetch_callback( |
2202 | - function ($row) use (&$board_permission, $board) { |
|
2202 | + function($row) use (&$board_permission, $board) { |
|
2203 | 2203 | global $txt; |
2204 | 2204 | |
2205 | 2205 | // We don't know about this permission, it doesn't exist :P. |
@@ -2298,7 +2298,7 @@ discard block |
||
2298 | 2298 | 'max_msg_member' => $max_msg_member ?? 0, |
2299 | 2299 | ) |
2300 | 2300 | )->fetch_callback( |
2301 | - function ($row) use (&$ips) { |
|
2301 | + function($row) use (&$ips) { |
|
2302 | 2302 | $ips[] = $row['poster_ip']; |
2303 | 2303 | } |
2304 | 2304 | ); |
@@ -2315,7 +2315,7 @@ discard block |
||
2315 | 2315 | 'current_member' => $memID, |
2316 | 2316 | ) |
2317 | 2317 | )->fetch_callback( |
2318 | - function ($row) use (&$error_ips) { |
|
2318 | + function($row) use (&$error_ips) { |
|
2319 | 2319 | $error_ips[] = $row['ip']; |
2320 | 2320 | } |
2321 | 2321 | ); |
@@ -2351,7 +2351,7 @@ discard block |
||
2351 | 2351 | 'ip_list' => $ips, |
2352 | 2352 | ) |
2353 | 2353 | )->fetch_callback( |
2354 | - function ($row) use (&$message_members) { |
|
2354 | + function($row) use (&$message_members) { |
|
2355 | 2355 | $message_members[] = $row['id_member']; |
2356 | 2356 | } |
2357 | 2357 | ); |
@@ -2368,7 +2368,7 @@ discard block |
||
2368 | 2368 | 'ip_list' => $ips, |
2369 | 2369 | ) |
2370 | 2370 | )->fetch_callback( |
2371 | - function ($row) use (&$message_members) { |
|
2371 | + function($row) use (&$message_members) { |
|
2372 | 2372 | $message_members[] = $row['id_member']; |
2373 | 2373 | } |
2374 | 2374 | ); |
@@ -2502,7 +2502,8 @@ |
||
2502 | 2502 | * |
2503 | 2503 | * @return bool Returns true if the email address is unique, false otherwise |
2504 | 2504 | */ |
2505 | -function isUniqueEmail($memID, $email) { |
|
2505 | +function isUniqueEmail($memID, $email) |
|
2506 | +{ |
|
2506 | 2507 | $db = database(); |
2507 | 2508 | |
2508 | 2509 | // Email addresses should be and stay unique. |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | 'all_year_dec' => '0004-12-31', |
278 | 278 | ) |
279 | 279 | )->fetch_callback( |
280 | - function ($row) use (&$holidays, $low_date, $high_date) { |
|
280 | + function($row) use (&$holidays, $low_date, $high_date) { |
|
281 | 281 | if (substr($low_date, 0, 4) != substr($high_date, 0, 4)) |
282 | 282 | { |
283 | 283 | $event_year = substr($row['event_date'], 5) < substr($high_date, 5) ? substr($high_date, 0, 4) : substr($low_date, 0, 4); |
@@ -1337,7 +1337,7 @@ discard block |
||
1337 | 1337 | 'selected_holiday' => $id_holiday, |
1338 | 1338 | ) |
1339 | 1339 | )->fetch_callback( |
1340 | - function ($row) use (&$holiday) { |
|
1340 | + function($row) use (&$holiday) { |
|
1341 | 1341 | $holiday = array( |
1342 | 1342 | 'id' => $row['id_holiday'], |
1343 | 1343 | 'day' => (int) $row['day'], |
@@ -432,7 +432,7 @@ |
||
432 | 432 | 'value' => $txt['scheduled_log_completed'], |
433 | 433 | ), |
434 | 434 | 'data' => array( |
435 | - 'function' => static function ($rowData) { |
|
435 | + 'function' => static function($rowData) { |
|
436 | 436 | global $txt; |
437 | 437 | |
438 | 438 | return '<i class="icon ' . ($rowData['task_completed'] ? 'i-check' : 'i-fail') . '" title="' . sprintf($txt[$rowData['task_completed'] ? 'maintain_done' : 'maintain_fail'], $rowData['name']) . '" />'; |
@@ -219,7 +219,7 @@ |
||
219 | 219 | 'class' => 'centertext', |
220 | 220 | ), |
221 | 221 | 'data' => array( |
222 | - 'function' => static function ($news) { |
|
222 | + 'function' => static function($news) { |
|
223 | 223 | if (is_numeric($news['id'])) |
224 | 224 | { |
225 | 225 | return '<input type="checkbox" name="remove[]" value="' . $news['id'] . '" class="input_check" />'; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | 'value' => $txt['membergroups_name'], |
145 | 145 | ), |
146 | 146 | 'data' => array( |
147 | - 'function' => static function ($rowData) { |
|
147 | + 'function' => static function($rowData) { |
|
148 | 148 | // Since the moderator group has no explicit members, no link is needed. |
149 | 149 | if ($rowData['id_group'] === 3) |
150 | 150 | { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | 'value' => $txt['membergroups_icons'], |
178 | 178 | ), |
179 | 179 | 'data' => array( |
180 | - 'function' => static function ($rowData) { |
|
180 | + 'function' => static function($rowData) { |
|
181 | 181 | global $settings; |
182 | 182 | |
183 | 183 | if (empty($rowData['icons'][0])) |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | 'value' => $txt['membergroups_members_top'], |
204 | 204 | ), |
205 | 205 | 'data' => array( |
206 | - 'function' => static function ($rowData) { |
|
206 | + 'function' => static function($rowData) { |
|
207 | 207 | global $txt; |
208 | 208 | // No explicit members for the moderator group. |
209 | 209 | return $rowData['id_group'] === 3 ? $txt['membergroups_guests_na'] : comma_format($rowData['num_members']); |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | 'value' => $txt['membergroups_icons'], |
278 | 278 | ), |
279 | 279 | 'data' => array( |
280 | - 'function' => static function ($rowData) { |
|
280 | + 'function' => static function($rowData) { |
|
281 | 281 | global $settings; |
282 | 282 | |
283 | 283 | if (empty($rowData['icons'][0])) |
@@ -684,7 +684,7 @@ |
||
684 | 684 | $server = $server === 'localhost' ? '127.0.0.1' : $server; |
685 | 685 | $port = empty($modSettings['sphinxql_searchd_port']) ? '9306' : $modSettings['sphinxql_searchd_port']; |
686 | 686 | |
687 | - set_error_handler(static function () { /* ignore errors */ }); |
|
687 | + set_error_handler(static function() { /* ignore errors */ }); |
|
688 | 688 | try |
689 | 689 | { |
690 | 690 | $result = mysqli_connect($server, '', '', '', (int) $port); |
@@ -281,14 +281,14 @@ discard block |
||
281 | 281 | 'items_per_page' => 20, |
282 | 282 | 'base_href' => getUrl('admin', ['action' => 'admin', 'area' => 'paidsubscribe', 'sa' => 'view']), |
283 | 283 | 'get_items' => array( |
284 | - 'function' => static function () { |
|
284 | + 'function' => static function() { |
|
285 | 285 | global $context; |
286 | 286 | |
287 | 287 | return $context['subscriptions']; |
288 | 288 | }, |
289 | 289 | ), |
290 | 290 | 'get_count' => array( |
291 | - 'function' => static function () { |
|
291 | + 'function' => static function() { |
|
292 | 292 | global $context; |
293 | 293 | |
294 | 294 | return count($context['subscriptions']); |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | 'value' => $txt['paid_cost'], |
311 | 311 | ), |
312 | 312 | 'data' => array( |
313 | - 'function' => static function ($rowData) { |
|
313 | + 'function' => static function($rowData) { |
|
314 | 314 | global $txt; |
315 | 315 | |
316 | 316 | return $rowData['flexible'] ? '<em>' . $txt['flexible'] . '</em>' : $rowData['cost'] . ' / ' . $rowData['length']; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | 'value' => $txt['paid_is_active'], |
348 | 348 | ), |
349 | 349 | 'data' => array( |
350 | - 'function' => static function ($rowData) { |
|
350 | + 'function' => static function($rowData) { |
|
351 | 351 | global $txt; |
352 | 352 | |
353 | 353 | return '<span class="' . ($rowData['active'] ? 'success' : 'alert') . '">' . ($rowData['active'] ? $txt['yes'] : $txt['no']) . '</span>'; |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | 'value' => $txt['subscribers'], |
360 | 360 | ), |
361 | 361 | 'data' => array( |
362 | - 'function' => static function ($rowData) { |
|
362 | + 'function' => static function($rowData) { |
|
363 | 363 | global $txt; |
364 | 364 | |
365 | 365 | return '<a href="' . getUrl('admin', ['action' => 'admin', 'area' => 'paidsubscribe', 'sa' => 'viewsub', 'sid' => $rowData['id']]) . '"><i class="icon i-view" title="' . $txt['view'] . '"></i></a>'; |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | 'value' => $txt['modify'], |
373 | 373 | ), |
374 | 374 | 'data' => array( |
375 | - 'function' => static function ($rowData) { |
|
375 | + 'function' => static function($rowData) { |
|
376 | 376 | global $txt; |
377 | 377 | |
378 | 378 | return '<a href="' . getUrl('admin', ['action' => 'admin', 'area' => 'paidsubscribe', 'sa' => 'modify', 'sid' => $rowData['id']]) . '"><i class="icon i-modify" title="' . $txt['modify'] . '"></i></a>'; |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | 'value' => $txt['remove'] |
386 | 386 | ), |
387 | 387 | 'data' => array( |
388 | - 'function' => static function ($rowData) { |
|
388 | + 'function' => static function($rowData) { |
|
389 | 389 | global $txt; |
390 | 390 | |
391 | 391 | return '<a href="' . getUrl('admin', ['action' => 'admin', 'area' => 'paidsubscribe', 'sa' => 'modify', 'delete', 'sid' => $rowData['id']]) . '"><i class="icon i-delete" title="' . $txt['delete'] . '"></i></a>'; |
@@ -945,7 +945,7 @@ discard block |
||
945 | 945 | 'style' => 'width: 20%;', |
946 | 946 | ), |
947 | 947 | 'data' => array( |
948 | - 'function' => static function ($rowData) { |
|
948 | + 'function' => static function($rowData) { |
|
949 | 949 | global $txt; |
950 | 950 | return $rowData['id_member'] == 0 ? $txt['guest'] : '<a href="' . getUrl('profile', ['action' => 'profile', 'u' => $rowData['id_member'], 'name' => $rowData['name']]) . '">' . $rowData['name'] . '</a>'; |
951 | 951 | }, |
@@ -1016,7 +1016,7 @@ discard block |
||
1016 | 1016 | 'value' => $txt['edit_subscriber'], |
1017 | 1017 | ), |
1018 | 1018 | 'data' => array( |
1019 | - 'function' => static function ($rowData) { |
|
1019 | + 'function' => static function($rowData) { |
|
1020 | 1020 | global $txt; |
1021 | 1021 | return '<a href="' . getUrl('admin', ['action' => 'admin', 'area' => 'paidsubscribe', 'sa' => '=modifyuser', 'lid' => $rowData['id']]) . '">' . $txt['modify'] . '</a>'; |
1022 | 1022 | }, |
@@ -1336,7 +1336,7 @@ |
||
1336 | 1336 | 'value' => $txt['hooks_field_function_name'], |
1337 | 1337 | ), |
1338 | 1338 | 'data' => array( |
1339 | - 'function' => static function ($data) { |
|
1339 | + 'function' => static function($data) { |
|
1340 | 1340 | global $txt; |
1341 | 1341 | |
1342 | 1342 | if (!empty($data['included_file'])) |