@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | global $smcFunc; |
| 225 | 225 | |
| 226 | - $result = $smcFunc['db_query']('',' |
|
| 226 | + $result = $smcFunc['db_query']('', ' |
|
| 227 | 227 | SELECT DISTINCT id_search |
| 228 | 228 | FROM {db_prefix}log_search_results |
| 229 | 229 | WHERE id_msg = {int:id_msg}', |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | if (count($id_searchs) < 1) |
| 240 | 240 | return; |
| 241 | 241 | |
| 242 | - $smcFunc['db_query']('',' |
|
| 242 | + $smcFunc['db_query']('', ' |
|
| 243 | 243 | DELETE FROM {db_prefix}log_search_results |
| 244 | 244 | WHERE id_search in ({array_int:id_searchs})', |
| 245 | 245 | array( |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | ) |
| 248 | 248 | ); |
| 249 | 249 | |
| 250 | - $smcFunc['db_query']('',' |
|
| 250 | + $smcFunc['db_query']('', ' |
|
| 251 | 251 | DELETE FROM {db_prefix}log_search_topics |
| 252 | 252 | WHERE id_search in ({array_int:id_searchs})', |
| 253 | 253 | array( |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | ) |
| 256 | 256 | ); |
| 257 | 257 | |
| 258 | - $smcFunc['db_query']('',' |
|
| 258 | + $smcFunc['db_query']('', ' |
|
| 259 | 259 | DELETE FROM {db_prefix}log_search_messages |
| 260 | 260 | WHERE id_search in ({array_int:id_searchs})', |
| 261 | 261 | array( |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | /** |
| 34 | 34 | * @var array Which databases support this method? |
| 35 | 35 | */ |
| 36 | - protected $supported_databases = array('mysql','postgresql'); |
|
| 36 | + protected $supported_databases = array('mysql', 'postgresql'); |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * The constructor function |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $query_where = array(); |
| 177 | 177 | $query_params = $search_data['params']; |
| 178 | 178 | |
| 179 | - if( $smcFunc['db_title'] == "PostgreSQL") |
|
| 179 | + if ($smcFunc['db_title'] == "PostgreSQL") |
|
| 180 | 180 | $modSettings['search_simple_fulltext'] = true; |
| 181 | 181 | |
| 182 | 182 | if ($query_params['id_search']) |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | // if we have bool terms to search, add them in |
| 257 | 257 | if ($query_params['boolean_match']) |
| 258 | 258 | { |
| 259 | - if($smcFunc['db_title'] == "PostgreSQL") |
|
| 259 | + if ($smcFunc['db_title'] == "PostgreSQL") |
|
| 260 | 260 | { |
| 261 | 261 | $language_ftx = $smcFunc['db_search_language'](); |
| 262 | 262 | |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | - $ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? ( ' |
|
| 271 | + $ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? (' |
|
| 272 | 272 | INSERT IGNORE INTO {db_prefix}' . $search_data['insert_into'] . ' |
| 273 | 273 | (' . implode(', ', array_keys($query_select)) . ')') : '') . ' |
| 274 | 274 | SELECT ' . implode(', ', $query_select) . ' |
@@ -254,8 +254,8 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | case 'datetime': |
| 256 | 256 | if (preg_match('~^(\d{4})-([0-1]?\d)-([0-3]?\d) ([0-1]?\d|2[0-3]):([0-5]\d):([0-5]\d)$~', $replacement, $datetime_matches) === 1) |
| 257 | - return 'str_to_date('. |
|
| 258 | - sprintf('\'%04d-%02d-%02d %02d:%02d:%02d\'', $datetime_matches[1], $datetime_matches[2], $datetime_matches[3], $datetime_matches[4], $datetime_matches[5] ,$datetime_matches[6]). |
|
| 257 | + return 'str_to_date(' . |
|
| 258 | + sprintf('\'%04d-%02d-%02d %02d:%02d:%02d\'', $datetime_matches[1], $datetime_matches[2], $datetime_matches[3], $datetime_matches[4], $datetime_matches[5], $datetime_matches[6]) . |
|
| 259 | 259 | ',\'%Y-%m-%d %h:%i:%s\')'; |
| 260 | 260 | else |
| 261 | 261 | smf_db_error_backtrace('Wrong value type sent to the database. Datetime expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__); |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | $old_pos = 0; |
| 407 | 407 | $pos = -1; |
| 408 | 408 | // Remove the string escape for better runtime |
| 409 | - $db_string_1 = str_replace('\\\'','',$db_string); |
|
| 409 | + $db_string_1 = str_replace('\\\'', '', $db_string); |
|
| 410 | 410 | while (true) |
| 411 | 411 | { |
| 412 | 412 | $pos = strpos($db_string_1, '\'', $pos + 1); |
@@ -787,7 +787,7 @@ discard block |
||
| 787 | 787 | { |
| 788 | 788 | $count = count($insertRows); |
| 789 | 789 | $ai = 0; |
| 790 | - for($i = 0; $i < $count; $i++) |
|
| 790 | + for ($i = 0; $i < $count; $i++) |
|
| 791 | 791 | { |
| 792 | 792 | $old_id = $smcFunc['db_insert_id'](); |
| 793 | 793 | |
@@ -813,13 +813,13 @@ discard block |
||
| 813 | 813 | $count2 = count($indexed_columns); |
| 814 | 814 | for ($x = 0; $x < $count2; $x++) |
| 815 | 815 | { |
| 816 | - $where_string += key($indexed_columns[$x]) . ' = '. $insertRows[$i][$x]; |
|
| 816 | + $where_string += key($indexed_columns[$x]) . ' = ' . $insertRows[$i][$x]; |
|
| 817 | 817 | if (($x + 1) < $count2) |
| 818 | 818 | $where_string += ' AND '; |
| 819 | 819 | } |
| 820 | 820 | |
| 821 | - $request = $smcFunc['db_query']('',' |
|
| 822 | - SELECT `'. $keys[0] . '` FROM ' . $table .' |
|
| 821 | + $request = $smcFunc['db_query']('', ' |
|
| 822 | + SELECT `'. $keys[0] . '` FROM ' . $table . ' |
|
| 823 | 823 | WHERE ' . $where_string . ' LIMIT 1', |
| 824 | 824 | array() |
| 825 | 825 | ); |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | $return_var = array(); |
| 849 | 849 | $count = count($insertRows); |
| 850 | 850 | $start = smf_db_insert_id($table, $keys[0]); |
| 851 | - for ($i = 0; $i < $count; $i++ ) |
|
| 851 | + for ($i = 0; $i < $count; $i++) |
|
| 852 | 852 | $return_var[] = $start + $i; |
| 853 | 853 | } |
| 854 | 854 | return $return_var; |
@@ -985,7 +985,7 @@ discard block |
||
| 985 | 985 | mysqli_stmt_bind_param($mysql_error_data_prep, 'iissssssis', |
| 986 | 986 | $error_array[0], $error_array[1], $error_array[2], $error_array[3], $error_array[4], $error_array[5], $error_array[6], |
| 987 | 987 | $error_array[7], $error_array[8], $error_array[9]); |
| 988 | - mysqli_stmt_execute ($mysql_error_data_prep); |
|
| 988 | + mysqli_stmt_execute($mysql_error_data_prep); |
|
| 989 | 989 | } |
| 990 | 990 | |
| 991 | 991 | /** |
@@ -999,7 +999,7 @@ discard block |
||
| 999 | 999 | */ |
| 1000 | 1000 | function smf_db_custom_order($field, $array_values, $desc = false) |
| 1001 | 1001 | { |
| 1002 | - $return = 'CASE '. $field . ' '; |
|
| 1002 | + $return = 'CASE ' . $field . ' '; |
|
| 1003 | 1003 | $count = count($array_values); |
| 1004 | 1004 | $then = ($desc ? ' THEN -' : ' THEN '); |
| 1005 | 1005 | |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | |
| 660 | 660 | // Remove the phrase parts and extract the words. |
| 661 | 661 | $wordArray = preg_replace('~(?:^|\s)(?:[-]?)"(?:[^"]+)"(?:$|\s)~' . ($context['utf8'] ? 'u' : ''), ' ', $search_params['search']); |
| 662 | - $wordArray = explode(' ', $smcFunc['htmlspecialchars'](un_htmlspecialchars($wordArray), ENT_QUOTES)); |
|
| 662 | + $wordArray = explode(' ', $smcFunc['htmlspecialchars'](un_htmlspecialchars($wordArray), ENT_QUOTES)); |
|
| 663 | 663 | |
| 664 | 664 | // A minus sign in front of a word excludes the word.... so... |
| 665 | 665 | $excludedWords = array(); |
@@ -997,7 +997,7 @@ discard block |
||
| 997 | 997 | // Are the result fresh? |
| 998 | 998 | if (!$update_cache && !empty($_SESSION['search_cache']['id_search'])) |
| 999 | 999 | { |
| 1000 | - $request = $smcFunc['db_query']('',' |
|
| 1000 | + $request = $smcFunc['db_query']('', ' |
|
| 1001 | 1001 | SELECT id_search |
| 1002 | 1002 | FROM {db_prefix}log_search_results |
| 1003 | 1003 | WHERE id_search = {int:search_id} |
@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | SELECT |
| 1120 | 1120 | {int:id_search}, |
| 1121 | 1121 | t.id_topic, |
| 1122 | - ' . $relevance. ', |
|
| 1122 | + ' . $relevance . ', |
|
| 1123 | 1123 | ' . (empty($userQuery) ? 't.id_first_msg' : 'm.id_msg') . ', |
| 1124 | 1124 | 1 |
| 1125 | 1125 | FROM ' . $subject_query['from'] . (empty($subject_query['inner_join']) ? '' : ' |
@@ -1352,7 +1352,7 @@ discard block |
||
| 1352 | 1352 | if (empty($subject_query['where'])) |
| 1353 | 1353 | continue; |
| 1354 | 1354 | |
| 1355 | - $ignoreRequest = $smcFunc['db_search_query']('insert_log_search_topics', ($smcFunc['db_support_ignore'] ? ( ' |
|
| 1355 | + $ignoreRequest = $smcFunc['db_search_query']('insert_log_search_topics', ($smcFunc['db_support_ignore'] ? (' |
|
| 1356 | 1356 | INSERT IGNORE INTO {db_prefix}' . ($createTemporary ? 'tmp_' : '') . 'log_search_topics |
| 1357 | 1357 | (' . ($createTemporary ? '' : 'id_search, ') . 'id_topic)') : '') . ' |
| 1358 | 1358 | SELECT ' . ($createTemporary ? '' : $_SESSION['search_cache']['id_search'] . ', ') . 't.id_topic |
@@ -1579,7 +1579,7 @@ discard block |
||
| 1579 | 1579 | } |
| 1580 | 1580 | $main_query['select']['relevance'] = substr($relevance, 0, -3) . ') / ' . $new_weight_total . ' AS relevance'; |
| 1581 | 1581 | |
| 1582 | - $ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_no_index', ($smcFunc['db_support_ignore'] ? ( ' |
|
| 1582 | + $ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_no_index', ($smcFunc['db_support_ignore'] ? (' |
|
| 1583 | 1583 | INSERT IGNORE INTO ' . '{db_prefix}log_search_results |
| 1584 | 1584 | (' . implode(', ', array_keys($main_query['select'])) . ')') : '') . ' |
| 1585 | 1585 | SELECT |
@@ -1647,7 +1647,7 @@ discard block |
||
| 1647 | 1647 | $relevance = substr($relevance, 0, -3) . ') / ' . $weight_total . ' AS relevance'; |
| 1648 | 1648 | |
| 1649 | 1649 | $usedIDs = array_flip(empty($inserts) ? array() : array_keys($inserts)); |
| 1650 | - $ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_sub_only', ($smcFunc['db_support_ignore'] ? ( ' |
|
| 1650 | + $ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_sub_only', ($smcFunc['db_support_ignore'] ? (' |
|
| 1651 | 1651 | INSERT IGNORE INTO {db_prefix}log_search_results |
| 1652 | 1652 | (id_search, id_topic, relevance, id_msg, num_matches)') : '') . ' |
| 1653 | 1653 | SELECT |
@@ -2116,7 +2116,7 @@ discard block |
||
| 2116 | 2116 | if (strlen($query) == 0) |
| 2117 | 2117 | continue; |
| 2118 | 2118 | |
| 2119 | - $body_highlighted = preg_replace_callback('/((<[^>]*)|' . preg_quote(strtr($query, array('\'' => ''')), '/') . ')/i' . ($context['utf8'] ? 'u' : ''), function ($m) |
|
| 2119 | + $body_highlighted = preg_replace_callback('/((<[^>]*)|' . preg_quote(strtr($query, array('\'' => ''')), '/') . ')/i' . ($context['utf8'] ? 'u' : ''), function($m) |
|
| 2120 | 2120 | { |
| 2121 | 2121 | return isset($m[2]) && "$m[2]" == "$m[1]" ? stripslashes("$m[1]") : "<strong class=\"highlight\">$m[1]</strong>"; |
| 2122 | 2122 | }, $body_highlighted); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $backtrace = debug_backtrace(); |
| 46 | 46 | |
| 47 | 47 | // are we in a loop? |
| 48 | - if($error_call > 2) |
|
| 48 | + if ($error_call > 2) |
|
| 49 | 49 | { |
| 50 | 50 | var_dump($backtrace); |
| 51 | 51 | die('Error loop.'); |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | $url['error'] = $error; |
| 550 | 550 | // Url field got a max length of 1024 in db |
| 551 | 551 | if (strlen($url['error']) > 500) |
| 552 | - $url['error'] = substr($url['error'],0,500); |
|
| 552 | + $url['error'] = substr($url['error'], 0, 500); |
|
| 553 | 553 | |
| 554 | 554 | if (!empty($sprintf)) |
| 555 | 555 | $url['error_params'] = $sprintf; |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | if (!empty($context['custom_profile_fields']['columns'])) |
| 107 | 107 | foreach ($context['custom_profile_fields']['columns'] as $key => $column) |
| 108 | 108 | echo ' |
| 109 | - <td class="' , $key , ' centertext">', $member['options'][$key], '</td>'; |
|
| 109 | + <td class="' , $key, ' centertext">', $member['options'][$key], '</td>'; |
|
| 110 | 110 | |
| 111 | 111 | echo ' |
| 112 | 112 | </tr>'; |
@@ -1904,7 +1904,7 @@ discard block |
||
| 1904 | 1904 | if (count($context['ip']) !== 2) |
| 1905 | 1905 | fatal_lang_error('invalid_tracking_ip', false); |
| 1906 | 1906 | |
| 1907 | - $ip_string = array('{inet:ip_address_low}','{inet:ip_address_high}'); |
|
| 1907 | + $ip_string = array('{inet:ip_address_low}', '{inet:ip_address_high}'); |
|
| 1908 | 1908 | $fields = array( |
| 1909 | 1909 | 'ip_address_low' => $context['ip']['low'], |
| 1910 | 1910 | 'ip_address_high' => $context['ip']['high'], |
@@ -1912,7 +1912,7 @@ discard block |
||
| 1912 | 1912 | |
| 1913 | 1913 | $ip_var = $context['ip']; |
| 1914 | 1914 | |
| 1915 | - if ($context['ip']['low'] !== $context['ip']['high']) |
|
| 1915 | + if ($context['ip']['low'] !== $context['ip']['high']) |
|
| 1916 | 1916 | $context['ip'] = $context['ip']['low'] . ' - ' . $context['ip']['high']; |
| 1917 | 1917 | else |
| 1918 | 1918 | $context['ip'] = $context['ip']['low']; |
@@ -328,7 +328,7 @@ |
||
| 328 | 328 | foreach ($context['error_info']['backtrace'] as $key => $value) |
| 329 | 329 | { |
| 330 | 330 | //Check for existing |
| 331 | - if (!property_exists($value,'file') || empty($value->file)) |
|
| 331 | + if (!property_exists($value, 'file') || empty($value->file)) |
|
| 332 | 332 | $value->file = $txt['unknown']; |
| 333 | 333 | if (!property_exists($value, 'line') || empty($value->line)) |
| 334 | 334 | $value->line = -1; |
@@ -2192,10 +2192,10 @@ discard block |
||
| 2192 | 2192 | */ |
| 2193 | 2193 | function template_ignoreboards() |
| 2194 | 2194 | { |
| 2195 | - global $context, $txt, $scripturl; |
|
| 2195 | + global $context, $txt, $scripturl; |
|
| 2196 | 2196 | |
| 2197 | - // The main containing header. |
|
| 2198 | - echo ' |
|
| 2197 | + // The main containing header. |
|
| 2198 | + echo ' |
|
| 2199 | 2199 | <form action="', $scripturl, '?action=profile;area=ignoreboards;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator"> |
| 2200 | 2200 | <div class="cat_bar"> |
| 2201 | 2201 | <h3 class="catbg profile_hd"> |
@@ -2207,34 +2207,34 @@ discard block |
||
| 2207 | 2207 | <div class="flow_hidden boardslist"> |
| 2208 | 2208 | <ul>'; |
| 2209 | 2209 | |
| 2210 | - foreach ($context['categories'] as $category) |
|
| 2211 | - { |
|
| 2212 | - echo ' |
|
| 2210 | + foreach ($context['categories'] as $category) |
|
| 2211 | + { |
|
| 2212 | + echo ' |
|
| 2213 | 2213 | <li> |
| 2214 | 2214 | <a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'creator\'); return false;">', $category['name'], '</a> |
| 2215 | 2215 | <ul>'; |
| 2216 | 2216 | |
| 2217 | - foreach ($category['boards'] as $board) |
|
| 2218 | - { |
|
| 2219 | - echo ' |
|
| 2217 | + foreach ($category['boards'] as $board) |
|
| 2218 | + { |
|
| 2219 | + echo ' |
|
| 2220 | 2220 | <li style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;"> |
| 2221 | 2221 | <label for="ignore_brd', $board['id'], '"><input type="checkbox" id="brd', $board['id'], '" name="ignore_brd[', $board['id'], ']" value="', $board['id'], '"', $board['selected'] ? ' checked' : '', '> ', $board['name'], '</label> |
| 2222 | 2222 | </li>'; |
| 2223 | - } |
|
| 2223 | + } |
|
| 2224 | 2224 | |
| 2225 | - echo ' |
|
| 2225 | + echo ' |
|
| 2226 | 2226 | </ul> |
| 2227 | 2227 | </li>'; |
| 2228 | - } |
|
| 2228 | + } |
|
| 2229 | 2229 | |
| 2230 | - echo ' |
|
| 2230 | + echo ' |
|
| 2231 | 2231 | </ul> |
| 2232 | 2232 | </div><!-- .flow_hidden boardslist -->'; |
| 2233 | 2233 | |
| 2234 | - // Show the standard "Save Settings" profile button. |
|
| 2235 | - template_profile_save(); |
|
| 2234 | + // Show the standard "Save Settings" profile button. |
|
| 2235 | + template_profile_save(); |
|
| 2236 | 2236 | |
| 2237 | - echo ' |
|
| 2237 | + echo ' |
|
| 2238 | 2238 | </div><!-- .windowbg --> |
| 2239 | 2239 | </form> |
| 2240 | 2240 | <br>'; |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | $fields = ''; |
| 460 | 460 | foreach ($context['print_custom_fields']['below_signature'] as $field) |
| 461 | 461 | if (!empty($field['output_html'])) |
| 462 | - $fields .= ' |
|
| 462 | + $fields .= ' |
|
| 463 | 463 | <li>' . $field['output_html'] . '</li>'; |
| 464 | 464 | |
| 465 | 465 | if (!empty($fields)) |
@@ -3167,7 +3167,7 @@ discard block |
||
| 3167 | 3167 | <div class="floatright tfa_qrcode"> |
| 3168 | 3168 | <div id="qrcode"></div> |
| 3169 | 3169 | <script type="text/javascript"> |
| 3170 | - new QRCode(document.getElementById("qrcode"), "' , $context['tfa_qr_url'],'"); |
|
| 3170 | + new QRCode(document.getElementById("qrcode"), "' , $context['tfa_qr_url'], '"); |
|
| 3171 | 3171 | </script> |
| 3172 | 3172 | </div>'; |
| 3173 | 3173 | |