@@ -355,8 +355,8 @@ |
||
| 355 | 355 | elseif (isset($_POST['delall']) && isset($filter)) |
| 356 | 356 | { |
| 357 | 357 | // ip need a different placeholder type |
| 358 | - $filter_type = $filter['variable'] == 'ip'? 'inet' : 'string'; |
|
| 359 | - $filter_op = $filter['variable'] == 'ip'? '=' : 'LIKE'; |
|
| 358 | + $filter_type = $filter['variable'] == 'ip' ? 'inet' : 'string'; |
|
| 359 | + $filter_op = $filter['variable'] == 'ip' ? '=' : 'LIKE'; |
|
| 360 | 360 | $smcFunc['db_query']('', ' |
| 361 | 361 | DELETE FROM {db_prefix}log_errors |
| 362 | 362 | WHERE ' . $filter['variable'] . ' ' . $filter_op . ' {' . $filter_type . ':filter}', |
@@ -467,20 +467,20 @@ |
||
| 467 | 467 | $context['posts'][$key]['quickbuttons'] = array( |
| 468 | 468 | 'reply' => array( |
| 469 | 469 | 'label' => $txt['reply'], |
| 470 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'], |
|
| 470 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'], |
|
| 471 | 471 | 'icon' => 'reply_button', |
| 472 | 472 | 'show' => $post['can_reply'] |
| 473 | 473 | ), |
| 474 | 474 | 'quote' => array( |
| 475 | 475 | 'label' => $txt['quote_action'], |
| 476 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'].';quote='.$post['id'], |
|
| 476 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'] . ';quote=' . $post['id'], |
|
| 477 | 477 | 'icon' => 'quote', |
| 478 | 478 | 'show' => $post['can_quote'] |
| 479 | 479 | ), |
| 480 | 480 | 'delete' => array( |
| 481 | 481 | 'label' => $txt['remove'], |
| 482 | - 'href' => $scripturl.'?action=deletemsg;msg='.$post['id'].';topic='.$post['topic'].';recent;'.$context['session_var'].'='.$context['session_id'], |
|
| 483 | - 'javascript' => 'data-confirm="'.$txt['remove_message'].'"', |
|
| 482 | + 'href' => $scripturl . '?action=deletemsg;msg=' . $post['id'] . ';topic=' . $post['topic'] . ';recent;' . $context['session_var'] . '=' . $context['session_id'], |
|
| 483 | + 'javascript' => 'data-confirm="' . $txt['remove_message'] . '"', |
|
| 484 | 484 | 'class' => 'you_sure', |
| 485 | 485 | 'icon' => 'remove_button', |
| 486 | 486 | 'show' => $post['can_delete'] |
@@ -1289,7 +1289,6 @@ |
||
| 1289 | 1289 | if (!empty($modSettings['enableAllMessages']) && $topic_length < $modSettings['enableAllMessages']) |
| 1290 | 1290 | $pages .= sprintf(strtr($settings['page_index']['page'], array('{URL}' => $scripturl . '?topic=' . $row['id_topic'] . '.0;all')), '', $txt['all']); |
| 1291 | 1291 | } |
| 1292 | - |
|
| 1293 | 1292 | else |
| 1294 | 1293 | $pages = ''; |
| 1295 | 1294 | |
@@ -644,13 +644,13 @@ discard block |
||
| 644 | 644 | 'quickbuttons' => array( |
| 645 | 645 | 'edit' => array( |
| 646 | 646 | 'label' => $txt['draft_edit'], |
| 647 | - 'href' => $scripturl.'?action=post;'.(empty($row['id_topic']) ? 'board='.$row['id_board'] : 'topic='.$row['id_topic']).'.0;id_draft='.$row['id_draft'], |
|
| 647 | + 'href' => $scripturl . '?action=post;' . (empty($row['id_topic']) ? 'board=' . $row['id_board'] : 'topic=' . $row['id_topic']) . '.0;id_draft=' . $row['id_draft'], |
|
| 648 | 648 | 'icon' => 'modify_button' |
| 649 | 649 | ), |
| 650 | 650 | 'delete' => array( |
| 651 | 651 | 'label' => $txt['draft_delete'], |
| 652 | - 'href' => $scripturl.'?action=profile;u='.$context['member']['id'].';area=showdrafts;delete='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 653 | - 'javascript' => 'data-confirm="'.$txt['draft_remove'].'"', |
|
| 652 | + 'href' => $scripturl . '?action=profile;u=' . $context['member']['id'] . ';area=showdrafts;delete=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 653 | + 'javascript' => 'data-confirm="' . $txt['draft_remove'] . '"', |
|
| 654 | 654 | 'class' => 'you_sure', |
| 655 | 655 | 'icon' => 'remove_button' |
| 656 | 656 | ), |
@@ -837,13 +837,13 @@ discard block |
||
| 837 | 837 | 'quickbuttons' => array( |
| 838 | 838 | 'edit' => array( |
| 839 | 839 | 'label' => $txt['draft_edit'], |
| 840 | - 'href' => $scripturl.'?action=pm;sa=showpmdrafts;id_draft='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 840 | + 'href' => $scripturl . '?action=pm;sa=showpmdrafts;id_draft=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 841 | 841 | 'icon' => 'modify_button' |
| 842 | 842 | ), |
| 843 | 843 | 'delete' => array( |
| 844 | 844 | 'label' => $txt['draft_delete'], |
| 845 | - 'href' => $scripturl.'?action=pm;sa=showpmdrafts;delete='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 846 | - 'javascript' => 'data-confirm="'.$txt['draft_remove'].'?"', |
|
| 845 | + 'href' => $scripturl . '?action=pm;sa=showpmdrafts;delete=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 846 | + 'javascript' => 'data-confirm="' . $txt['draft_remove'] . '?"', |
|
| 847 | 847 | 'class' => 'you_sure', |
| 848 | 848 | 'icon' => 'remove_button' |
| 849 | 849 | ), |
@@ -707,7 +707,6 @@ |
||
| 707 | 707 | $cache_level = array($txt['cache_off']); |
| 708 | 708 | $apis_names['none'] = $txt['cache_off']; |
| 709 | 709 | } |
| 710 | - |
|
| 711 | 710 | else |
| 712 | 711 | { |
| 713 | 712 | $txt['cache_settings_message'] = '<strong class="success">' . |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | // Cookies... |
| 478 | 478 | array('cookiename', $txt['cookie_name'], 'file', 'text', 20), |
| 479 | 479 | array('cookieTime', $txt['cookieTime'], 'db', 'select', array_filter(array_map( |
| 480 | - function ($str) use ($txt) |
|
| 480 | + function($str) use ($txt) |
|
| 481 | 481 | { |
| 482 | 482 | return isset($txt[$str]) ? $txt[$str] : ''; |
| 483 | 483 | }, |
@@ -1439,7 +1439,7 @@ discard block |
||
| 1439 | 1439 | // Obviously, we don't need null here. |
| 1440 | 1440 | $def['type'] = array_filter( |
| 1441 | 1441 | $def['type'], |
| 1442 | - function ($type) |
|
| 1442 | + function($type) |
|
| 1443 | 1443 | { |
| 1444 | 1444 | return $type !== 'NULL'; |
| 1445 | 1445 | } |
@@ -1765,7 +1765,7 @@ discard block |
||
| 1765 | 1765 | $cacheAPIdir = $sourcedir . '/Cache'; |
| 1766 | 1766 | |
| 1767 | 1767 | $loadedApis = array(); |
| 1768 | - $apis_dir = $cacheAPIdir .'/'. CacheApi::APIS_FOLDER; |
|
| 1768 | + $apis_dir = $cacheAPIdir . '/' . CacheApi::APIS_FOLDER; |
|
| 1769 | 1769 | |
| 1770 | 1770 | $api_classes = new GlobIterator($apis_dir . '/*.php', FilesystemIterator::NEW_CURRENT_AND_KEY); |
| 1771 | 1771 | |
@@ -163,7 +163,8 @@ |
||
| 163 | 163 | else |
| 164 | 164 | $context['help_text'] = $_GET['help']; |
| 165 | 165 | |
| 166 | - switch ($_GET['help']) { |
|
| 166 | + switch ($_GET['help']) |
|
| 167 | + { |
|
| 167 | 168 | case 'cal_short_months': |
| 168 | 169 | $context['help_text'] = sprintf($context['help_text'], $txt['months_short'][1], $txt['months_titles'][1]); |
| 169 | 170 | break; |
@@ -670,7 +670,7 @@ |
||
| 670 | 670 | foreach ($columns as $columnName => $type) |
| 671 | 671 | { |
| 672 | 672 | //check pk fiel |
| 673 | - IF (in_array($columnName, $keys)) |
|
| 673 | + if (in_array($columnName, $keys)) |
|
| 674 | 674 | { |
| 675 | 675 | $key_str .= ($count_pk > 0 ? ',' : ''); |
| 676 | 676 | $key_str .= $columnName; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | display_db_error(); |
| 76 | 76 | |
| 77 | 77 | // We need to escape ' and \ |
| 78 | - $db_passwd = str_replace(array('\\','\''), array('\\\\','\\\''), $db_passwd); |
|
| 78 | + $db_passwd = str_replace(array('\\', '\''), array('\\\\', '\\\''), $db_passwd); |
|
| 79 | 79 | |
| 80 | 80 | // Since pg_connect doesn't feed error info to pg_last_error, we have to catch issues with a try/catch. |
| 81 | 81 | set_error_handler( |
@@ -926,7 +926,7 @@ discard block |
||
| 926 | 926 | if ($inTransaction) |
| 927 | 927 | $smcFunc['db_transaction']('rollback'); |
| 928 | 928 | |
| 929 | - if(empty($db_persist)) |
|
| 929 | + if (empty($db_persist)) |
|
| 930 | 930 | { // without pooling |
| 931 | 931 | if (empty($pg_error_data_prep)) |
| 932 | 932 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
@@ -927,7 +927,8 @@ discard block |
||
| 927 | 927 | $smcFunc['db_transaction']('rollback'); |
| 928 | 928 | |
| 929 | 929 | if(empty($db_persist)) |
| 930 | - { // without pooling |
|
| 930 | + { |
|
| 931 | +// without pooling |
|
| 931 | 932 | if (empty($pg_error_data_prep)) |
| 932 | 933 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
| 933 | 934 | 'INSERT INTO ' . $db_prefix . 'log_errors |
@@ -938,7 +939,8 @@ discard block |
||
| 938 | 939 | pg_execute($db_connection, 'smf_log_errors', $error_array); |
| 939 | 940 | } |
| 940 | 941 | else |
| 941 | - { //with pooling |
|
| 942 | + { |
|
| 943 | +//with pooling |
|
| 942 | 944 | $pg_error_data_prep = pg_prepare($db_connection, '', |
| 943 | 945 | 'INSERT INTO ' . $db_prefix . 'log_errors |
| 944 | 946 | (id_member, log_time, ip, url, message, session, error_type, file, line, backtrace) |
@@ -280,7 +280,6 @@ discard block |
||
| 280 | 280 | $this_category[$row_board['id_board']]['board_class'] = 'on'; |
| 281 | 281 | $this_category[$row_board['id_board']]['board_tooltip'] = $txt['new_posts']; |
| 282 | 282 | } |
| 283 | - |
|
| 284 | 283 | else |
| 285 | 284 | { |
| 286 | 285 | $this_category[$row_board['id_board']]['board_tooltip'] = $txt['old_posts']; |
@@ -415,7 +414,6 @@ discard block |
||
| 415 | 414 | $this_last_post['href'] = $scripturl . '?topic=' . $row_board['id_topic'] . '.msg' . ($user_info['is_guest'] ? $row_board['id_msg'] : $row_board['new_from']) . (empty($row_board['is_read']) ? ';boardseen' : '') . '#new'; |
| 416 | 415 | $this_last_post['link'] = '<a href="' . $this_last_post['href'] . '" title="' . $row_board['subject'] . '">' . $row_board['short_subject'] . '</a>'; |
| 417 | 416 | } |
| 418 | - |
|
| 419 | 417 | else |
| 420 | 418 | { |
| 421 | 419 | $this_last_post['href'] = ''; |
@@ -510,8 +508,7 @@ discard block |
||
| 510 | 508 | $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']); |
| 511 | 509 | } |
| 512 | 510 | } |
| 513 | - |
|
| 514 | - else |
|
| 511 | + else |
|
| 515 | 512 | foreach ($this_category as &$board) |
| 516 | 513 | { |
| 517 | 514 | if (isset($boards_parsed_data_by_cat_id[$board['id_cat']][$board['id']])) |
@@ -195,8 +195,7 @@ |
||
| 195 | 195 | ); |
| 196 | 196 | |
| 197 | 197 | $categories[$row_board['id_cat']]['link'] = '<a id="c' . $row_board['id_cat'] . '"></a>' . (!$context['user']['is_guest'] ? |
| 198 | - '<a href="' . $scripturl . '?action=unread;c=' . $row_board['id_cat'] . '" title="' . sprintf($txt['new_posts_in_category'], $row_board['cat_name']) . '">' . $row_board['cat_name'] . '</a>' : |
|
| 199 | - $row_board['cat_name']); |
|
| 198 | + '<a href="' . $scripturl . '?action=unread;c=' . $row_board['id_cat'] . '" title="' . sprintf($txt['new_posts_in_category'], $row_board['cat_name']) . '">' . $row_board['cat_name'] . '</a>' : $row_board['cat_name']); |
|
| 200 | 199 | |
| 201 | 200 | } |
| 202 | 201 | |
@@ -851,7 +851,7 @@ discard block |
||
| 851 | 851 | |
| 852 | 852 | clean_cache('data'); |
| 853 | 853 | |
| 854 | - cache_put_data('parsed_boards_descriptions_'. $parsed_boards_cat_id, $already_parsed_boards, 864000); |
|
| 854 | + cache_put_data('parsed_boards_descriptions_' . $parsed_boards_cat_id, $already_parsed_boards, 864000); |
|
| 855 | 855 | |
| 856 | 856 | if (empty($boardOptions['dont_log'])) |
| 857 | 857 | logAction('edit_board', array('board' => $board_id), 'admin'); |
@@ -1579,7 +1579,7 @@ discard block |
||
| 1579 | 1579 | $context['description_allowed_tags'] |
| 1580 | 1580 | ); |
| 1581 | 1581 | |
| 1582 | - cache_put_data('parsed_boards_descriptions_'. $category_id, $already_parsed_boards, 864000); |
|
| 1582 | + cache_put_data('parsed_boards_descriptions_' . $category_id, $already_parsed_boards, 864000); |
|
| 1583 | 1583 | |
| 1584 | 1584 | return $already_parsed_boards; |
| 1585 | 1585 | } |
@@ -455,7 +455,7 @@ |
||
| 455 | 455 | |
| 456 | 456 | elseif ($context['uninstalling']) |
| 457 | 457 | echo ' |
| 458 | - ', $txt['package_uninstall_done'] .' <br> |
|
| 458 | + ', $txt['package_uninstall_done'] . ' <br> |
|
| 459 | 459 | ', '<a href="', $context['keep_url'], '" class="button">', $txt['package_keep'], '</a>', '<a href="', $context['remove_url'], '" class="button">', $txt['package_delete2'], '</a>'; |
| 460 | 460 | |
| 461 | 461 | elseif ($context['install_finished']) |