summaryrefslogtreecommitdiff
path: root/php
diff options
context:
space:
mode:
Diffstat (limited to 'php')
-rwxr-xr-x[-rw-r--r--]php/execute.php0
-rwxr-xr-xphp/footer.php2
-rwxr-xr-xphp/header.php30
-rwxr-xr-x[-rw-r--r--]php/index.php2
-rwxr-xr-xphp/render.php11
5 files changed, 38 insertions, 7 deletions
diff --git a/php/execute.php b/php/execute.php
index bd8fe18..bd8fe18 100644..100755
--- a/php/execute.php
+++ b/php/execute.php
diff --git a/php/footer.php b/php/footer.php
index 695b39f..652bf3e 100755
--- a/php/footer.php
+++ b/php/footer.php
@@ -22,7 +22,7 @@ require_once ROOT . '/php/replace.php';
$year = date('Y');
$targets = [
- '{{YEAR}}' => $year
+ '{{year}}' => $year
];
$html = replace(ROOT . '/html/footer.html', $targets);
diff --git a/php/header.php b/php/header.php
new file mode 100755
index 0000000..93cdbf9
--- /dev/null
+++ b/php/header.php
@@ -0,0 +1,30 @@
+<?php
+/*
+ * GNUfault.org - GNUfault's website
+ * Copyright (C) 2026 Connor Thomson
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+require_once ROOT . '/php/replace.php';
+
+$targets = [
+ '{{navbar}}' => file_get_contents(ROOT . '/html/navbar.html')
+];
+
+$html = replace(ROOT . '/html/header.html', $targets);
+
+echo $html;
+
+?> \ No newline at end of file
diff --git a/php/index.php b/php/index.php
index 2f2377d..cdf976d 100644..100755
--- a/php/index.php
+++ b/php/index.php
@@ -24,6 +24,6 @@ require_once ROOT . '/php/render.php';
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$file = rtrim($path, '/') . '/content.html';
-render_page(ROOT . $file);
+render_content(ROOT . $file);
?>
diff --git a/php/render.php b/php/render.php
index eab7c82..68d1b96 100755
--- a/php/render.php
+++ b/php/render.php
@@ -20,14 +20,15 @@
require_once ROOT . '/php/replace.php';
require_once ROOT . '/php/execute.php';
-function render_page(string $page) {
+function render_content(string $page) {
$device = 'desktop';
$targets = [
- '{{header}}' => file_get_contents(ROOT . '/html/header.html'),
- '{{content}}' => file_get_contents($page),
- '{{footer}}' => execute(ROOT . '/php/footer.php'),
- '{{device}}' => $device
+ '{{stylesheets}}' => file_get_contents(ROOT . '/html/stylesheets.html'),
+ '{{header}}' => execute(ROOT . '/php/header.php'),
+ '{{content}}' => file_get_contents($page),
+ '{{footer}}' => execute(ROOT . '/php/footer.php'),
+ '{{device}}' => $device
];
$main_html = replace(ROOT . '/html/main.html', $targets);