Compare commits

...

5 Commits

Author SHA1 Message Date
de3986efcb Add comments to page_menu.php 2022-07-05 14:45:16 -04:00
58f94c415d Add comments to index.php 2022-07-05 14:40:20 -04:00
4117b552f2 Add comments to header.php
This file needs it's Title() function cleaned up.
2022-07-05 14:36:54 -04:00
a00013d619 Add comments to h1_month.php 2022-07-05 14:33:18 -04:00
ef7056be35 Add comments to get_month_name.php 2022-07-05 14:32:11 -04:00
5 changed files with 17 additions and 10 deletions

View File

@ -1,4 +1,5 @@
<?php
//Parses it's passed input to convert it to a month name.
function get_month_name($passed_var){
switch($passed_var){
case "01":

View File

@ -1,4 +1,5 @@
<?php
//Sets the proper level 1 heading for the folder.
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/get_month_name.php');
$current_dir = basename(getcwd());
$named_month = get_month_name($current_dir);

View File

@ -1,7 +1,8 @@
<!DOCTYPE html>
<html lang="en-US">
<?php
function Title() {
//Sets the page title based on the name of the current directory
function Title() {//Needs cleanup.
//~ $new_title = $_SERVER['REQUEST_URI'];
//~ $new_title = preg_replace("/^^\//i", "", $new_title);
@ -27,7 +28,7 @@
?>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<?php
<?php//If a tags file is present parse it and add any tags found to the renderd page's metadata.
if(file_exists('tags')){
$tag_data_raw = fopen('tags',"r");
$tag_data = fread($tag_data_raw, filesize('tags'));

View File

@ -1,7 +1,10 @@
<?php
//The common file used to render pages on the blog.
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/header.php');
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/menu.php');
if (file_exists('article.md')){
//Looks for an article.md to see if the current directory is an article or not
//If it is not then it is a menu page.
if (file_exists('article.md')){
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/md_read.php');
} else {
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/h1_month.php');

View File

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