mnhgfrewsdfghgfdsasdfghji

This commit is contained in:
Richard Mikloš 2024-01-20 19:56:55 +01:00
parent c8cbbc0d98
commit 68a00667ae

@ -22,16 +22,6 @@ $page = basename($_SERVER['QUERY_STRING']);
$nav = include_ob("$template_dir/navigation.html"); $nav = include_ob("$template_dir/navigation.html");
$page_regex = '/<!--PAGENAME=(.*?)-->/';
if(preg_match($page_regex, $htmlWithComments, $matches)){
$page_name = $matches[1];
print_r($matches);
}
else{
$page_name = ucfirst($page);
}
if(empty($page)){ if(empty($page)){
@ -75,6 +65,15 @@ if (isset($_SESSION['user_id'])) {
$page_data = str_replace('<template name="username">', $_SESSION['user_username'], $page_data); $page_data = str_replace('<template name="username">', $_SESSION['user_username'], $page_data);
} }
$page_regex = '/<!--PAGENAME=(.*?)-->/';
if(preg_match($page_regex, $page_data, $matches)){
$page_name = $matches[1];
}
else{
$page_name = ucfirst($page);
}
$output = str_replace('<template name="page name">', $page_name, $output); $output = str_replace('<template name="page name">', $page_name, $output);
echo $output; echo $output;