@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | // Get everything started up... |
27 | 27 | define('SMF', 1); |
28 | -if (function_exists('set_magic_quotes_runtime') && strnatcmp(phpversion(),'5.3.0') < 0) |
|
28 | +if (function_exists('set_magic_quotes_runtime') && strnatcmp(phpversion(), '5.3.0') < 0) |
|
29 | 29 | @set_magic_quotes_runtime(0); |
30 | 30 | error_reporting(defined('E_STRICT') ? E_ALL | E_STRICT : E_ALL); |
31 | 31 | $time_start = microtime(); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | if (!empty($modSettings['enableCompressedOutput']) && !headers_sent()) |
91 | 91 | { |
92 | 92 | // If zlib is being used, turn off output compression. |
93 | - if (ini_get('zlib.output_compression') >= 1 || ini_get('output_handler') == 'ob_gzhandler') |
|
93 | + if (ini_get('zlib.output_compression') >= 1 || ini_get('output_handler') == 'ob_gzhandler') |
|
94 | 94 | $modSettings['enableCompressedOutput'] = '0'; |
95 | 95 | else |
96 | 96 | { |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | col_name, field_name, field_desc, field_type, field_order, show_reg, field_length, field_options, |
883 | 883 | default_value, bbc, enclose, placement |
884 | 884 | FROM {db_prefix}custom_fields |
885 | - WHERE ' . $where .' |
|
885 | + WHERE ' . $where . ' |
|
886 | 886 | ORDER BY field_order', |
887 | 887 | array( |
888 | 888 | 'area' => $area, |
@@ -950,7 +950,7 @@ discard block |
||
950 | 950 | else |
951 | 951 | { |
952 | 952 | @list ($rows, $cols) = @explode(',', $row['default_value']); |
953 | - $input_html = '<textarea name="customfield[' . $row['col_name'] . ']" id="customfield[' . $row['col_name'] . ']"' . (!empty($rows) ? ' rows="' . $rows . '"' : '') . (!empty($cols) ? ' cols="' . $cols . '"' : '') . ($row['show_reg'] == 2 ? ' required' : '' ). '>' . un_htmlspecialchars($value) . '</textarea>'; |
|
953 | + $input_html = '<textarea name="customfield[' . $row['col_name'] . ']" id="customfield[' . $row['col_name'] . ']"' . (!empty($rows) ? ' rows="' . $rows . '"' : '') . (!empty($cols) ? ' cols="' . $cols . '"' : '') . ($row['show_reg'] == 2 ? ' required' : '') . '>' . un_htmlspecialchars($value) . '</textarea>'; |
|
954 | 954 | } |
955 | 955 | |
956 | 956 | // Parse BBCode |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | 'items_per_page' => $modSettings['defaultMaxListItems'], |
263 | 263 | 'base_href' => $scripturl . '?action=admin;area=paidsubscribe;sa=view', |
264 | 264 | 'get_items' => array( |
265 | - 'function' => function ($start, $items_per_page) use ($context) |
|
265 | + 'function' => function($start, $items_per_page) use ($context) |
|
266 | 266 | { |
267 | 267 | $subscriptions = array(); |
268 | 268 | $counter = 0; |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | }, |
282 | 282 | ), |
283 | 283 | 'get_count' => array( |
284 | - 'function' => function () use ($context) |
|
284 | + 'function' => function() use ($context) |
|
285 | 285 | { |
286 | 286 | return count($context['subscriptions']); |
287 | 287 | }, |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | 'style' => 'width: 35%;', |
295 | 295 | ), |
296 | 296 | 'data' => array( |
297 | - 'function' => function ($rowData) use ($scripturl) |
|
297 | + 'function' => function($rowData) use ($scripturl) |
|
298 | 298 | { |
299 | 299 | return sprintf('<a href="%1$s?action=admin;area=paidsubscribe;sa=viewsub;sid=%2$s">%3$s</a>', $scripturl, $rowData['id'], $rowData['name']); |
300 | 300 | }, |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | 'value' => $txt['paid_cost'], |
306 | 306 | ), |
307 | 307 | 'data' => array( |
308 | - 'function' => function ($rowData) use ($txt) |
|
308 | + 'function' => function($rowData) use ($txt) |
|
309 | 309 | { |
310 | 310 | return $rowData['flexible'] ? '<em>' . $txt['flexible'] . '</em>' : $rowData['cost'] . ' / ' . $rowData['length']; |
311 | 311 | }, |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | 'class' => 'centercol', |
349 | 349 | ), |
350 | 350 | 'data' => array( |
351 | - 'function' => function ($rowData) use ($txt) |
|
351 | + 'function' => function($rowData) use ($txt) |
|
352 | 352 | { |
353 | 353 | return '<span style="color: ' . ($rowData['active'] ? 'green' : 'red') . '">' . ($rowData['active'] ? $txt['yes'] : $txt['no']) . '</span>'; |
354 | 354 | }, |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | ), |
358 | 358 | 'modify' => array( |
359 | 359 | 'data' => array( |
360 | - 'function' => function ($rowData) use ($txt, $scripturl) |
|
360 | + 'function' => function($rowData) use ($txt, $scripturl) |
|
361 | 361 | { |
362 | 362 | return '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modify;sid=' . $rowData['id'] . '">' . $txt['modify'] . '</a>'; |
363 | 363 | }, |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | ), |
367 | 367 | 'delete' => array( |
368 | 368 | 'data' => array( |
369 | - 'function' => function ($rowData) use ($scripturl, $txt) |
|
369 | + 'function' => function($rowData) use ($scripturl, $txt) |
|
370 | 370 | { |
371 | 371 | return '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modify;delete;sid=' . $rowData['id'] . '">' . $txt['delete'] . '</a>'; |
372 | 372 | }, |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | 'style' => 'width: 20%;', |
824 | 824 | ), |
825 | 825 | 'data' => array( |
826 | - 'function' => function ($rowData) use ($scripturl, $txt) |
|
826 | + 'function' => function($rowData) use ($scripturl, $txt) |
|
827 | 827 | { |
828 | 828 | return $rowData['id_member'] == 0 ? $txt['guest'] : '<a href="' . $scripturl . '?action=profile;u=' . $rowData['id_member'] . '">' . $rowData['name'] . '</a>'; |
829 | 829 | }, |
@@ -893,7 +893,7 @@ discard block |
||
893 | 893 | 'class' => 'centercol', |
894 | 894 | ), |
895 | 895 | 'data' => array( |
896 | - 'function' => function ($rowData) use ($scripturl, $txt) |
|
896 | + 'function' => function($rowData) use ($scripturl, $txt) |
|
897 | 897 | { |
898 | 898 | return '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $rowData['id'] . '">' . $txt['modify'] . '</a>'; |
899 | 899 | }, |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | 'class' => 'centercol', |
907 | 907 | ), |
908 | 908 | 'data' => array( |
909 | - 'function' => function ($rowData) |
|
909 | + 'function' => function($rowData) |
|
910 | 910 | { |
911 | 911 | return '<input type="checkbox" name="delsub[' . $rowData['id'] . ']" class="input_check">'; |
912 | 912 | }, |
@@ -1950,7 +1950,7 @@ discard block |
||
1950 | 1950 | { |
1951 | 1951 | while (($file = readdir($dh)) !== false) |
1952 | 1952 | { |
1953 | - if (is_file($sourcedir .'/'. $file) && preg_match('~^Subscriptions-([A-Za-z\d]+)\.php$~', $file, $matches)) |
|
1953 | + if (is_file($sourcedir . '/' . $file) && preg_match('~^Subscriptions-([A-Za-z\d]+)\.php$~', $file, $matches)) |
|
1954 | 1954 | { |
1955 | 1955 | // Check this is definitely a valid gateway! |
1956 | 1956 | $fp = fopen($sourcedir . '/' . $file, 'rb'); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | // Just send a generic message. |
77 | 77 | else |
78 | 78 | $this->setResponse(array( |
79 | - 'text' => $this->_sa == 'add' ? 'attach_error_title' : 'attached_file_deleted_error', |
|
79 | + 'text' => $this->_sa == 'add' ? 'attach_error_title' : 'attached_file_deleted_error', |
|
80 | 80 | 'type' => 'error', |
81 | 81 | 'data' => false, |
82 | 82 | )); |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | // Gotta urlencode the filename. |
405 | 405 | if ($this->_attachResults) |
406 | 406 | foreach ($this->_attachResults as $k => $v) |
407 | - $this->_attachResults[$k]['name'] = urlencode($this->_attachResults[$k]['name']); |
|
407 | + $this->_attachResults[$k]['name'] = urlencode($this->_attachResults[$k]['name']); |
|
408 | 408 | |
409 | 409 | $this->_response = array( |
410 | 410 | 'files' => $this->_attachResults ? $this->_attachResults : false, |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | ob_start(); |
432 | 432 | |
433 | 433 | // Set the header. |
434 | - header('Content-Type: application/json; charset='. $context['character_set'] .''); |
|
434 | + header('Content-Type: application/json; charset=' . $context['character_set'] . ''); |
|
435 | 435 | |
436 | 436 | echo json_encode($this->_response ? $this->_response : array()); |
437 | 437 |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | if (filemtime($boarddir . '/db_last_error.php') === $last_db_error_change) |
176 | 176 | { |
177 | 177 | // Write the change |
178 | - $write_db_change = '<' . '?' . "php\n" . '$db_last_error = ' . time() . ';' . "\n" . '?' . '>'; |
|
178 | + $write_db_change = '<' . '?' . "php\n" . '$db_last_error = ' . time() . ';' . "\n" . '?' . '>'; |
|
179 | 179 | $written_bytes = file_put_contents($boarddir . '/db_last_error.php', $write_db_change, LOCK_EX); |
180 | 180 | |
181 | 181 | // survey says ... |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | ', $txt['debug_language_files'], count($context['debug']['language_files']), ': <em>', implode('</em>, <em>', $context['debug']['language_files']), '</em>.<br> |
249 | 249 | ', $txt['debug_stylesheets'], count($context['debug']['sheets']), ': <em>', implode('</em>, <em>', $context['debug']['sheets']), '</em>.<br> |
250 | 250 | ', $txt['debug_hooks'], empty($context['debug']['hooks']) ? 0 : count($context['debug']['hooks']) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_hooks\').style.display = \'inline\'; this.style.display = \'none\'; return false;">', $txt['debug_show'], '</a><span id="debug_hooks" style="display: none;"><em>' . implode('</em>, <em>', $context['debug']['hooks']), '</em></span>)', '<br> |
251 | - ',(isset($context['debug']['instances']) ? ($txt['debug_instances'] . (empty($context['debug']['instances']) ? 0 : count($context['debug']['instances'])) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_instances\').style.display = \'inline\'; this.style.display = \'none\'; return false;">'. $txt['debug_show'] .'</a><span id="debug_instances" style="display: none;"><em>'. implode('</em>, <em>', array_keys($context['debug']['instances'])) .'</em></span>)'. '<br>') : ''),' |
|
251 | + ',(isset($context['debug']['instances']) ? ($txt['debug_instances'] . (empty($context['debug']['instances']) ? 0 : count($context['debug']['instances'])) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_instances\').style.display = \'inline\'; this.style.display = \'none\'; return false;">' . $txt['debug_show'] . '</a><span id="debug_instances" style="display: none;"><em>' . implode('</em>, <em>', array_keys($context['debug']['instances'])) . '</em></span>)' . '<br>') : ''), ' |
|
252 | 252 | ', $txt['debug_files_included'], count($files), ' - ', round($total_size / 1024), $txt['debug_kb'], ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_include_info\').style.display = \'inline\'; this.style.display = \'none\'; return false;">', $txt['debug_show'], '</a><span id="debug_include_info" style="display: none;"><em>', implode('</em>, <em>', $files), '</em></span>)<br>'; |
253 | 253 | |
254 | 254 | if (function_exists('memory_get_peak_usage')) |
@@ -208,7 +208,7 @@ |
||
208 | 208 | } |
209 | 209 | } |
210 | 210 | |
211 | - $ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? ( ' |
|
211 | + $ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? (' |
|
212 | 212 | INSERT IGNORE INTO {db_prefix}' . $search_data['insert_into'] . ' |
213 | 213 | (' . implode(', ', array_keys($query_select)) . ')') : '') . ' |
214 | 214 | SELECT ' . implode(', ', $query_select) . ' |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | // Get the report details. |
188 | 188 | $report = getReportDetails($report_id); |
189 | 189 | |
190 | - if(!$report) |
|
190 | + if (!$report) |
|
191 | 191 | fatal_lang_error('mc_no_modreport_found'); |
192 | 192 | |
193 | 193 | // Build the report data - basic details first, then extra stuff based on the type |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | if ($context['report_type'] == 'members') |
251 | 251 | { |
252 | 252 | // Find their ID in the serialized action string... |
253 | - $user_id_length = strlen((string)$context['report']['user']['id']); |
|
253 | + $user_id_length = strlen((string) $context['report']['user']['id']); |
|
254 | 254 | $member = 's:6:"member";s:' . $user_id_length . ':"' . $context['report']['user']['id'] . '";}'; |
255 | 255 | |
256 | 256 | $params = array( |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | // What are we gonna do? |
530 | 530 | $action = isset($_GET['ignore']) ? 'ignore' : 'closed'; |
531 | 531 | |
532 | - validateToken('mod-report-'. $action, 'get'); |
|
532 | + validateToken('mod-report-' . $action, 'get'); |
|
533 | 533 | |
534 | 534 | // Are we ignore or "un-ignore"? "un-ignore" that's a funny word! |
535 | 535 | $value = (int) $_GET[$action]; |
@@ -357,9 +357,9 @@ discard block |
||
357 | 357 | $parameter = strtolower(strtr($smcFunc['htmlspecialchars']($search_params[$param_name], ENT_QUOTES), array('%' => '\%', '_' => '\_', '*' => '%', '?' => '_'))); |
358 | 358 | |
359 | 359 | if ($smcFunc['db_case_sensitive']) |
360 | - $query_parts[] = '(LOWER(' . implode( ') LIKE {string:' . $param_name . '_normal} OR LOWER(', $param_info['db_fields']) . ') LIKE {string:' . $param_name . '_normal})'; |
|
360 | + $query_parts[] = '(LOWER(' . implode(') LIKE {string:' . $param_name . '_normal} OR LOWER(', $param_info['db_fields']) . ') LIKE {string:' . $param_name . '_normal})'; |
|
361 | 361 | else |
362 | - $query_parts[] = '(' . implode( ' LIKE {string:' . $param_name . '_normal} OR ', $param_info['db_fields']) . ' LIKE {string:' . $param_name . '_normal})'; |
|
362 | + $query_parts[] = '(' . implode(' LIKE {string:' . $param_name . '_normal} OR ', $param_info['db_fields']) . ' LIKE {string:' . $param_name . '_normal})'; |
|
363 | 363 | $where_params[$param_name . '_normal'] = '%' . $parameter . '%'; |
364 | 364 | } |
365 | 365 | } |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | 'value' => $txt['viewmembers_online'], |
519 | 519 | ), |
520 | 520 | 'data' => array( |
521 | - 'function' => function ($rowData) use ($txt) |
|
521 | + 'function' => function($rowData) use ($txt) |
|
522 | 522 | { |
523 | 523 | // Calculate number of days since last online. |
524 | 524 | if (empty($rowData['last_login'])) |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | 'class' => 'centercol', |
573 | 573 | ), |
574 | 574 | 'data' => array( |
575 | - 'function' => function ($rowData) use ($user_info) |
|
575 | + 'function' => function($rowData) use ($user_info) |
|
576 | 576 | { |
577 | 577 | return '<input type="checkbox" name="delete[]" value="' . $rowData['id_member'] . '" class="input_check"' . ($rowData['id_member'] == $user_info['id'] || $rowData['id_group'] == 1 || in_array(1, explode(',', $rowData['additional_groups'])) ? ' disabled' : '') . '>'; |
578 | 578 | }, |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | 'value' => $txt['hostname'], |
878 | 878 | ), |
879 | 879 | 'data' => array( |
880 | - 'function' => function ($rowData) |
|
880 | + 'function' => function($rowData) |
|
881 | 881 | { |
882 | 882 | return host_from_ip(inet_dtop($rowData['member_ip'])); |
883 | 883 | }, |
@@ -889,7 +889,7 @@ discard block |
||
889 | 889 | 'value' => $context['current_filter'] == 4 ? $txt['viewmembers_online'] : $txt['date_registered'], |
890 | 890 | ), |
891 | 891 | 'data' => array( |
892 | - 'function' => function ($rowData) use ($context) |
|
892 | + 'function' => function($rowData) use ($context) |
|
893 | 893 | { |
894 | 894 | return timeformat($rowData['' . ($context['current_filter'] == 4 ? 'last_login' : 'date_registered') . '']); |
895 | 895 | }, |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | 'style' => 'width: 20%;', |
907 | 907 | ), |
908 | 908 | 'data' => array( |
909 | - 'function' => function ($rowData) use ($scripturl, $txt) |
|
909 | + 'function' => function($rowData) use ($scripturl, $txt) |
|
910 | 910 | { |
911 | 911 | $member_links = array(); |
912 | 912 | foreach ($rowData['duplicate_members'] as $member) |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | else |
917 | 917 | $member_links[] = $member['name'] . ' (' . $txt['guest'] . ')'; |
918 | 918 | } |
919 | - return implode (', ', $member_links); |
|
919 | + return implode(', ', $member_links); |
|
920 | 920 | }, |
921 | 921 | 'class' => 'smalltext', |
922 | 922 | ), |
@@ -139,7 +139,7 @@ |
||
139 | 139 | if ($query_id == $q && $is_select_query) |
140 | 140 | { |
141 | 141 | $result = $smcFunc['db_query']('', ' |
142 | - EXPLAIN '.($smcFunc['db_title'] == 'PostgreSQL' ? 'ANALYZE ':'') . $select, |
|
142 | + EXPLAIN '.($smcFunc['db_title'] == 'PostgreSQL' ? 'ANALYZE ' : '') . $select, |
|
143 | 143 | array( |
144 | 144 | ) |
145 | 145 | ); |