Update functions.php
This commit is contained in:
@@ -2986,9 +2986,9 @@ function phpbb_ip_normalise(string $address)
|
||||
|
||||
// If is ipv4
|
||||
if (stripos($ip_normalised, '::ffff:') === 0)
|
||||
{
|
||||
{
|
||||
$ip_normalised = substr($ip_normalised, 7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $ip_normalised;
|
||||
@@ -4129,6 +4129,9 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
|
||||
$template->assign_var('S_FORM_TOKEN_LOGIN', '');
|
||||
}
|
||||
|
||||
$current_hour = date('H');
|
||||
$day_state = $current_hour >= 6 && $current_hour <= 18 ? 'jour' : 'nuit';
|
||||
|
||||
// The following assigns all _common_ variables that may be used at any point in a template.
|
||||
$template->assign_vars(array(
|
||||
'SITENAME' => $config['sitename'],
|
||||
@@ -4243,8 +4246,8 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
|
||||
'T_ICONS_PATH' => "{$web_path}{$config['icons_path']}/",
|
||||
'T_RANKS_PATH' => "{$web_path}{$config['ranks_path']}/",
|
||||
'T_UPLOAD_PATH' => "{$web_path}{$config['upload_path']}/",
|
||||
'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'],
|
||||
'T_STYLESHEET_LANG_LINK'=> "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'],
|
||||
'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet_' . $day_state . '.css?assets_version=' . $config['assets_version'],
|
||||
'T_STYLESHEET_LANG_LINK'=> "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet_' . $day_state . '.css?assets_version=' . $config['assets_version'],
|
||||
'T_FONT_AWESOME_LINK' => !empty($config['allow_cdn']) && !empty($config['load_font_awesome_url']) ? $config['load_font_awesome_url'] : "{$web_path}assets/css/font-awesome.min.css?assets_version=" . $config['assets_version'],
|
||||
'T_JQUERY_LINK' => !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery-3.4.1.min.js?assets_version=" . $config['assets_version'],
|
||||
'S_ALLOW_CDN' => !empty($config['allow_cdn']),
|
||||
@@ -4350,7 +4353,7 @@ function phpbb_generate_debug_output(\phpbb\db\driver\driver_interface $db, \php
|
||||
$totaltime = microtime(true) - $GLOBALS['starttime'];
|
||||
$debug_info[] = sprintf('<span title="SQL time: %.3fs / PHP time: %.3fs">Time: %.3fs</span>', $db->get_sql_time(), ($totaltime - $db->get_sql_time()), $totaltime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($phpbb_container->getParameter('debug.memory'))
|
||||
{
|
||||
@@ -4360,7 +4363,7 @@ function phpbb_generate_debug_output(\phpbb\db\driver\driver_interface $db, \php
|
||||
$memory_usage = get_formatted_filesize($memory_usage);
|
||||
|
||||
$debug_info[] = 'Peak Memory Usage: ' . $memory_usage;
|
||||
}
|
||||
}
|
||||
|
||||
$debug_info[] = 'GZIP: ' . (($config['gzip_compress'] && @extension_loaded('zlib')) ? 'On' : 'Off');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user