more php because it no work

This commit is contained in:
Richard Mikloš 2024-01-25 12:52:20 +01:00
parent 9e768198f6
commit 11d04499ba

@ -80,7 +80,6 @@ if (isset($_SESSION['user_id'])) {
$page_data = str_replace('<template name="username">', $_SESSION['user_username'], $page_data);
}
$page_regex = '/<!--PAGENAME=(.*?)-->/s';
$page_style_regex = '/<!--PAGESTYLE=(.*?)-->/s';
@ -93,14 +92,15 @@ if (preg_match($page_regex, $page_data, $matches)) {
if (preg_match($page_style_regex, $page_data, $style_matches)) {
$page_style = $style_matches[1];
$page_data = str_replace('<template name="page styling">', $page_style, $page_data);
$page_data = str_replace('<!--PAGESTYLE=' . $page_style . '-->', '', $page_data);
} else {
$page_style = "/styles/pages/$page_name.css";
$page_data = str_replace('<template name="page styling">', $page_style, $page_data);
}
$output = str_replace('<template name="page name">', $page_style, $output);
$output = str_replace('<template name="page name">', $page_name, $output);
$output = str_replace('<template name="page styling">', $page_style, $output);
$output = str_replace('<template name="page content">', $page_data, $output);
echo $output;
?>
?>