From 56336ee3d5ec32647f6dbf35cf09f94a13795b60 Mon Sep 17 00:00:00 2001 From: Connor Thomson Date: Sat, 19 Sep 2026 10:51:36 -0700 Subject: Random fixes and updates --- app.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) mode change 100644 => 100755 app.php (limited to 'app.php') diff --git a/app.php b/app.php old mode 100644 new mode 100755 index 62fdda7..6a4b41e --- a/app.php +++ b/app.php @@ -24,17 +24,22 @@ define('ROOT_DIR', __DIR__ . '/'); define('HTML_DIR', __DIR__ . '/html/'); define('PHP_DIR', __DIR__ . '/php/'); -require_once PHP_DIR . 'templates.php'; +require_once PHP_DIR . 'replace.php'; +require_once PHP_DIR . 'execute.php'; +require_once PHP_DIR . 'path-clean.php'; -$file = $_GET['file'] ?? 'index.html'; +$file = path_clean($_GET['file'] ?? 'index.html'); -$components = [ - '{{HEADER}}' => HTML_DIR . 'header.html', - '{{CONTENT}}' => ROOT_DIR . $file, - '{{FOOTER}}' => PHP_DIR . 'footer.php' +$device = 'desktop'; + +$targets = [ + '{{header}}' => file_get_contents(HTML_DIR . 'header.html'), + '{{content}}' => file_get_contents(ROOT_DIR . $file), + '{{footer}}' => execute(PHP_DIR . 'footer.php'), + '{{device}}' => $device ]; -$app_html = template_process(HTML_DIR . 'app.html', $components); +$app_html = replace(HTML_DIR . 'app.html', $targets); echo $app_html; ?> -- cgit v1.2.3