brainstorm mobile css works now
This commit is contained in:
parent
95cc44d8ff
commit
e5636867b7
43
router.php
43
router.php
|
@ -5,25 +5,8 @@ require "parsedown.php";
|
|||
$tryuri = ltrim("$_SERVER[REQUEST_URI]", '/');
|
||||
$tryuri = strtok($tryuri, "?");
|
||||
|
||||
$lockscn = $tryuri;
|
||||
|
||||
if (file_exists("$lockscn.lock" ))
|
||||
if (page_locked($tryuri)) {
|
||||
load_page("404");
|
||||
|
||||
while ($lockscn != "") {
|
||||
$files = scandir($lockscn);
|
||||
|
||||
if (!$files)
|
||||
goto CONT;
|
||||
|
||||
for ($i = 2; $i < count($files); $i++) {
|
||||
if ($files[$i] == "lock") {
|
||||
load_page("404");
|
||||
}
|
||||
}
|
||||
|
||||
CONT:
|
||||
$lockscn = substr($lockscn, 0, strrpos($lockscn, '/'));
|
||||
}
|
||||
|
||||
if (file_exists("site.json")) {
|
||||
|
@ -53,7 +36,7 @@ function get_path_content($path) {
|
|||
}
|
||||
} else {
|
||||
$fy = "$f/index.json";
|
||||
if (file_exists($fy)) $titles[] = ["c" => json_decode(file_get_contents($fy), true), "link" => uri_from_file($fy)];
|
||||
if (file_exists($fy) && !page_locked($fy)) $titles[] = ["c" => json_decode(file_get_contents($fy), true), "link" => uri_from_file($fy)];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -162,6 +145,28 @@ function img_src($src, $root = "" ) {
|
|||
return $write;
|
||||
}
|
||||
|
||||
function page_locked($page) {
|
||||
if (file_exists("$page.lock" ))
|
||||
return true;
|
||||
|
||||
while ($page != "") {
|
||||
$files = scandir($page);
|
||||
|
||||
if (!$files)
|
||||
goto CONT;
|
||||
|
||||
for ($i = 2; $i < count($files); $i++) {
|
||||
if ($files[$i] == "lock") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
CONT:
|
||||
$page = substr($page, 0, strrpos($page, '/'));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue