@@ -420,7 +420,7 @@ |
||
| 420 | 420 | $board['last_post']['last_post_message'] = sprintf($txt['last_post_message'], $board['last_post']['member']['link'], $board['last_post']['link'], $board['last_post']['time'] > 0 ? timeformat($board['last_post']['time']) : $txt['not_applicable']); |
| 421 | 421 | } |
| 422 | 422 | } |
| 423 | - else |
|
| 423 | + else |
|
| 424 | 424 | foreach ($this_category as &$board) |
| 425 | 425 | { |
| 426 | 426 | if (!empty($moderators[$board['id']])) |
@@ -285,7 +285,7 @@ |
||
| 285 | 285 | { |
| 286 | 286 | /** |
| 287 | 287 | * Constants for notfication types. |
| 288 | - */ |
|
| 288 | + */ |
|
| 289 | 289 | const RECEIVE_NOTIFY_EMAIL = 0x02; |
| 290 | 290 | const RECEIVE_NOTIFY_ALERT = 0x01; |
| 291 | 291 | |
@@ -428,21 +428,28 @@ |
||
| 428 | 428 | * @param $index to use as index if specified |
| 429 | 429 | * @return array of values of specified $col from $array |
| 430 | 430 | */ |
| 431 | -if (!function_exists('array_column')) { |
|
| 432 | - function array_column($input, $column_key, $index_key = null) { |
|
| 433 | - $arr = array_map(function($d) use ($column_key, $index_key) { |
|
| 434 | - if (!isset($d[$column_key])) { |
|
| 431 | +if (!function_exists('array_column')) |
|
| 432 | +{ |
|
| 433 | + function array_column($input, $column_key, $index_key = null) |
|
| 434 | + { |
|
| 435 | + $arr = array_map(function($d) use ($column_key, $index_key) |
|
| 436 | + { |
|
| 437 | + if (!isset($d[$column_key])) |
|
| 438 | + { |
|
| 435 | 439 | return null; |
| 436 | 440 | } |
| 437 | - if ($index_key !== null) { |
|
| 441 | + if ($index_key !== null) |
|
| 442 | + { |
|
| 438 | 443 | return array($d[$index_key] => $d[$column_key]); |
| 439 | 444 | } |
| 440 | 445 | return $d[$column_key]; |
| 441 | 446 | }, $input); |
| 442 | 447 | |
| 443 | - if ($index_key !== null) { |
|
| 448 | + if ($index_key !== null) |
|
| 449 | + { |
|
| 444 | 450 | $tmp = array(); |
| 445 | - foreach ($arr as $ar) { |
|
| 451 | + foreach ($arr as $ar) |
|
| 452 | + { |
|
| 446 | 453 | $tmp[key($ar)] = current($ar); |
| 447 | 454 | } |
| 448 | 455 | $arr = $tmp; |
@@ -372,7 +372,7 @@ |
||
| 372 | 372 | // And a bit more for database changes. |
| 373 | 373 | if ($context['uninstalling'] && !empty($context['database_changes'])) |
| 374 | 374 | echo ' |
| 375 | - makeToggle(document.getElementById(\'db_changes_div\'), ', JavaScriptEscape($txt['package_db_uninstall_details']) , ');'; |
|
| 375 | + makeToggle(document.getElementById(\'db_changes_div\'), ', JavaScriptEscape($txt['package_db_uninstall_details']), ');'; |
|
| 376 | 376 | |
| 377 | 377 | echo ' |
| 378 | 378 | </script>'; |
@@ -742,7 +742,7 @@ |
||
| 742 | 742 | |
| 743 | 743 | // Filter out any redundant separators before we start the loop |
| 744 | 744 | $context['config_vars'] = array_filter($context['config_vars'], function ($v) use ($context) |
| 745 | - { |
|
| 745 | + { |
|
| 746 | 746 | static $config_vars, $prev; |
| 747 | 747 | |
| 748 | 748 | $at_start = is_null($config_vars); |
@@ -741,7 +741,7 @@ |
||
| 741 | 741 | <div class="information noup">', $context['settings_message'], '</div>'; |
| 742 | 742 | |
| 743 | 743 | // Filter out any redundant separators before we start the loop |
| 744 | - $context['config_vars'] = array_filter($context['config_vars'], function ($v) use ($context) |
|
| 744 | + $context['config_vars'] = array_filter($context['config_vars'], function($v) use ($context) |
|
| 745 | 745 | { |
| 746 | 746 | static $config_vars, $prev; |
| 747 | 747 | |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | </div>'; |
| 108 | 108 | |
| 109 | 109 | // Show the last post if there is one. |
| 110 | - if(!empty($board['last_post']['id'])) |
|
| 110 | + if (!empty($board['last_post']['id'])) |
|
| 111 | 111 | echo' |
| 112 | 112 | <div class="lastpost lpr_border"> |
| 113 | 113 | ', function_exists('template_bi_' . $board['type'] . '_lastpost') ? call_user_func('template_bi_' . $board['type'] . '_lastpost', $board) : template_bi_board_lastpost($board), ' |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | </div>'; |
| 51 | 51 | |
| 52 | 52 | // Show the last post if there is one. |
| 53 | - if(!empty($board['last_post']['id'])) |
|
| 53 | + if (!empty($board['last_post']['id'])) |
|
| 54 | 54 | echo ' |
| 55 | 55 | <div class="lastpost lpr_border"> |
| 56 | 56 | ', function_exists('template_bi_' . $board['type'] . '_lastpost') ? call_user_func('template_bi_' . $board['type'] . '_lastpost', $board) : template_bi_board_lastpost($board), ' |
@@ -1826,7 +1826,7 @@ |
||
| 1826 | 1826 | if (!empty($excluded_groups)) |
| 1827 | 1827 | { |
| 1828 | 1828 | // Make sure this is an array of integers |
| 1829 | - $excluded_groups = array_filter((array) $excluded_groups, function ($v) |
|
| 1829 | + $excluded_groups = array_filter((array) $excluded_groups, function($v) |
|
| 1830 | 1830 | { |
| 1831 | 1831 | return is_int($v) || is_string($v) && (string) intval($v) === $v; |
| 1832 | 1832 | }); |
@@ -1827,7 +1827,7 @@ |
||
| 1827 | 1827 | { |
| 1828 | 1828 | // Make sure this is an array of integers |
| 1829 | 1829 | $excluded_groups = array_filter((array) $excluded_groups, function ($v) |
| 1830 | - { |
|
| 1830 | + { |
|
| 1831 | 1831 | return is_int($v) || is_string($v) && (string) intval($v) === $v; |
| 1832 | 1832 | }); |
| 1833 | 1833 | |
@@ -975,7 +975,7 @@ |
||
| 975 | 975 | else |
| 976 | 976 | { |
| 977 | 977 | $return = array(); |
| 978 | - while($row = mysqli_fetch_assoc($request)) |
|
| 978 | + while ($row = mysqli_fetch_assoc($request)) |
|
| 979 | 979 | $return[] = $row; |
| 980 | 980 | } |
| 981 | 981 | return !empty($return) ? $return : array(); |