brainstorm mobile css works now

This commit is contained in:
John Alanbrook 2022-11-04 22:55:34 +00:00
parent 95cc44d8ff
commit e5636867b7

View file

@ -5,25 +5,8 @@ require "parsedown.php";
$tryuri = ltrim("$_SERVER[REQUEST_URI]", '/'); $tryuri = ltrim("$_SERVER[REQUEST_URI]", '/');
$tryuri = strtok($tryuri, "?"); $tryuri = strtok($tryuri, "?");
$lockscn = $tryuri; if (page_locked($tryuri)) {
if (file_exists("$lockscn.lock" ))
load_page("404"); 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")) { if (file_exists("site.json")) {
@ -53,7 +36,7 @@ function get_path_content($path) {
} }
} else { } else {
$fy = "$f/index.json"; $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; 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;
}
?> ?>