@@ -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}', |
@@ -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 | ), |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $class_name = $this->getImplementationClassKeyName(); |
| 185 | 185 | $class_name_txt_key = strtolower($class_name); |
| 186 | 186 | |
| 187 | - $config_vars[] = $txt['cache_'. $class_name_txt_key .'_settings']; |
|
| 187 | + $config_vars[] = $txt['cache_' . $class_name_txt_key . '_settings']; |
|
| 188 | 188 | $config_vars[] = array('cachedir', $txt['cachedir'], 'file', 'text', 36, 'cache_cachedir'); |
| 189 | 189 | |
| 190 | 190 | if (!isset($context['settings_post_javascript'])) |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | $context['settings_post_javascript'] .= ' |
| 194 | 194 | $("#cache_accelerator").change(function (e) { |
| 195 | 195 | var cache_type = e.currentTarget.value; |
| 196 | - $("#cachedir").prop("disabled", cache_type != "'. $class_name .'"); |
|
| 196 | + $("#cachedir").prop("disabled", cache_type != "'. $class_name . '"); |
|
| 197 | 197 | });'; |
| 198 | 198 | } |
| 199 | 199 | |
@@ -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">' . |
@@ -1638,7 +1638,7 @@ |
||
| 1638 | 1638 | $cacheAPIdir = $sourcedir . '/Cache'; |
| 1639 | 1639 | |
| 1640 | 1640 | $loadedApis = array(); |
| 1641 | - $apis_dir = $cacheAPIdir .'/'. CacheApi::APIS_FOLDER; |
|
| 1641 | + $apis_dir = $cacheAPIdir . '/' . CacheApi::APIS_FOLDER; |
|
| 1642 | 1642 | |
| 1643 | 1643 | $api_classes = new GlobIterator($apis_dir . '/*.php', FilesystemIterator::NEW_CURRENT_AND_KEY); |
| 1644 | 1644 | |
@@ -131,14 +131,14 @@ discard block |
||
| 131 | 131 | $class_name = $this->getImplementationClassKeyName(); |
| 132 | 132 | $class_name_txt_key = strtolower($class_name); |
| 133 | 133 | |
| 134 | - $config_vars[] = $txt['cache_'. $class_name_txt_key .'_settings']; |
|
| 134 | + $config_vars[] = $txt['cache_' . $class_name_txt_key . '_settings']; |
|
| 135 | 135 | $config_vars[] = array( |
| 136 | - 'cachedir_'. $class_name_txt_key, |
|
| 137 | - $txt['cachedir_'. $class_name_txt_key], |
|
| 136 | + 'cachedir_' . $class_name_txt_key, |
|
| 137 | + $txt['cachedir_' . $class_name_txt_key], |
|
| 138 | 138 | 'file', |
| 139 | 139 | 'text', |
| 140 | 140 | 36, |
| 141 | - 'cache_'. $class_name_txt_key .'_cachedir'); |
|
| 141 | + 'cache_' . $class_name_txt_key . '_cachedir'); |
|
| 142 | 142 | |
| 143 | 143 | if (!isset($context['settings_post_javascript'])) |
| 144 | 144 | $context['settings_post_javascript'] = ''; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $context['settings_post_javascript'] .= ' |
| 147 | 147 | $("#cache_accelerator").change(function (e) { |
| 148 | 148 | var cache_type = e.currentTarget.value; |
| 149 | - $("#cachedir_'. $class_name_txt_key .'").prop("disabled", cache_type != "'. $class_name .'"); |
|
| 149 | + $("#cachedir_'. $class_name_txt_key . '").prop("disabled", cache_type != "' . $class_name . '"); |
|
| 150 | 150 | });'; |
| 151 | 151 | } |
| 152 | 152 | |
@@ -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; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | // Set a list of common functions. |
| 105 | 105 | $ent_list = '&(?:#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . '|quot|amp|lt|gt|nbsp);'; |
| 106 | 106 | $ent_check = empty($modSettings['disableEntityCheck']) ? function($string) |
| 107 | - { |
|
| 107 | + { |
|
| 108 | 108 | $string = preg_replace_callback('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'entity_fix__callback', $string); |
| 109 | 109 | return $string; |
| 110 | 110 | } : function($string) |
@@ -929,7 +929,6 @@ discard block |
||
| 929 | 929 | $user_info_min[$row['id_member']]['time_offset'] = ($tz_user->getOffset($time_user) - |
| 930 | 930 | $tz_system->getOffset($time_system)) / 3600; |
| 931 | 931 | } |
| 932 | - |
|
| 933 | 932 | else |
| 934 | 933 | $user_info_min[$row['id_member']]['time_offset'] = empty($row['time_offset']) ? 0 : $row['time_offset']; |
| 935 | 934 | } |
@@ -1657,7 +1656,6 @@ discard block |
||
| 1657 | 1656 | $time_user = new DateTime('now', $tz_user); |
| 1658 | 1657 | $profile['time_offset'] = ($tz_user->getOffset($time_user) - $tz_system->getOffset($time_system)) / 3600; |
| 1659 | 1658 | } |
| 1660 | - |
|
| 1661 | 1659 | else |
| 1662 | 1660 | { |
| 1663 | 1661 | // !!! Compatibility. |
@@ -2322,7 +2320,6 @@ discard block |
||
| 2322 | 2320 | loadLanguage('index+Modifications'); |
| 2323 | 2321 | $context['template_layers'] = array(); |
| 2324 | 2322 | } |
| 2325 | - |
|
| 2326 | 2323 | else |
| 2327 | 2324 | { |
| 2328 | 2325 | // Custom templates to load, or just default? |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | 'filename' => empty($user_settings['filename']) ? '' : $user_settings['filename'], |
| 815 | 815 | 'custom_dir' => !empty($user_settings['attachment_type']) && $user_settings['attachment_type'] == 1, |
| 816 | 816 | 'id_attach' => isset($user_settings['id_attach']) ? $user_settings['id_attach'] : 0, |
| 817 | - 'width' => isset($user_settings['attachment_width']) > 0 ? $user_settings['attachment_width']: 0, |
|
| 817 | + 'width' => isset($user_settings['attachment_width']) > 0 ? $user_settings['attachment_width'] : 0, |
|
| 818 | 818 | 'height' => isset($user_settings['attachment_height']) > 0 ? $user_settings['attachment_height'] : 0, |
| 819 | 819 | ), |
| 820 | 820 | 'smiley_set' => isset($user_settings['smiley_set']) ? $user_settings['smiley_set'] : '', |
@@ -2708,8 +2708,7 @@ discard block |
||
| 2708 | 2708 | $context['css_files_order'] = array(); |
| 2709 | 2709 | |
| 2710 | 2710 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
| 2711 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
| 2712 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2711 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2713 | 2712 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
| 2714 | 2713 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
| 2715 | 2714 | $params['minimize'] = isset($params['minimize']) ? $params['minimize'] : true; |
@@ -2823,8 +2822,7 @@ discard block |
||
| 2823 | 2822 | global $settings, $context, $modSettings; |
| 2824 | 2823 | |
| 2825 | 2824 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
| 2826 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
| 2827 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2825 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2828 | 2826 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
| 2829 | 2827 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
| 2830 | 2828 | $params['async'] = isset($params['async']) ? $params['async'] : false; |
@@ -3567,8 +3565,7 @@ discard block |
||
| 3567 | 3565 | |
| 3568 | 3566 | // What accelerator we are going to try. |
| 3569 | 3567 | $cache_class_name = !empty($cache_accelerator) ? $cache_accelerator : CacheApi::APIS_DEFAULT; |
| 3570 | - $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : |
|
| 3571 | - CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
| 3568 | + $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
| 3572 | 3569 | |
| 3573 | 3570 | // Do some basic tests. |
| 3574 | 3571 | if (class_exists($fully_qualified_class_name)) |
@@ -3872,7 +3869,7 @@ discard block |
||
| 3872 | 3869 | $auth_secret = hash_file('sha256', $boarddir . '/Settings.php'); |
| 3873 | 3870 | |
| 3874 | 3871 | // Set the last error to now, but only every 15 minutes. Don't need to flood the logs. |
| 3875 | - if (empty($db_last_error) || ($db_last_error + 60*15) <= time()) |
|
| 3872 | + if (empty($db_last_error) || ($db_last_error + 60 * 15) <= time()) |
|
| 3876 | 3873 | { |
| 3877 | 3874 | updateDbLastError(time()); |
| 3878 | 3875 | loadLanguage('Errors'); |
@@ -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 | } |