diff --git a/design/privateheader.php b/design/privateheader.php
index 6d3b793..5667c2f 100755
--- a/design/privateheader.php
+++ b/design/privateheader.php
@@ -60,30 +60,24 @@ if ($UseTooltipster) { ?>
}
-if ($Mobile) { ?>
-
-
-
-} else {
- if (empty(G::$LoggedUser['StyleURL'])) {
+if (empty(G::$LoggedUser['StyleURL'])) {
?>
-
+
+} else {
+ $StyleURLInfo = parse_url(G::$LoggedUser['StyleURL']);
+ if (substr(G::$LoggedUser['StyleURL'], -4) == '.css'
+ && empty($StyleURLInfo['query']) && empty($StyleURLInfo['fragment'])
+ && ($StyleURLInfo['host'] == SITE_DOMAIN)
+ && file_exists(SERVER_ROOT.$StyleURLInfo['path'])) {
+ $StyleURL = G::$LoggedUser['StyleURL'].'?v='.filemtime(SERVER_ROOT.$StyleURLInfo['path']);
} else {
- $StyleURLInfo = parse_url(G::$LoggedUser['StyleURL']);
- if (substr(G::$LoggedUser['StyleURL'], -4) == '.css'
- && empty($StyleURLInfo['query']) && empty($StyleURLInfo['fragment'])
- && ($StyleURLInfo['host'] == SITE_DOMAIN)
- && file_exists(SERVER_ROOT.$StyleURLInfo['path'])) {
- $StyleURL = G::$LoggedUser['StyleURL'].'?v='.filemtime(SERVER_ROOT.$StyleURLInfo['path']);
- } else {
- $StyleURL = G::$LoggedUser['StyleURL'];
- }
+ $StyleURL = G::$LoggedUser['StyleURL'];
+ }
?>
-
+
- }
}
$ExtraCSS = explode(',', $CSSIncludes);
foreach ($ExtraCSS as $CSS) {
@@ -110,14 +104,14 @@ foreach ($Scripts as $Script) {
if (trim($Script) == '') {
continue;
}
+ if (($ScriptStats = G::$Cache->get_value("script_stats_$Script")) === false || $ScriptStats['mtime'] != filemtime(STATIC_SERVER."functions/$Script.js")) {
+ $ScriptStats['mtime'] = filemtime(STATIC_SERVER."functions/$Script.js");
+ $ScriptStats['hash'] = base64_encode(hash_file(INTEGRITY_ALGO, STATIC_SERVER."functions/$Script.js", true));
+ $ScriptStats['algo'] = INTEGRITY_ALGO;
+ G::$Cache->cache_value("script_stats_$Script", $ScriptStats);
+ }
?>
-
-
-}
-if ($Mobile) { ?>
-
+
}
diff --git a/design/publicheader.php b/design/publicheader.php
index 1588982..ebb06fb 100755
--- a/design/publicheader.php
+++ b/design/publicheader.php
@@ -9,13 +9,20 @@ define('FOOTER_FILE',SERVER_ROOT.'/design/publicfooter.php');
-
-
-
-
-
-
- $img = array_diff(scandir(SERVER_ROOT.'/misc/bg', 1), array('.', '..')); ?>
+
+ $Scripts = ['jquery', 'script_start', 'ajax.class', 'cookie.class', 'storage.class', 'global'];
+ foreach($Scripts as $Script) {
+ if (($ScriptStats = G::$Cache->get_value("script_stats_$Script")) === false || $ScriptStats['mtime'] != filemtime(STATIC_SERVER."functions/$Script.js")) {
+ $ScriptStats['mtime'] = filemtime(STATIC_SERVER."functions/$Script.js");
+ $ScriptStats['hash'] = base64_encode(hash_file(INTEGRITY_ALGO, STATIC_SERVER."functions/$Script.js", true));
+ $ScriptStats['algo'] = INTEGRITY_ALGO;
+ G::$Cache->cache_value("script_stats_$Script", $ScriptStats);
+ }
+?>
+
+
+ }
+ $img = array_diff(scandir(SERVER_ROOT.'/misc/bg', 1), array('.', '..')); ?>