Add comments to page_menu.php

This commit is contained in:
manfromhuh 2022-07-05 14:45:16 -04:00
parent 58f94c415d
commit de3986efcb

View File

@ -4,6 +4,7 @@
<?php <?php
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/get_month_name.php'); include_once ($_SERVER['DOCUMENT_ROOT'].'/common/get_month_name.php');
//Removes the number used to keep articles in post order from the displayed title.
function remove_sorting_number($link_title){ function remove_sorting_number($link_title){
$first_three = mb_substr($link_title, 0, 3,"UTF-8"); $first_three = mb_substr($link_title, 0, 3,"UTF-8");
@ -31,14 +32,14 @@ if (file_exists($dir) && is_dir($dir) ) {
$file_array[] = $file; $file_array[] = $file;
} }
} }
foreach($file_array as $file) { foreach($file_array as $file) {//Renders the folder names as more readable titles.
$_replace = array('.php', '.html', '.htm'); $_replace = array('.php', '.html', '.htm');//Remove file extensions from webpages.
$link_title = str_replace('_',' ',$file); $link_title = str_replace('_',' ',$file);//Remove undersores and replace them with spaces
$link_title = str_replace($_replace,'',$link_title); $link_title = str_replace($_replace,'',$link_title);
$link_title = ucwords($link_title); $link_title = ucwords($link_title);//Set the first letter of each word to upercase.
$link_title = get_month_name($link_title); $link_title = get_month_name($link_title);//
$link_title = remove_sorting_number($link_title); $link_title = remove_sorting_number($link_title);//Removes the number used to keep articles in post order from the displayed title.
echo("<ul><li><a href='$file'> $link_title </a></li></ul>\n"); echo("<ul><li><a href='$file'> $link_title </a></li></ul>\n");//Output the result.
} }
} }
else { else {