keep json includes in data/ subdir
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 22 May 2019 21:50:59 +0000 (23:50 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 22 May 2019 22:06:02 +0000 (00:06 +0200)
.gitignore
widget.html
widget.php

index da8f6c34063f732fd597bc74495ed7858698ccc3..e6601b5f2b448f8bceb710e1482e66c05375fcc0 100644 (file)
@@ -1 +1,2 @@
 /.blizzard.passwd.pl
 /.blizzard.passwd.pl
+/data/*.json
index d6f5f8d66ddeef85b5e32b721724e4873d38e5b2..26bdd168836cf38547ac14f277a68e7bf195658e 100644 (file)
@@ -13,8 +13,7 @@
 <p id="clan">No clan data</p>
 <script>
        let request = this.location.pathname.split('/')
 <p id="clan">No clan data</p>
 <script>
        let request = this.location.pathname.split('/')
-       request.splice(2, 1) // strip page name
-       fetch(request.join('/') + '.json')
+       fetch('/schtarr/data/' + request.pop() + '.json')
        .then(res => {
                if (res.status != 200) {
                        console.log('got %o', res)
        .then(res => {
                if (res.status != 200) {
                        console.log('got %o', res)
index ddf9cb854aa8df3f823df1a03c9a1dee7d465d2e..e222f22afdc64b9ab63605ca39540458a8af7fd5 100644 (file)
@@ -18,7 +18,7 @@ function error($message, $status = 500)
 }
 
 $request = trim($_SERVER['PATH_INFO'], '/');
 }
 
 $request = trim($_SERVER['PATH_INFO'], '/');
-$target = "$request.json";
+$target = "data/$request.json";
 $last = file_exists($target) ? filemtime($target) : 0;
 
 if ($last < time() - 3600) {
 $last = file_exists($target) ? filemtime($target) : 0;
 
 if ($last < time() - 3600) {