Move title path thing to page title

This commit is contained in:
Frankie B 2022-12-20 20:55:38 +00:00
commit dcc3c8dd54
12 changed files with 32 additions and 37 deletions

22
inc/title.inc.php Normal file
View file

@ -0,0 +1,22 @@
<title><?php
$uri = $_SERVER['REQUEST_URI'];
if ($uri === '/') { echo '~floppydisk'; }
else {
$uri = substr(substr($uri, 1), 0, -1);
if (!strpos($uri, '/')) {
$uriArr = explode('/', $uri);
$link = "/";
$links = '~floppydisk / ';
$currentDir = basename(getcwd());
foreach($uriArr as $page) {
if ($page !== $currentDir) {
if ($link !== '/') $link = $link . '/' . $page;
else $link = $link . $page;
$links = $links . $link . $page . ' / ';
}
}
$links = substr($links, 0, -3) . ' / ' . $currentDir;
echo $links;
}
}
?></title>