@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | ' . (empty($sort_methods_table[$context['sort_by']]) ? '' : $sort_methods_table[$context['sort_by']]) . ' |
325 | 325 | WHERE t.id_board = {int:current_board} ' |
326 | 326 | . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : ' |
327 | - AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') .' |
|
327 | + AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . ' |
|
328 | 328 | ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . ' |
329 | 329 | LIMIT {int:maxindex} |
330 | 330 | OFFSET {int:start} '; |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | SELECT |
334 | 334 | t.id_topic, t.num_replies, t.locked, t.num_views, t.is_sticky, t.id_poll, t.id_previous_board, |
335 | 335 | ' . ($user_info['is_guest'] ? '0' : 'COALESCE(lt.id_msg, COALESCE(lmr.id_msg, -1)) + 1') . ' AS new_from, |
336 | - ' . ( $enableParticipation ? ' COALESCE(( SELECT 1 FROM {db_prefix}messages AS parti WHERE t.id_topic = parti.id_topic and parti.id_member = {int:current_member} LIMIT 1) , 0) as is_posted_in, |
|
336 | + ' . ($enableParticipation ? ' COALESCE(( SELECT 1 FROM {db_prefix}messages AS parti WHERE t.id_topic = parti.id_topic and parti.id_member = {int:current_member} LIMIT 1) , 0) as is_posted_in, |
|
337 | 337 | ' : '') . ' |
338 | 338 | t.id_last_msg, t.approved, t.unapproved_posts, ml.poster_time AS last_poster_time, t.id_redirect_topic, |
339 | 339 | ml.id_msg_modified, ml.subject AS last_subject, ml.icon AS last_icon, |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = {int:current_board} AND lmr.id_member = {int:current_member})') . ' |
358 | 358 | ' . (!empty($message_index_tables) ? implode("\n\t\t\t\t", $message_index_tables) : '') . ' |
359 | 359 | ' . (!empty($message_index_wheres) ? ' WHERE ' . implode("\n\t\t\t\tAND ", $message_index_wheres) : '') . ' |
360 | - ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') , |
|
360 | + ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC'), |
|
361 | 361 | $message_index_parameters |
362 | 362 | ); |
363 | 363 |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | // INET. |
353 | 353 | elseif ($param_info['type'] == 'inet') |
354 | 354 | { |
355 | - if(count($search_params[$param_name]) === 1) |
|
355 | + if (count($search_params[$param_name]) === 1) |
|
356 | 356 | { |
357 | 357 | $query_parts[] = '(' . $param_info['db_fields'][0] . ' = {inet:' . $param_name . '})'; |
358 | 358 | $where_params[$param_name] = $search_params[$param_name][0]; |
@@ -360,8 +360,8 @@ discard block |
||
360 | 360 | elseif (count($search_params[$param_name]) === 2) |
361 | 361 | { |
362 | 362 | $query_parts[] = '(' . $param_info['db_fields'][0] . ' <= {inet:' . $param_name . '_high} and ' . $param_info['db_fields'][0] . ' >= {inet:' . $param_name . '_low})'; |
363 | - $where_params[$param_name.'_low'] = $search_params[$param_name]['low']; |
|
364 | - $where_params[$param_name.'_high'] = $search_params[$param_name]['high']; |
|
363 | + $where_params[$param_name . '_low'] = $search_params[$param_name]['low']; |
|
364 | + $where_params[$param_name . '_high'] = $search_params[$param_name]['high']; |
|
365 | 365 | } |
366 | 366 | |
367 | 367 | } |
@@ -1005,7 +1005,7 @@ discard block |
||
1005 | 1005 | if (!empty($context['show_filter']) && !empty($context['available_filters'])) |
1006 | 1006 | $listOptions['additional_rows'][] = array( |
1007 | 1007 | 'position' => 'above_column_headers', |
1008 | - 'value' => '<strong>' . $txt['admin_browse_filter_show'] . ':</strong> ' . ((isset($context['current_filter']) && isset($txt['admin_browse_filter_type_'.$context['current_filter']])) ? $txt['admin_browse_filter_type_'.$context['current_filter']] : $context['available_filters'][0]['desc']), |
|
1008 | + 'value' => '<strong>' . $txt['admin_browse_filter_show'] . ':</strong> ' . ((isset($context['current_filter']) && isset($txt['admin_browse_filter_type_' . $context['current_filter']])) ? $txt['admin_browse_filter_type_' . $context['current_filter']] : $context['available_filters'][0]['desc']), |
|
1009 | 1009 | 'class' => 'filter_row generic_list_wrapper smalltext', |
1010 | 1010 | ); |
1011 | 1011 |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | 'editlang' => array( |
593 | 593 | 'header' => array( |
594 | 594 | 'value' => '', |
595 | - ),'data' => array( |
|
595 | + ), 'data' => array( |
|
596 | 596 | 'function' => function($rowData) use ($scripturl, $txt) |
597 | 597 | { |
598 | 598 | return sprintf('<a href="%1$s?action=admin;area=languages;sa=editlang;lid=%2$s" class="button">%3$s</a>', $scripturl, $rowData['id'], $txt['edit']); |
@@ -1269,7 +1269,7 @@ discard block |
||
1269 | 1269 | // Now create the string! |
1270 | 1270 | $final_saves[$entryKey] = array( |
1271 | 1271 | 'find' => $entryValue['full'], |
1272 | - 'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n" . '$' . $entryValue['type'] . '[\'' . $entryKey . '\'] = array(' . implode(', ', $items) . ');' . $entryValue['cruft'], |
|
1272 | + 'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n" . '$' . $entryValue['type'] . '[\'' . $entryKey . '\'] = array(' . implode(', ', $items) . ');' . $entryValue['cruft'], |
|
1273 | 1273 | ); |
1274 | 1274 | } |
1275 | 1275 | } |
@@ -1291,7 +1291,7 @@ discard block |
||
1291 | 1291 | // And save it |
1292 | 1292 | $final_saves[$entryKey] = array( |
1293 | 1293 | 'find' => $entryValue['full'], |
1294 | - 'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n" . '$' . $entryValue['type'] . '[\'' . $entryValue['key'] . '\'][' . $subKey . '] = ' . $save_strings[$entryValue['key']][$entryValue['subkey']] . ';' . $entryValue['cruft'], |
|
1294 | + 'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n" . '$' . $entryValue['type'] . '[\'' . $entryValue['key'] . '\'][' . $subKey . '] = ' . $save_strings[$entryValue['key']][$entryValue['subkey']] . ';' . $entryValue['cruft'], |
|
1295 | 1295 | ); |
1296 | 1296 | } |
1297 | 1297 | |
@@ -1301,7 +1301,7 @@ discard block |
||
1301 | 1301 | $entryValue['entry'] = '\'\''; |
1302 | 1302 | $final_saves[$entryKey] = array( |
1303 | 1303 | 'find' => $entryValue['full'], |
1304 | - 'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n", |
|
1304 | + 'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n", |
|
1305 | 1305 | ); |
1306 | 1306 | } |
1307 | 1307 | |
@@ -1329,7 +1329,7 @@ discard block |
||
1329 | 1329 | // And we know what to save now! |
1330 | 1330 | $final_saves[$entryKey] = array( |
1331 | 1331 | 'find' => $entryValue['full'], |
1332 | - 'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n" . '$' . $entryValue['type'] . '[\'' . $entryValue['key'] . '\'] = ' . $save_strings[$entryValue['key']] . ';' . $entryValue['cruft'], |
|
1332 | + 'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n" . '$' . $entryValue['type'] . '[\'' . $entryValue['key'] . '\'] = ' . $save_strings[$entryValue['key']] . ';' . $entryValue['cruft'], |
|
1333 | 1333 | ); |
1334 | 1334 | } |
1335 | 1335 | // Remove this entry only if it is allowed |
@@ -1338,7 +1338,7 @@ discard block |
||
1338 | 1338 | $entryValue['entry'] = '\'\''; |
1339 | 1339 | $final_saves[$entryKey] = array( |
1340 | 1340 | 'find' => $entryValue['full'], |
1341 | - 'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n", |
|
1341 | + 'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n", |
|
1342 | 1342 | ); |
1343 | 1343 | } |
1344 | 1344 | |
@@ -1369,8 +1369,8 @@ discard block |
||
1369 | 1369 | continue; |
1370 | 1370 | |
1371 | 1371 | $final_saves[$string_key] = array( |
1372 | - 'find' => "\s*\?".'>$', |
|
1373 | - 'replace' => "\n\$" . $type . '[\'' . $string_key . '\'] = ' . $string_val['string'] . ';' . "\n\n?".'>', |
|
1372 | + 'find' => "\s*\?" . '>$', |
|
1373 | + 'replace' => "\n\$" . $type . '[\'' . $string_key . '\'] = ' . $string_val['string'] . ';' . "\n\n?" . '>', |
|
1374 | 1374 | 'is_regex' => true, |
1375 | 1375 | ); |
1376 | 1376 | } |
@@ -1387,8 +1387,8 @@ discard block |
||
1387 | 1387 | $subKey = ctype_digit(trim($substring_key, '\'')) ? trim($substring_key, '\'') : '\'' . $substring_key . '\''; |
1388 | 1388 | |
1389 | 1389 | $final_saves[$string_key . '[' . $substring_key . ']'] = array( |
1390 | - 'find' => "\s*\?".'>$', |
|
1391 | - 'replace' => "\n\$" . $type . '[\'' . $string_key . '\'][' . $subKey . '] = ' . $substring_val['string'] . ';' . "\n\n?".'>', |
|
1390 | + 'find' => "\s*\?" . '>$', |
|
1391 | + 'replace' => "\n\$" . $type . '[\'' . $string_key . '\'][' . $subKey . '] = ' . $substring_val['string'] . ';' . "\n\n?" . '>', |
|
1392 | 1392 | 'is_regex' => true, |
1393 | 1393 | ); |
1394 | 1394 | } |
@@ -236,7 +236,7 @@ |
||
236 | 236 | $header = 'POST /cgi-bin/webscr HTTP/1.1' . "\r\n"; |
237 | 237 | $header .= 'content-type: application/x-www-form-urlencoded' . "\r\n"; |
238 | 238 | $header .= 'Host: www.' . (!empty($modSettings['paidsubs_test']) ? 'sandbox.' : '') . 'paypal.com' . "\r\n"; |
239 | - $header .= 'content-length: ' . strlen ($requestString) . "\r\n"; |
|
239 | + $header .= 'content-length: ' . strlen($requestString) . "\r\n"; |
|
240 | 240 | $header .= 'connection: close' . "\r\n\r\n"; |
241 | 241 | |
242 | 242 | // Open the connection. |
@@ -93,7 +93,6 @@ |
||
93 | 93 | |
94 | 94 | continue; |
95 | 95 | } |
96 | - |
|
97 | 96 | elseif (empty($row['show_online']) && empty($membersOnlineOptions['show_hidden'])) |
98 | 97 | { |
99 | 98 | // Just increase the stats and don't add this hidden user to any list. |
@@ -181,14 +181,14 @@ discard block |
||
181 | 181 | { |
182 | 182 | collapsedDiv.show(\'slow\'); |
183 | 183 | icon.removeClass(\'toggle_down\').addClass(\'toggle_up\'); |
184 | - icon.prop(\'title\', '. JavaScriptEscape($txt['hide']) .'); |
|
184 | + icon.prop(\'title\', '. JavaScriptEscape($txt['hide']) . '); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | else |
188 | 188 | { |
189 | 189 | collapsedDiv.hide(\'slow\'); |
190 | 190 | icon.removeClass(\'toggle_up\').addClass(\'toggle_down\'); |
191 | - icon.prop(\'title\', '. JavaScriptEscape($txt['show']) .'); |
|
191 | + icon.prop(\'title\', '. JavaScriptEscape($txt['show']) . '); |
|
192 | 192 | } |
193 | 193 | });', true); |
194 | 194 | } |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | |
642 | 642 | // Setup the correct template, even though I'll admit we ain't downloading ;) |
643 | 643 | $context['sub_template'] = 'downloaded'; |
644 | - $allowext = array('.zip','.tgz','.gz'); |
|
644 | + $allowext = array('.zip', '.tgz', '.gz'); |
|
645 | 645 | // @todo Use FTP if the Packages directory is not writable. |
646 | 646 | |
647 | 647 | // Check the file was even sent! |
@@ -653,13 +653,13 @@ discard block |
||
653 | 653 | // Make sure it has a sane filename. |
654 | 654 | $_FILES['package']['name'] = preg_replace(array('/\s/', '/\.[\.]+/', '/[^\w_\.\-]/'), array('_', '.', ''), $_FILES['package']['name']); |
655 | 655 | $extension = substr(strrchr(strtolower($_FILES['package']['name']), '.'), 0); |
656 | - if(!in_array($extension, $allowext)) |
|
656 | + if (!in_array($extension, $allowext)) |
|
657 | 657 | { |
658 | 658 | fatal_lang_error('package_upload_error_supports', false, array('zip, tgz, tar.gz')); |
659 | 659 | } |
660 | 660 | |
661 | 661 | // We only need the filename... |
662 | - $extension = ($extension == '.gz') ? '.tar.gz' : $extension ; |
|
662 | + $extension = ($extension == '.gz') ? '.tar.gz' : $extension; |
|
663 | 663 | $packageName = time() . $extension; |
664 | 664 | |
665 | 665 | // Setup the destination and throw an error if the file is already there! |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | 'member_name' => $regOptions['username'], |
587 | 587 | 'email_address' => $regOptions['email'], |
588 | 588 | 'passwd' => hash_password($regOptions['username'], $regOptions['password']), |
589 | - 'password_salt' => substr(md5($smcFunc['random_int']()), 0, 4) , |
|
589 | + 'password_salt' => substr(md5($smcFunc['random_int']()), 0, 4), |
|
590 | 590 | 'posts' => 0, |
591 | 591 | 'date_registered' => time(), |
592 | 592 | 'member_ip' => $regOptions['interface'] == 'admin' ? '127.0.0.1' : $user_info['ip'], |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | 'time_offset', |
677 | 677 | ); |
678 | 678 | $knownInets = array( |
679 | - 'member_ip','member_ip2', |
|
679 | + 'member_ip', 'member_ip2', |
|
680 | 680 | ); |
681 | 681 | |
682 | 682 | // Call an optional function to validate the users' input. |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | $checkName = strtr($name, array('_' => '\\_', '%' => '\\%')); |
905 | 905 | |
906 | 906 | //when we got no wildcard we can use equal -> fast |
907 | - $operator = (strpos($checkName, '%') || strpos($checkName, '_') ? 'LIKE' : '=' ); |
|
907 | + $operator = (strpos($checkName, '%') || strpos($checkName, '_') ? 'LIKE' : '='); |
|
908 | 908 | |
909 | 909 | // Make sure they don't want someone else's name. |
910 | 910 | $request = $smcFunc['db_query']('', ' |
@@ -1273,7 +1273,7 @@ discard block |
||
1273 | 1273 | $user_info['buddies'][] = $userReceiver; |
1274 | 1274 | |
1275 | 1275 | // And add a nice alert. Don't abuse though! |
1276 | - if ((cache_get_data('Buddy-sent-'. $user_info['id'] .'-'. $userReceiver, 86400)) == null) |
|
1276 | + if ((cache_get_data('Buddy-sent-' . $user_info['id'] . '-' . $userReceiver, 86400)) == null) |
|
1277 | 1277 | { |
1278 | 1278 | $smcFunc['db_insert']('insert', |
1279 | 1279 | '{db_prefix}background_tasks', |
@@ -1288,7 +1288,7 @@ discard block |
||
1288 | 1288 | ); |
1289 | 1289 | |
1290 | 1290 | // Store this in a cache entry to avoid creating multiple alerts. Give it a long life cycle. |
1291 | - cache_put_data('Buddy-sent-'. $user_info['id'] .'-'. $userReceiver, '1', 86400); |
|
1291 | + cache_put_data('Buddy-sent-' . $user_info['id'] . '-' . $userReceiver, '1', 86400); |
|
1292 | 1292 | } |
1293 | 1293 | } |
1294 | 1294 |
@@ -1257,7 +1257,7 @@ discard block |
||
1257 | 1257 | ); |
1258 | 1258 | if (empty($value)) |
1259 | 1259 | { |
1260 | - $deletes = array('id_theme' => 1 , 'variable' => $row['col_name'], 'id_member' => $memID); |
|
1260 | + $deletes = array('id_theme' => 1, 'variable' => $row['col_name'], 'id_member' => $memID); |
|
1261 | 1261 | unset($user_profile[$memID]['options'][$row['col_name']]); |
1262 | 1262 | } |
1263 | 1263 | else |
@@ -1285,7 +1285,7 @@ discard block |
||
1285 | 1285 | array('id_theme', 'variable', 'id_member') |
1286 | 1286 | ); |
1287 | 1287 | if (!empty($deletes)) |
1288 | - $smcFunc['db_query']('',' |
|
1288 | + $smcFunc['db_query']('', ' |
|
1289 | 1289 | DELETE FROM {db_prefix}themes |
1290 | 1290 | WHERE id_theme = {int:id_theme} AND |
1291 | 1291 | variable = {string:variable} AND |
@@ -262,8 +262,8 @@ discard block |
||
262 | 262 | |
263 | 263 | case 'datetime': |
264 | 264 | 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) |
265 | - return 'str_to_date('. |
|
266 | - 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]). |
|
265 | + return 'str_to_date(' . |
|
266 | + 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]) . |
|
267 | 267 | ',\'%Y-%m-%d %h:%i:%s\')'; |
268 | 268 | else |
269 | 269 | smf_db_error_backtrace('Wrong value type sent to the database. Datetime expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__); |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | $old_pos = 0; |
415 | 415 | $pos = -1; |
416 | 416 | // Remove the string escape for better runtime |
417 | - $db_string_1 = str_replace('\\\'','',$db_string); |
|
417 | + $db_string_1 = str_replace('\\\'', '', $db_string); |
|
418 | 418 | while (true) |
419 | 419 | { |
420 | 420 | $pos = strpos($db_string_1, '\'', $pos + 1); |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | { |
801 | 801 | $count = count($insertRows); |
802 | 802 | $ai = 0; |
803 | - for($i = 0; $i < $count; $i++) |
|
803 | + for ($i = 0; $i < $count; $i++) |
|
804 | 804 | { |
805 | 805 | $old_id = $smcFunc['db_insert_id'](); |
806 | 806 | |
@@ -826,13 +826,13 @@ discard block |
||
826 | 826 | $count2 = count($indexed_columns); |
827 | 827 | for ($x = 0; $x < $count2; $x++) |
828 | 828 | { |
829 | - $where_string += key($indexed_columns[$x]) . ' = '. $insertRows[$i][$x]; |
|
829 | + $where_string += key($indexed_columns[$x]) . ' = ' . $insertRows[$i][$x]; |
|
830 | 830 | if (($x + 1) < $count2) |
831 | 831 | $where_string += ' AND '; |
832 | 832 | } |
833 | 833 | |
834 | - $request = $smcFunc['db_query']('',' |
|
835 | - SELECT `'. $keys[0] . '` FROM ' . $table .' |
|
834 | + $request = $smcFunc['db_query']('', ' |
|
835 | + SELECT `'. $keys[0] . '` FROM ' . $table . ' |
|
836 | 836 | WHERE ' . $where_string . ' LIMIT 1', |
837 | 837 | array() |
838 | 838 | ); |
@@ -861,7 +861,7 @@ discard block |
||
861 | 861 | $return_var = array(); |
862 | 862 | $count = count($insertRows); |
863 | 863 | $start = smf_db_insert_id($table, $keys[0]); |
864 | - for ($i = 0; $i < $count; $i++ ) |
|
864 | + for ($i = 0; $i < $count; $i++) |
|
865 | 865 | $return_var[] = $start + $i; |
866 | 866 | } |
867 | 867 | return $return_var; |
@@ -998,7 +998,7 @@ discard block |
||
998 | 998 | mysqli_stmt_bind_param($mysql_error_data_prep, 'iissssssis', |
999 | 999 | $error_array[0], $error_array[1], $error_array[2], $error_array[3], $error_array[4], $error_array[5], $error_array[6], |
1000 | 1000 | $error_array[7], $error_array[8], $error_array[9]); |
1001 | - mysqli_stmt_execute ($mysql_error_data_prep); |
|
1001 | + mysqli_stmt_execute($mysql_error_data_prep); |
|
1002 | 1002 | } |
1003 | 1003 | |
1004 | 1004 | /** |
@@ -1012,7 +1012,7 @@ discard block |
||
1012 | 1012 | */ |
1013 | 1013 | function smf_db_custom_order($field, $array_values, $desc = false) |
1014 | 1014 | { |
1015 | - $return = 'CASE '. $field . ' '; |
|
1015 | + $return = 'CASE ' . $field . ' '; |
|
1016 | 1016 | $count = count($array_values); |
1017 | 1017 | $then = ($desc ? ' THEN -' : ' THEN '); |
1018 | 1018 |