From 2195834edbc91935b70f937ce7a168d3a2e0c3b8 Mon Sep 17 00:00:00 2001 From: Frankie B Date: Tue, 20 Dec 2022 20:55:38 +0000 Subject: Move title path thing to page title --- inc/nav.inc.php | 27 --------------------------- inc/title.inc.php | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 27 deletions(-) create mode 100644 inc/title.inc.php (limited to 'inc') diff --git a/inc/nav.inc.php b/inc/nav.inc.php index e75445c..c626142 100644 --- a/inc/nav.inc.php +++ b/inc/nav.inc.php @@ -9,31 +9,4 @@ guestbook -
- - ~floppydisk / '; - $currentDir = basename(getcwd()); - foreach($uriArr as $page) { - if ($page !== $currentDir) { - if ($link !== '/') $link = $link . '/' . $page; - else $link = $link . $page; - $links = $links . '' . $page . ' / '; - } - } - $links = substr($links, 0, -3) . ' / ' . $currentDir; - echo $links; - } - } - ?> - - -
\ No newline at end of file diff --git a/inc/title.inc.php b/inc/title.inc.php new file mode 100644 index 0000000..149f0c8 --- /dev/null +++ b/inc/title.inc.php @@ -0,0 +1,22 @@ +<?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; + } +} +?> -- cgit v1.2.3-54-g00ecf