adlerka.top/templates/navpages.php
2024-01-11 10:28:00 +01:00

26 lines
747 B
PHP

<?php
ob_start();
$navsite_template = '<li><a class="navsite_link" href="__LOCATION__" __CLASS__>__NAME__</a><ul class="navpage_list"></ul></li>';
$navpage_template = '<li><a class="navpage_link" href="__LOCATION__" __CLASS__>__NAME__</a></li>';
$page_dir = "pages";
$site_dirs = array_diff(scandir($page_dir), array('.', '..'));
$domain = basename(explode('.', $_SERVER['HTTP_HOST'])[1]);
$tld = basename(explode('.', $_SERVER['HTTP_HOST'])[2]);
foreach($site_dirs as $site_dir){
$pages_dir = array_diff(scandir("$page_dir/$site_dir"), array('.', '..'));
$navpages = "";
foreach($pages_dir as $page_dir){
$navpage = $navpage_template;
$navpage =
$navpages .= $navpage;
}
}
return ob_get_clean();
?>