forked from 20xd6/simple_blog
Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8ce95a06d9 | |||
| fb1c649580 | |||
| 3a2dc7651a | |||
| d719bcf101 | |||
| b4c852a3c1 | |||
| 849d5a25b6 | |||
| 4d4ce6f0a5 | |||
| 340997fa89 | |||
| 4929ea5eb8 | |||
| 1cf4ffface | |||
| 17cf1d28f0 | |||
| f57ace3bad | |||
| 1da2fe8358 | |||
| 00a2458977 | |||
| 8302028049 | |||
| b692b22935 | |||
| 01de94a893 | |||
| bedc11a4ce | |||
| 842ea4e411 | |||
| 8b4b5dd31d | |||
| 35cd14e0b0 | |||
| d743fb297b | |||
| 87a07aaf02 | |||
| f1b3eec9d8 | |||
| 91119d3575 | |||
| 6b06c36b0b | |||
| 394e34b7b8 | |||
| de3986efcb | |||
| 58f94c415d | |||
| 4117b552f2 | |||
| a00013d619 | |||
| ef7056be35 | |||
| 93514c0e1d | |||
| a2ee59d2f3 | |||
| efcea55a8d | |||
| 5f3465bc9a | |||
| 9d9711cccc | |||
| 6df7971792 |
@@ -71,7 +71,7 @@ This directory contains the files and libraries used to render the site's pages.
|
||||
|
||||
#### CSS
|
||||
|
||||
* [styles.css](src/branch/master/common/styles.css) - The main site CSS.
|
||||
* [styles.css](/git/20xd6/simple_blog/src/branch/master/common/styles.css) - The main site CSS.
|
||||
* [jmenu.css]() - Used to render the responsive menus.
|
||||
* [print.css]() - Used to style printed pages.
|
||||
* [gallery.css]() - Styles the floating
|
||||
|
||||
67
blog/authors/index.php
Normal file
67
blog/authors/index.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
include ($_SERVER['DOCUMENT_ROOT'].'/common/php/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/menu.php');
|
||||
?>
|
||||
|
||||
<h1>Authors</h1>
|
||||
<nav id="body_nav" class="jmenu">
|
||||
<div class="pmenu">
|
||||
|
||||
<ul><li><a href=/>Home</a></li></ul>
|
||||
<?php
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/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");
|
||||
|
||||
if ( preg_match( '/[0-9][0-9] /', $first_three) ){
|
||||
$link_title = mb_substr($link_title,3);
|
||||
}
|
||||
return $link_title;
|
||||
}
|
||||
|
||||
|
||||
$dir = '.';
|
||||
// Check if the directory exists
|
||||
if (file_exists($dir) && is_dir($dir) ) {
|
||||
// Get the files of the directory as an array
|
||||
$scan_arr = scandir($dir);
|
||||
$files_arr = array_diff($scan_arr, array('.','..','index.php','common','.htaccess') );
|
||||
// echo "<pre>"; print_r( $files_arr ); echo "</pre>";
|
||||
// Get each files of our directory with line break
|
||||
foreach ($files_arr as $file) {
|
||||
//Get the file path
|
||||
$file_path = "./".$file;
|
||||
// Get the file extension
|
||||
$file_ext = pathinfo($file_path, PATHINFO_EXTENSION);
|
||||
if ($file_ext == "") {
|
||||
$file_array[] = $file;
|
||||
}
|
||||
}
|
||||
if (sizeof($file_array) != 0){
|
||||
foreach($file_array as $file) {//Renders the folder names as more readable titles.
|
||||
$link_title = str_replace('_',' ',$file);//Remove undersores and replace them with spaces
|
||||
$link_title = str_replace($_replace,'',$link_title);
|
||||
if (file_exists($file."/pfp.png")){
|
||||
$pfp_path = "$file/pfp.png";
|
||||
echo("<ul><li><img src=\"$pfp_path\" class=\"pfp\" name=\"$file pfp\"><a href='$file'> $link_title </a></li></ul>\n");//Output the result.
|
||||
} else {
|
||||
echo("<ul><li><a href='$file'> $link_title </a></li></ul>\n");//Output the result.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<ul><li><a>No Authors<a></li></ul>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "Directory does not exists";
|
||||
}
|
||||
echo("<ul><li><a href='..'>Back</a></li></ul>\n");
|
||||
?>
|
||||
</div><!--end of pmenu-->
|
||||
</nav>
|
||||
<br>
|
||||
<?php
|
||||
include ($_SERVER['DOCUMENT_ROOT'].'/common/php/footer.php');
|
||||
?>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/menu.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/menu.php');
|
||||
|
||||
echo "<article><h1 id=\"page_title\">Posts by Tag</h1></article>";
|
||||
echo "<div id=\"search_inputs\"><input type=\"text\" id=\"tag_sort\" onkeyup=\"tag_search()\" placeholder=\"Search Tags...\" title=\"Type a tage to search\"><input id=\"search_toggle\" type=\"button\" value=\"Search Titles\" onclick=\"search_toggle()\"></div><!--End Div Search Inputs-->";
|
||||
@@ -43,12 +43,12 @@
|
||||
//echo "</pre>\n";
|
||||
echo "<ul id=\"tag_menu\">\n";
|
||||
$coloum_number = 0;
|
||||
for ($row_number = 0; $row_number < $tags_rows; $row_number++){
|
||||
#echo $row_number;
|
||||
for ($row_number = 0; $row_number <= $tags_coloums; $row_number++){
|
||||
//echo $row_number;
|
||||
$section_title = $tags_csv[0][$coloum_number];
|
||||
echo "\t<li id=\"" . $section_title . "\"><b>" . $section_title . " </b>\n";
|
||||
for ($row = 1; $row < $tags_coloums; $row++){
|
||||
#echo "rn: " . $row_number . "\ncn:" . $coloum_number;
|
||||
//echo "rn: " . $row . "\ncn:" . $coloum_number ." ";
|
||||
$tag_content = $tags_csv[$row][$coloum_number];
|
||||
if ($tag_content == ""){
|
||||
break;
|
||||
@@ -64,5 +64,5 @@
|
||||
$coloum_number++;
|
||||
}
|
||||
echo "</ul>\n";
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/footer.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/footer.php');
|
||||
?>
|
||||
|
||||
14
common/authors/index.php
Normal file
14
common/authors/index.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
//The common file used to render pages on the blog.
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/menu.php');
|
||||
//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('byline.md')){
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/md_read.php');
|
||||
}
|
||||
if (file_exists('author.md')){
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/md_read.php');
|
||||
}
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/footer.php');
|
||||
?>
|
||||
@@ -125,6 +125,14 @@ img{
|
||||
img.center_align{
|
||||
vertical-align:middle;
|
||||
}
|
||||
img.pfp {
|
||||
vertical-align: middle;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
border-radius: 25px;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
.top{
|
||||
max-width: 100vw;
|
||||
float: left;
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/menu.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'common/php/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'common/php/menu.php');
|
||||
?>
|
||||
<h1 align="center">Error 403</h1>
|
||||
<p align="center">
|
||||
@@ -11,4 +11,4 @@ include_once ($_SERVER['DOCUMENT_ROOT'].'/common/menu.php');
|
||||
<br/>
|
||||
You're not allowed here. Stop that.<br/>
|
||||
</p>
|
||||
<?php include_once ($_SERVER['DOCUMENT_ROOT'].'/common/footer.php');?>
|
||||
<?php include_once ($_SERVER['DOCUMENT_ROOT'].'common/php/footer.php');?>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/menu.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'common/php/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'common/php/menu.php');
|
||||
?>
|
||||
<h1 align="center">Error 404</h1>
|
||||
<p align="center">
|
||||
@@ -21,4 +21,4 @@ include_once ($_SERVER['DOCUMENT_ROOT'].'/common/menu.php');
|
||||
</div>
|
||||
<br/>
|
||||
<br/>
|
||||
<?php include_once ($_SERVER['DOCUMENT_ROOT'].'/common/footer.php');?>
|
||||
<?php include_once ($_SERVER['DOCUMENT_ROOT'].'common/php/footer.php');?>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/menu.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'common/php/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'common/php/menu.php');
|
||||
?>
|
||||
<h1 align="center">Error 500</h1>
|
||||
<p align="center">
|
||||
<br/>
|
||||
We done made a boo boo...<br/>
|
||||
</p>
|
||||
<?php include_once ($_SERVER['DOCUMENT_ROOT'].'/common/footer.php');?>
|
||||
<?php include_once ($_SERVER['DOCUMENT_ROOT'].'common/php/footer.php');?>
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/menu.php');
|
||||
if (file_exists('article.md')){
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/md_read.php');
|
||||
} else {
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/h1_month.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/page_menu.php');
|
||||
}
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/footer.php');
|
||||
?>
|
||||
@@ -1,25 +1,30 @@
|
||||
//
|
||||
function format_page(){//Set the title of the page based on the main header, <h1>, tag.le != '' )){
|
||||
if ( document.getElementsByTagName('h1').length !== 0){
|
||||
document.title = document.getElementsByTagName('h1')[0].innerText;
|
||||
}
|
||||
//detect if the page contains code blocks to be highlighted and loads the prisim.js and prism.css files to accomplish this.
|
||||
//Detect if the page contains code blocks to be highlighted and loads the
|
||||
//prisim.js and prism.css files if codeblocks are found.
|
||||
code_tag = document.getElementsByTagName('code').length;
|
||||
if ( code_tag !== 0 ){
|
||||
var script = document.createElement('script');
|
||||
var style_sheet = document.createElement('link');
|
||||
script.type = 'text/javascript';
|
||||
script.src = '/common/prisim/prism.js';
|
||||
script.src = '/common/prism/prism.js';
|
||||
style_sheet.type = 'text/css';
|
||||
style_sheet.href = '/common/prisim/prism.css';
|
||||
style_sheet.href = '/common/prism/prism.css';
|
||||
style_sheet.rel = 'stylesheet';
|
||||
document.head.appendChild(script);
|
||||
document.head.appendChild(style_sheet);
|
||||
}
|
||||
//Sets the displayed fontsize.
|
||||
//This functionality won't work without JavaScript enabled. For this reason the
|
||||
//buttons won't be shown if this script isn't run.
|
||||
if ( document.getElementById("font_btns") ){//Show the font selection buttons.
|
||||
document.getElementById("font_btns").style.display = 'inline';
|
||||
var font_size = read_cookie("font_size");
|
||||
var font_size = read_cookie("font_size");//reads a saved value for fontsize from the site cookie
|
||||
if ( font_size != "" || font_size != "medium" ){
|
||||
font_set(font_size);
|
||||
font_set(font_size);//insure a sane default
|
||||
}
|
||||
}
|
||||
if ( document.getElementById("search_inputs") ){//Show the search box and button on the tags page.
|
||||
@@ -43,7 +48,7 @@ function format_page(){//Set the title of the page based on the main header, <h1
|
||||
});
|
||||
}
|
||||
}
|
||||
function font_set(size_to_set){
|
||||
function font_set(size_to_set){//Set a cookie to remember the fontsize selection.
|
||||
document.getElementById("article").style.fontSize = size_to_set;
|
||||
set_cookie("font_size",size_to_set);
|
||||
}
|
||||
@@ -52,7 +57,7 @@ function focus_element(element_id){
|
||||
ele_to_focus.focus();
|
||||
ele_to_focus.select();
|
||||
}
|
||||
function tag_search(){
|
||||
function tag_search(){//searches in the avaliable tags and displays all articles matching the searched tag.
|
||||
var search_input, filter, tag_list, li, a, i;
|
||||
search_input = document.getElementById("tag_sort");
|
||||
filter = search_input.value.toUpperCase();
|
||||
@@ -66,9 +71,8 @@ function tag_search(){
|
||||
li[i].style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
function title_search(){
|
||||
function title_search(){//searches for matches in the article titles rather than tags. Allows more granular search
|
||||
var search_input, filter, tag_list, li_list, ol, a, i;
|
||||
search_input = document.getElementById("title_sort");
|
||||
filter = search_input.value.toUpperCase();
|
||||
@@ -88,7 +92,7 @@ function title_search(){
|
||||
}
|
||||
|
||||
}
|
||||
function search_toggle(){
|
||||
function search_toggle(){//Toggles if the unit being sorted on is the article title or tag
|
||||
if (document.getElementById("tag_sort")){
|
||||
document.getElementById("tag_sort").placeholder = "Search Titles";
|
||||
document.getElementById("tag_sort").onkeyup = function() {title_search()};
|
||||
@@ -107,10 +111,10 @@ function search_toggle(){
|
||||
focus_element("tag_sort");
|
||||
}
|
||||
}
|
||||
function set_cookie(prop_name, prop_value){
|
||||
function set_cookie(prop_name, prop_value){//sets a passed cookie property and value.
|
||||
document.cookie = prop_name + "=" + prop_value + ";path=/;SameSite=Strict;";
|
||||
}
|
||||
function read_cookie(cname){
|
||||
function read_cookie(cname){//reads a property value
|
||||
let prop_name = cname + '=';
|
||||
let decoded_cookie = decodeURIComponent(document.cookie);
|
||||
let split_cookie = decoded_cookie.split(';');
|
||||
@@ -125,11 +129,11 @@ function read_cookie(cname){
|
||||
}
|
||||
return "";
|
||||
}
|
||||
function printDiv(divName) {
|
||||
function printDiv(divName) {//Formats the page for printing.
|
||||
var printContents = document.getElementById(divName).innerHTML;
|
||||
w=window.open();
|
||||
w.document.write(printContents);
|
||||
w.print();
|
||||
w.close();
|
||||
}
|
||||
window.onload = format_page;
|
||||
window.onload = format_page;//loades the page formatting script.
|
||||
@@ -1,11 +1,5 @@
|
||||
<?php
|
||||
#Markdown parser dependancy
|
||||
require ($_SERVER['DOCUMENT_ROOT'].'/common/vendor/autoload.php');
|
||||
#Markdown parseing code.
|
||||
$MD_Parser = new ParsedownExtra();
|
||||
$MD_Path = "article.md";
|
||||
$MD_File = fopen($MD_Path, "r") or die("File not found.");
|
||||
$MD_Text = fread($MD_File, filesize($MD_Path));
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/md_read.php');
|
||||
echo "<article id=\"article\">\n" . /* Adds the option to change the font size of the article text. */
|
||||
"<div id=\"font_btns\">
|
||||
Text Size:
|
||||
@@ -24,8 +18,8 @@
|
||||
<li><a href=\"article.md\" title=\"Download \">MD</a></li>
|
||||
</nav>
|
||||
".
|
||||
$MD_Parser->text($MD_Text) . "\n</article>";
|
||||
fclose($MD_File);
|
||||
read_md("article.md") . "\n</article>";
|
||||
|
||||
echo "\n</div><!--End of print-content div-->\n";
|
||||
echo("<nav class=\"jmenu\"><div class=\"pmenu\"><ul id=\"back_btn\"><li><a href='..'>Back</a></li></ul></div></nav>\n");
|
||||
if ($tag_data != NULL){
|
||||
@@ -37,5 +31,5 @@
|
||||
}
|
||||
echo "</ul>\n</div>\n";
|
||||
}
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/modal.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/modal.php');
|
||||
?>
|
||||
@@ -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,5 +1,6 @@
|
||||
<?php
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/get_month_name.php');
|
||||
//Sets the proper level 1 heading for the folder.
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/get_month_name.php');
|
||||
$current_dir = basename(getcwd());
|
||||
$named_month = get_month_name($current_dir);
|
||||
if ( $named_month == "blog") {
|
||||
@@ -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);
|
||||
@@ -28,6 +29,7 @@
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
||||
<?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'));
|
||||
@@ -38,10 +40,10 @@
|
||||
?>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title><?php $title = Title(); echo $title;?></title>
|
||||
<link href="/common/styles.css?v=<?php echo date('his'); ?>" type="text/css" rel="stylesheet"/>
|
||||
<link href="/common/jmenu.css?v=<?php echo date('his'); ?>" type="text/css" rel="stylesheet"/>
|
||||
<link href="/common/print.css?v=<?php echo date('his'); ?>" type="text/css" media="print" rel="stylesheet"/>
|
||||
<script type="text/javascript" src="/common/page_format.js?v=<?php echo date('his'); ?>"></script>
|
||||
<link href="/common/css/styles.css?v=<?php echo date('his'); ?>" type="text/css" rel="stylesheet"/>
|
||||
<link href="/common/css/jmenu.css?v=<?php echo date('his'); ?>" type="text/css" rel="stylesheet"/>
|
||||
<link href="/common/css/print.css?v=<?php echo date('his'); ?>" type="text/css" media="print" rel="stylesheet"/>
|
||||
<script type="text/javascript" src="/common/js/page_format.js?v=<?php echo date('his'); ?>"></script>
|
||||
</head>
|
||||
<body lang="en-US">
|
||||
<div class="body" id="body">
|
||||
14
common/php/index.php
Normal file
14
common/php/index.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
//The common file used to render pages on the blog.
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/menu.php');
|
||||
//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/php/article.php');
|
||||
} else {
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/h1_month.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/page_menu.php');
|
||||
}
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/footer.php');
|
||||
?>
|
||||
14
common/php/md_read.php
Normal file
14
common/php/md_read.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
#Markdown parser dependancy
|
||||
require ($_SERVER['DOCUMENT_ROOT'].'/common/vendor/autoload.php');
|
||||
function read_md($MD_Path){
|
||||
#Markdown parseing code.
|
||||
echo $md_path;
|
||||
$MD_Parser = new ParsedownExtra();
|
||||
#$MD_Path = $md_path;
|
||||
$MD_File = fopen($MD_Path, "r") or die("File not found.");
|
||||
$MD_Text = fread($MD_File, filesize($MD_Path));
|
||||
return $MD_Parser->text($MD_Text);
|
||||
fclose($MD_File);
|
||||
}
|
||||
?>
|
||||
@@ -2,8 +2,9 @@
|
||||
<div class="pmenu">
|
||||
<ul><li><a href=/>Home</a></li></ul>
|
||||
<?php
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/get_month_name.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/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 {
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
include ($_SERVER['DOCUMENT_ROOT'].'/common/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/menu.php');
|
||||
include ($_SERVER['DOCUMENT_ROOT'].'/common/php/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/menu.php');
|
||||
?>
|
||||
<article>
|
||||
<h1 title="Homepage for <?php $site = $_SERVER['SERVER_NAME'];echo"$site";?>">Homepage</h1>
|
||||
@@ -11,5 +11,5 @@ include_once ($_SERVER['DOCUMENT_ROOT'].'/common/menu.php');
|
||||
</div>
|
||||
</article>
|
||||
<?php
|
||||
include ($_SERVER['DOCUMENT_ROOT'].'/common/footer.php');
|
||||
include ($_SERVER['DOCUMENT_ROOT'].'/common/php/footer.php');
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
require ($_SERVER['DOCUMENT_ROOT'].'/common/vendor/autoload.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/menu.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/menu.php');
|
||||
#Markdown parseing code.
|
||||
$MD_Parser = new Parsedown();
|
||||
$MD_Path = "gplv2.md";
|
||||
@@ -10,5 +10,5 @@
|
||||
echo "<article>".$MD_Parser->text($MD_Text);
|
||||
fclose($MD_File);
|
||||
echo "<p>A text version of this document can be found <a href=\"/GPLv2.txt\">here</a>.</p>\n</article>";
|
||||
include ($_SERVER['DOCUMENT_ROOT'].'/common/footer.php');
|
||||
include ($_SERVER['DOCUMENT_ROOT'].'/common/php/footer.php');
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
require ($_SERVER['DOCUMENT_ROOT'].'/common/vendor/autoload.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/menu.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/menu.php');
|
||||
echo "<article>";
|
||||
?>
|
||||
<p>The MIT License (MIT)</p>
|
||||
@@ -15,5 +15,5 @@
|
||||
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
|
||||
<?php
|
||||
echo "<p>A text version of this document can be found <a href=\"/license/MIT.txt\">here</a>.</p>\n</article>";
|
||||
include ($_SERVER['DOCUMENT_ROOT'].'/common/footer.php');
|
||||
include ($_SERVER['DOCUMENT_ROOT'].'/common/php/footer.php');
|
||||
?>
|
||||
|
||||
@@ -3,12 +3,12 @@ function display_file($license_file){
|
||||
$out = file_get_contents($license_file);
|
||||
echo "<pre><code>".$out."</code></pre>";
|
||||
}
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/menu.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/header.php');
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/menu.php');
|
||||
?>
|
||||
<article>
|
||||
<p>A summery of all licenses that apply to this website.</p>
|
||||
<h2>Code License</h2>
|
||||
<h2>simple_blog License</h2>
|
||||
<font size="2">
|
||||
Copyright <?php echo(strftime("%Y")); ?> 20xd6<br>
|
||||
<br>
|
||||
@@ -46,5 +46,15 @@ JMenu is <a href="/license/MIT.php">MIT Licensed</a>.</p>
|
||||
<p>Parsedown is used for all of the Markdown processing for this site.<br/>
|
||||
Parsedown is <a href="/license/MIT.php">MIT Licensed</a>.</p>
|
||||
<?php display_file($_SERVER['DOCUMENT_ROOT'].'/common/vendor/erusev/parsedown/LICENSE.txt');?>
|
||||
<h3><a href="https://github.com/erusev/parsedown-extra">Parsedown Extra</a></h3>
|
||||
<blockquote><p>An extension of <a href="https://github.com/erusev/parsedown">Parsedown</a> that adds support for <a href="https://michelf.ca/projects/php-markdown/extra/">Markdown Extra.</a></p></blockquote>
|
||||
<p>Pasrsedown-extra is used primarily to add support for footnotes in articles. <br/>Parsedown-extra is <a href="/license/MIT.php">MIT Licensed</a>.</p>
|
||||
<?php display_file($_SERVER['DOCUMENT_ROOT'].'/common/vendor/erusev/parsedown-extra/LICENSE.txt');?>
|
||||
<h3>Prism</h3>
|
||||
<blockquote><p>Prism is a lightweight, robust, and elegant syntax highlighting library. It's a spin-off project from <a href="https://dabblet.com/">Dabblet</a>.<br/>
|
||||
You can learn more on <a href="https://prismjs.com/">prismjs.com</a>.</p></blockquote>
|
||||
<p>Prism is used for syntax highlighting is simple_blog.<br/>
|
||||
Prism is <a href="/license/MIT.php">MIT Licensed</a>.</p>
|
||||
<?php display_file("MIT_License.txt"); ?>
|
||||
</article>
|
||||
<?php include_once ($_SERVER['DOCUMENT_ROOT'].'/common/footer.php');?>
|
||||
<?php include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/footer.php');?>
|
||||
|
||||
Reference in New Issue
Block a user