@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $smcFunc['db_free_result']($request); |
166 | 166 | |
167 | 167 | $feed_meta['title'] = ' - ' . strip_tags($board_info['name']); |
168 | - $feed_meta['source'] .= '?board=' . $board . '.0' ; |
|
168 | + $feed_meta['source'] .= '?board=' . $board . '.0'; |
|
169 | 169 | |
170 | 170 | $query_this_board = 'b.id_board = ' . $board; |
171 | 171 | |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | |
390 | 390 | foreach ($xml_data as $item) |
391 | 391 | { |
392 | - $link = array_filter($item['content'], function ($e) { return ($e['tag'] == 'link'); }); |
|
392 | + $link = array_filter($item['content'], function($e) { return ($e['tag'] == 'link'); }); |
|
393 | 393 | $link = array_pop($link); |
394 | 394 | |
395 | 395 | echo ' |
@@ -239,7 +239,7 @@ |
||
239 | 239 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
240 | 240 | $fts_language[$row['cfgname']] = $row['cfgname']; |
241 | 241 | |
242 | - $config_vars = array_merge ($config_vars, array( |
|
242 | + $config_vars = array_merge($config_vars, array( |
|
243 | 243 | '', |
244 | 244 | array('search_language', $txt['search_language'], 'db', 'select', $fts_language, 'pgFulltextSearch') |
245 | 245 | ) |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | $version = $smcFunc['db_get_version'](); |
39 | 39 | // if we got a Beta Version |
40 | 40 | if (stripos($version, 'beta') !== false) |
41 | - $version = substr($version, 0, stripos($version, 'beta')).'.0'; |
|
41 | + $version = substr($version, 0, stripos($version, 'beta')) . '.0'; |
|
42 | 42 | // or RC |
43 | 43 | if (stripos($version, 'rc') !== false) |
44 | - $version = substr($version, 0, stripos($version, 'rc')).'.0'; |
|
44 | + $version = substr($version, 0, stripos($version, 'rc')) . '.0'; |
|
45 | 45 | |
46 | - if (version_compare($version,'9.5.0','>=')) |
|
46 | + if (version_compare($version, '9.5.0', '>=')) |
|
47 | 47 | $smcFunc['db_support_ignore'] = true; |
48 | 48 | } |
49 | 49 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | function smf_db_search_support($search_type) |
57 | 57 | { |
58 | - $supported_types = array('custom','fulltext'); |
|
58 | + $supported_types = array('custom', 'fulltext'); |
|
59 | 59 | |
60 | 60 | return in_array($search_type, $supported_types); |
61 | 61 | } |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | if (preg_match('~^\s*INSERT\sIGNORE~i', $db_string) != 0) |
110 | 110 | { |
111 | 111 | $db_string = preg_replace('~^\s*INSERT\sIGNORE~i', 'INSERT', $db_string); |
112 | - if ($smcFunc['db_support_ignore']){ |
|
112 | + if ($smcFunc['db_support_ignore']) { |
|
113 | 113 | //pg style "INSERT INTO.... ON CONFLICT DO NOTHING" |
114 | - $db_string = $db_string.' ON CONFLICT DO NOTHING'; |
|
114 | + $db_string = $db_string . ' ON CONFLICT DO NOTHING'; |
|
115 | 115 | } |
116 | 116 | else |
117 | 117 | { |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $language_ftx = $modSettings['search_language']; |
169 | 169 | else |
170 | 170 | { |
171 | - $request = $smcFunc['db_query']('',' |
|
171 | + $request = $smcFunc['db_query']('', ' |
|
172 | 172 | SELECT cfgname FROM pg_ts_config WHERE oid = current_setting({string:default_language})::regconfig', |
173 | 173 | array( |
174 | 174 | 'default_language' => 'default_text_search_config' |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @return array The truncated array |
25 | 25 | */ |
26 | -function truncateArray($arr, $max_length=1900) |
|
26 | +function truncateArray($arr, $max_length = 1900) |
|
27 | 27 | { |
28 | 28 | $curr_length = array_sum(array_map("strlen", $arr)); |
29 | 29 | if ($curr_length <= $max_length) |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | else |
32 | 32 | { |
33 | 33 | // Truncate each element's value to a reasonable length |
34 | - $param_max = floor($max_length/count($arr)); |
|
34 | + $param_max = floor($max_length / count($arr)); |
|
35 | 35 | foreach ($arr as $key => &$value) |
36 | 36 | $value = substr($value, 0, $param_max - strlen($key) - 5); |
37 | 37 | return $arr; |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | if (filemtime($boarddir . '/db_last_error.php') === $last_db_error_change) |
198 | 198 | { |
199 | 199 | // Write the change |
200 | - $write_db_change = '<' . '?' . "php\n" . '$db_last_error = ' . time() . ';' . "\n" . '?' . '>'; |
|
200 | + $write_db_change = '<' . '?' . "php\n" . '$db_last_error = ' . time() . ';' . "\n" . '?' . '>'; |
|
201 | 201 | $written_bytes = file_put_contents($boarddir . '/db_last_error.php', $write_db_change, LOCK_EX); |
202 | 202 | |
203 | 203 | // survey says ... |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | ', $txt['debug_language_files'], count($context['debug']['language_files']), ': <em>', implode('</em>, <em>', $context['debug']['language_files']), '</em>.<br> |
271 | 271 | ', $txt['debug_stylesheets'], count($context['debug']['sheets']), ': <em>', implode('</em>, <em>', $context['debug']['sheets']), '</em>.<br> |
272 | 272 | ', $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> |
273 | - ',(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>') : ''),' |
|
273 | + ',(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>') : ''), ' |
|
274 | 274 | ', $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>'; |
275 | 275 | |
276 | 276 | if (function_exists('memory_get_peak_usage')) |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | 'value' => $txt['date'], |
137 | 137 | ), |
138 | 138 | 'data' => array( |
139 | - 'function' => function ($rowData) use ($txt) |
|
139 | + 'function' => function($rowData) use ($txt) |
|
140 | 140 | { |
141 | 141 | // Recurring every year or just a single year? |
142 | 142 | $year = $rowData['year'] == '1004' ? sprintf('(%1$s)', $txt['every_year']) : $rowData['year']; |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | checkSession(); |
219 | 219 | |
220 | 220 | // Not too long good sir? |
221 | - $_REQUEST['title'] = $smcFunc['substr']($_REQUEST['title'], 0, 60); |
|
221 | + $_REQUEST['title'] = $smcFunc['substr']($_REQUEST['title'], 0, 60); |
|
222 | 222 | $_REQUEST['holiday'] = isset($_REQUEST['holiday']) ? (int) $_REQUEST['holiday'] : 0; |
223 | 223 | |
224 | 224 | if (isset($_REQUEST['delete'])) |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | 'Shitiz "Dragooon" Garg', |
591 | 591 | 'Karl "RegularExpression" Benson', |
592 | 592 | 'Matthew "Labradoodle-360" Kerle', |
593 | - $user_info['is_admin'] ? 'Matt "Grudge" Wolf': 'Grudge', |
|
593 | + $user_info['is_admin'] ? 'Matt "Grudge" Wolf' : 'Grudge', |
|
594 | 594 | 'Michael "Thantos" Miller', |
595 | 595 | 'Norv', |
596 | 596 | 'Peter "Arantor" Spicer', |
@@ -814,13 +814,13 @@ discard block |
||
814 | 814 | $credit_info = $smcFunc['json_decode']($row['credits'], true); |
815 | 815 | |
816 | 816 | $copyright = empty($credit_info['copyright']) ? '' : $txt['credits_copyright'] . ' © ' . $smcFunc['htmlspecialchars']($credit_info['copyright']); |
817 | - $license = empty($credit_info['license']) ? '' : $txt['credits_license'] . ': ' . (!empty($credit_info['licenseurl']) ? '<a href="'. $smcFunc['htmlspecialchars']($credit_info['licenseurl']) .'">'. $smcFunc['htmlspecialchars']($credit_info['license']) .'</a>' : $smcFunc['htmlspecialchars']($credit_info['license'])); |
|
817 | + $license = empty($credit_info['license']) ? '' : $txt['credits_license'] . ': ' . (!empty($credit_info['licenseurl']) ? '<a href="' . $smcFunc['htmlspecialchars']($credit_info['licenseurl']) . '">' . $smcFunc['htmlspecialchars']($credit_info['license']) . '</a>' : $smcFunc['htmlspecialchars']($credit_info['license'])); |
|
818 | 818 | $version = $txt['credits_version'] . ' ' . $row['version']; |
819 | 819 | $title = (empty($credit_info['title']) ? $row['name'] : $smcFunc['htmlspecialchars']($credit_info['title'])) . ': ' . $version; |
820 | 820 | |
821 | 821 | // build this one out and stash it away |
822 | 822 | $mod_name = empty($credit_info['url']) ? $title : '<a href="' . $credit_info['url'] . '">' . $title . '</a>'; |
823 | - $mods[] = $mod_name . (!empty($license) ? ' | ' . $license : '') . (!empty($copyright) ? ' | ' . $copyright : ''); |
|
823 | + $mods[] = $mod_name . (!empty($license) ? ' | ' . $license : '') . (!empty($copyright) ? ' | ' . $copyright : ''); |
|
824 | 824 | } |
825 | 825 | cache_put_data('mods_credits', $mods, 86400); |
826 | 826 | } |
@@ -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 | )); |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | // Gotta urlencode the filename. |
407 | 407 | if ($this->_attachResults) |
408 | 408 | foreach ($this->_attachResults as $k => $v) |
409 | - $this->_attachResults[$k]['name'] = urlencode($this->_attachResults[$k]['name']); |
|
409 | + $this->_attachResults[$k]['name'] = urlencode($this->_attachResults[$k]['name']); |
|
410 | 410 | |
411 | 411 | $this->_response = array( |
412 | 412 | 'files' => $this->_attachResults ? $this->_attachResults : false, |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | ob_start(); |
434 | 434 | |
435 | 435 | // Set the header. |
436 | - header('Content-Type: application/json; charset='. $context['character_set'] .''); |
|
436 | + header('Content-Type: application/json; charset=' . $context['character_set'] . ''); |
|
437 | 437 | |
438 | 438 | echo $smcFunc['json_encode']($this->_response ? $this->_response : array()); |
439 | 439 |
@@ -86,7 +86,7 @@ |
||
86 | 86 | foreach ($board['children'] as $child) |
87 | 87 | { |
88 | 88 | if (!$child['is_redirect']) |
89 | - $child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
89 | + $child['link'] = '' . ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
90 | 90 | else |
91 | 91 | $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
92 | 92 |
@@ -1334,7 +1334,7 @@ discard block |
||
1334 | 1334 | 'class' => 'centercol', |
1335 | 1335 | ), |
1336 | 1336 | 'data' => array( |
1337 | - 'function' => function ($rowData) |
|
1337 | + 'function' => function($rowData) |
|
1338 | 1338 | { |
1339 | 1339 | $isChecked = $rowData['disabled'] ? '' : ' checked'; |
1340 | 1340 | $onClickHandler = $rowData['can_show_register'] ? sprintf(' onclick="document.getElementById(\'reg_%1$s\').disabled = !this.checked;"', $rowData['id']) : ''; |
@@ -1350,7 +1350,7 @@ discard block |
||
1350 | 1350 | 'class' => 'centercol', |
1351 | 1351 | ), |
1352 | 1352 | 'data' => array( |
1353 | - 'function' => function ($rowData) |
|
1353 | + 'function' => function($rowData) |
|
1354 | 1354 | { |
1355 | 1355 | $isChecked = $rowData['on_register'] && !$rowData['disabled'] ? ' checked' : ''; |
1356 | 1356 | $isDisabled = $rowData['can_show_register'] ? '' : ' disabled'; |
@@ -1397,15 +1397,15 @@ discard block |
||
1397 | 1397 | 'value' => $txt['custom_profile_fieldorder'], |
1398 | 1398 | ), |
1399 | 1399 | 'data' => array( |
1400 | - 'function' => function ($rowData) use ($context, $txt, $scripturl) |
|
1400 | + 'function' => function($rowData) use ($context, $txt, $scripturl) |
|
1401 | 1401 | { |
1402 | - $return = '<p class="centertext bold_text">'. $rowData['field_order'] .'<br>'; |
|
1402 | + $return = '<p class="centertext bold_text">' . $rowData['field_order'] . '<br>'; |
|
1403 | 1403 | |
1404 | 1404 | if ($rowData['field_order'] > 1) |
1405 | - $return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=up"><span class="toggle_up" title="'. $txt['custom_edit_order_move'] .' '. $txt['custom_edit_order_up'] .'"></span></a>'; |
|
1405 | + $return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=up"><span class="toggle_up" title="' . $txt['custom_edit_order_move'] . ' ' . $txt['custom_edit_order_up'] . '"></span></a>'; |
|
1406 | 1406 | |
1407 | 1407 | if ($rowData['field_order'] < $context['custFieldsMaxOrder']) |
1408 | - $return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=down"><span class="toggle_down" title="'. $txt['custom_edit_order_move'] .' '. $txt['custom_edit_order_down'] .'"></span></a>'; |
|
1408 | + $return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=down"><span class="toggle_down" title="' . $txt['custom_edit_order_move'] . ' ' . $txt['custom_edit_order_down'] . '"></span></a>'; |
|
1409 | 1409 | |
1410 | 1410 | $return .= '</p>'; |
1411 | 1411 | |
@@ -1423,7 +1423,7 @@ discard block |
||
1423 | 1423 | 'value' => $txt['custom_profile_fieldname'], |
1424 | 1424 | ), |
1425 | 1425 | 'data' => array( |
1426 | - 'function' => function ($rowData) use ($scripturl) |
|
1426 | + 'function' => function($rowData) use ($scripturl) |
|
1427 | 1427 | { |
1428 | 1428 | return sprintf('<a href="%1$s?action=admin;area=featuresettings;sa=profileedit;fid=%2$d">%3$s</a><div class="smalltext">%4$s</div>', $scripturl, $rowData['id_field'], $rowData['field_name'], $rowData['field_desc']); |
1429 | 1429 | }, |
@@ -1439,7 +1439,7 @@ discard block |
||
1439 | 1439 | 'value' => $txt['custom_profile_fieldtype'], |
1440 | 1440 | ), |
1441 | 1441 | 'data' => array( |
1442 | - 'function' => function ($rowData) use ($txt) |
|
1442 | + 'function' => function($rowData) use ($txt) |
|
1443 | 1443 | { |
1444 | 1444 | $textKey = sprintf('custom_profile_type_%1$s', $rowData['field_type']); |
1445 | 1445 | return isset($txt[$textKey]) ? $txt[$textKey] : $textKey; |
@@ -1457,7 +1457,7 @@ discard block |
||
1457 | 1457 | 'value' => $txt['custom_profile_active'], |
1458 | 1458 | ), |
1459 | 1459 | 'data' => array( |
1460 | - 'function' => function ($rowData) use ($txt) |
|
1460 | + 'function' => function($rowData) use ($txt) |
|
1461 | 1461 | { |
1462 | 1462 | return $rowData['active'] ? $txt['yes'] : $txt['no']; |
1463 | 1463 | }, |
@@ -1474,7 +1474,7 @@ discard block |
||
1474 | 1474 | 'value' => $txt['custom_profile_placement'], |
1475 | 1475 | ), |
1476 | 1476 | 'data' => array( |
1477 | - 'function' => function ($rowData) |
|
1477 | + 'function' => function($rowData) |
|
1478 | 1478 | { |
1479 | 1479 | global $txt, $context; |
1480 | 1480 | |
@@ -1709,7 +1709,7 @@ discard block |
||
1709 | 1709 | redirectexit('action=admin;area=featuresettings;sa=profile'); // @todo implement an error handler |
1710 | 1710 | |
1711 | 1711 | // All good, proceed. |
1712 | - $smcFunc['db_query']('',' |
|
1712 | + $smcFunc['db_query']('', ' |
|
1713 | 1713 | UPDATE {db_prefix}custom_fields |
1714 | 1714 | SET field_order = {int:old_order} |
1715 | 1715 | WHERE field_order = {int:new_order}', |
@@ -1718,7 +1718,7 @@ discard block |
||
1718 | 1718 | 'old_order' => $context['field']['order'], |
1719 | 1719 | ) |
1720 | 1720 | ); |
1721 | - $smcFunc['db_query']('',' |
|
1721 | + $smcFunc['db_query']('', ' |
|
1722 | 1722 | UPDATE {db_prefix}custom_fields |
1723 | 1723 | SET field_order = {int:new_order} |
1724 | 1724 | WHERE id_field = {int:id_field}', |
@@ -1820,7 +1820,7 @@ discard block |
||
1820 | 1820 | $smcFunc['db_free_result']($request); |
1821 | 1821 | |
1822 | 1822 | $unique = false; |
1823 | - for ($i = 0; !$unique && $i < 9; $i ++) |
|
1823 | + for ($i = 0; !$unique && $i < 9; $i++) |
|
1824 | 1824 | { |
1825 | 1825 | if (!in_array($col_name, $current_fields)) |
1826 | 1826 | $unique = true; |
@@ -1993,7 +1993,7 @@ discard block |
||
1993 | 1993 | ); |
1994 | 1994 | |
1995 | 1995 | // Re-arrange the order. |
1996 | - $smcFunc['db_query']('',' |
|
1996 | + $smcFunc['db_query']('', ' |
|
1997 | 1997 | UPDATE {db_prefix}custom_fields |
1998 | 1998 | SET field_order = field_order - 1 |
1999 | 1999 | WHERE field_order > {int:current_order}', |
@@ -2257,7 +2257,7 @@ discard block |
||
2257 | 2257 | $context['token_check'] = 'noti-admin'; |
2258 | 2258 | |
2259 | 2259 | // Specify our action since we'll want to post back here instead of the profile |
2260 | - $context['action'] = 'action=admin;area=featuresettings;sa=alerts;'. $context['session_var'] .'='. $context['session_id']; |
|
2260 | + $context['action'] = 'action=admin;area=featuresettings;sa=alerts;' . $context['session_var'] . '=' . $context['session_id']; |
|
2261 | 2261 | |
2262 | 2262 | loadTemplate('Profile'); |
2263 | 2263 | loadLanguage('Profile'); |