|
@@ -60,30 +60,24 @@ if ($UseTooltipster) { ?>
|
60
|
60
|
<link rel="stylesheet" href="<?=STATIC_SERVER?>styles/tooltipster/style.css?v=<?=filemtime(SERVER_ROOT.'/static/styles/tooltipster/style.css')?>" type="text/css" media="screen" />
|
61
|
61
|
<?
|
62
|
62
|
}
|
63
|
|
-if ($Mobile) { ?>
|
64
|
|
- <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0, user-scalable=no;" />
|
65
|
|
- <link rel="stylesheet" type="text/css" href="<?=STATIC_SERVER ?>styles/mobile/style.css" />
|
66
|
|
-<?
|
67
|
|
-} else {
|
68
|
|
- if (empty(G::$LoggedUser['StyleURL'])) {
|
|
63
|
+if (empty(G::$LoggedUser['StyleURL'])) {
|
69
|
64
|
?>
|
70
|
|
- <link rel="stylesheet" type="text/css" title="<?=G::$LoggedUser['StyleName']?>" media="screen"
|
71
|
|
- href="<?=STATIC_SERVER?>styles/<?=G::$LoggedUser['StyleName']?>/style.css?v=<?=filemtime(SERVER_ROOT.'/static/styles/'.G::$LoggedUser['StyleName'].'/style.css')?>" />
|
|
65
|
+<link rel="stylesheet" type="text/css" title="<?=G::$LoggedUser['StyleName']?>" media="screen"
|
|
66
|
+ href="<?=STATIC_SERVER?>styles/<?=G::$LoggedUser['StyleName']?>/style.css?v=<?=filemtime(SERVER_ROOT.'/static/styles/'.G::$LoggedUser['StyleName'].'/style.css')?>" />
|
72
|
67
|
<?
|
|
68
|
+} else {
|
|
69
|
+ $StyleURLInfo = parse_url(G::$LoggedUser['StyleURL']);
|
|
70
|
+ if (substr(G::$LoggedUser['StyleURL'], -4) == '.css'
|
|
71
|
+ && empty($StyleURLInfo['query']) && empty($StyleURLInfo['fragment'])
|
|
72
|
+ && ($StyleURLInfo['host'] == SITE_DOMAIN)
|
|
73
|
+ && file_exists(SERVER_ROOT.$StyleURLInfo['path'])) {
|
|
74
|
+ $StyleURL = G::$LoggedUser['StyleURL'].'?v='.filemtime(SERVER_ROOT.$StyleURLInfo['path']);
|
73
|
75
|
} else {
|
74
|
|
- $StyleURLInfo = parse_url(G::$LoggedUser['StyleURL']);
|
75
|
|
- if (substr(G::$LoggedUser['StyleURL'], -4) == '.css'
|
76
|
|
- && empty($StyleURLInfo['query']) && empty($StyleURLInfo['fragment'])
|
77
|
|
- && ($StyleURLInfo['host'] == SITE_DOMAIN)
|
78
|
|
- && file_exists(SERVER_ROOT.$StyleURLInfo['path'])) {
|
79
|
|
- $StyleURL = G::$LoggedUser['StyleURL'].'?v='.filemtime(SERVER_ROOT.$StyleURLInfo['path']);
|
80
|
|
- } else {
|
81
|
|
- $StyleURL = G::$LoggedUser['StyleURL'];
|
82
|
|
- }
|
|
76
|
+ $StyleURL = G::$LoggedUser['StyleURL'];
|
|
77
|
+ }
|
83
|
78
|
?>
|
84
|
|
- <link rel="stylesheet" type="text/css" media="screen" href="<?=$StyleURL?>" title="External CSS" />
|
|
79
|
+<link rel="stylesheet" type="text/css" media="screen" href="<?=$StyleURL?>" title="External CSS" />
|
85
|
80
|
<?
|
86
|
|
- }
|
87
|
81
|
}
|
88
|
82
|
$ExtraCSS = explode(',', $CSSIncludes);
|
89
|
83
|
foreach ($ExtraCSS as $CSS) {
|
|
@@ -110,14 +104,14 @@ foreach ($Scripts as $Script) {
|
110
|
104
|
if (trim($Script) == '') {
|
111
|
105
|
continue;
|
112
|
106
|
}
|
|
107
|
+ if (($ScriptStats = G::$Cache->get_value("script_stats_$Script")) === false || $ScriptStats['mtime'] != filemtime(STATIC_SERVER."functions/$Script.js")) {
|
|
108
|
+ $ScriptStats['mtime'] = filemtime(STATIC_SERVER."functions/$Script.js");
|
|
109
|
+ $ScriptStats['hash'] = base64_encode(hash_file(INTEGRITY_ALGO, STATIC_SERVER."functions/$Script.js", true));
|
|
110
|
+ $ScriptStats['algo'] = INTEGRITY_ALGO;
|
|
111
|
+ G::$Cache->cache_value("script_stats_$Script", $ScriptStats);
|
|
112
|
+ }
|
113
|
113
|
?>
|
114
|
|
- <script
|
115
|
|
- src="<?=STATIC_SERVER?>functions/<?=$Script?>.js?v=<?=filemtime(SERVER_ROOT.'/static/functions/'.$Script.'.js')?>"
|
116
|
|
- type="text/javascript"></script>
|
117
|
|
-<?
|
118
|
|
-}
|
119
|
|
-if ($Mobile) { ?>
|
120
|
|
- <script src="<?=STATIC_SERVER?>styles/mobile/style.js" type="text/javascript"></script>
|
|
114
|
+ <script src="<?=STATIC_SERVER."functions/$Script.js?v=$ScriptStats[mtime]"?>" type="text/javascript" integrity="<?="$ScriptStats[algo]-$ScriptStats[hash]"?>"></script>
|
121
|
115
|
<?
|
122
|
116
|
}
|
123
|
117
|
|