forked from 20xd6/simple_blog
Compare commits
5 Commits
93514c0e1d
...
de3986efcb
Author | SHA1 | Date | |
---|---|---|---|
de3986efcb | |||
58f94c415d | |||
4117b552f2 | |||
a00013d619 | |||
ef7056be35 |
@ -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":
|
||||
|
@ -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);
|
||||
|
@ -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'));
|
||||
|
@ -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');
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user