Browse Source

Use absolute static path

spaghetti 8 years ago
parent
commit
ef8cbde3aa
2 changed files with 4 additions and 4 deletions
  1. 1
    1
      classes/config.template
  2. 3
    3
      classes/view.class.php

+ 1
- 1
classes/config.template View File

26
 define('API_KEYS', ['ANIDB' => 'AAAAAAAAAAAAAAAA']);
26
 define('API_KEYS', ['ANIDB' => 'AAAAAAAAAAAAAAAA']);
27
 
27
 
28
 // Allows you to run static content off another server. Default is usually what you want.
28
 // Allows you to run static content off another server. Default is usually what you want.
29
-define('STATIC_SERVER', 'static/');
29
+define('STATIC_SERVER', '/static/');
30
 
30
 
31
 // The hashing algorithm used for SRI
31
 // The hashing algorithm used for SRI
32
 define('INTEGRITY_ALGO', 'sha256');
32
 define('INTEGRITY_ALGO', 'sha256');

+ 3
- 3
classes/view.class.php View File

34
       $Styles = array_merge(['tooltipster'], explode(',', $CSSIncludes));
34
       $Styles = array_merge(['tooltipster'], explode(',', $CSSIncludes));
35
       foreach ($Scripts as $Script) {
35
       foreach ($Scripts as $Script) {
36
         if (trim($Script) == '') { continue; }
36
         if (trim($Script) == '') { continue; }
37
-        header('Link: </'.STATIC_SERVER.'functions/'.$Script.'.js?v='.filemtime(SERVER_ROOT.'/static/functions/'.$Script.'.js').'>; rel=preload;', false);
37
+        header('Link: <'.STATIC_SERVER.'functions/'.$Script.'.js?v='.filemtime(SERVER_ROOT.STATIC_SERVER.'functions/'.$Script.'.js').'>; rel=preload;', false);
38
       }
38
       }
39
-      header('Link: </'.STATIC_SERVER.'styles/global.css?v='.filemtime(SERVER_ROOT.'/static/styles/global.css').'>; rel=preload;', false);
39
+      header('Link: <'.STATIC_SERVER.'styles/global.css?v='.filemtime(SERVER_ROOT.STATIC_SERVER.'styles/global.css').'>; rel=preload;', false);
40
       foreach ($Styles as $Style) {
40
       foreach ($Styles as $Style) {
41
         if (trim($Style) == '') { continue; }
41
         if (trim($Style) == '') { continue; }
42
-        header('Link: </'.STATIC_SERVER.'styles/'.$Style.'/style.css?v='.filemtime(SERVER_ROOT.'/static/styles/'.$Style.'/style.css').'>; rel=preload;', false);
42
+        header('Link: <'.STATIC_SERVER.'styles/'.$Style.'/style.css?v='.filemtime(SERVER_ROOT.STATIC_SERVER.'styles/'.$Style.'/style.css').'>; rel=preload;', false);
43
       }
43
       }
44
       require(SERVER_ROOT.'/design/privateheader.php');
44
       require(SERVER_ROOT.'/design/privateheader.php');
45
     }
45
     }

Loading…
Cancel
Save