1 Commits

4 changed files with 41 additions and 26 deletions
+16 -13
View File
@@ -49,14 +49,14 @@ Contains the blog articles. The articles are placed in subdirectories of `by_yea
```
├── by_year
├── 2021
├── 12
└── index.php -> /path/to/common/index.php
├── 2022
├── 01
├── 02
└── index.php -> /path/to/common/index.php
└── index.php
   ├── 2021
   │   ├── 12
   │   └── index.php -> /path/to/common/index.php
   ├── 2022
   │   ├── 01
   │   ├── 02
   │   └── index.php -> /path/to/common/index.php
   └── index.php
└── index.php -> /path/to/common/index.php
```
@@ -71,13 +71,16 @@ This directory contains the files and libraries used to render the site's pages.
#### CSS
* [styles.css](/git/20xd6/simple_blog/src/branch/master/common/css/styles.css) - The main site CSS.
* [jmenu.css](/git/20xd6/simple_blog/src/branch/master/common/css/jmenu.css) - Used to render the responsive menus.
* [print.css](/git/20xd6/simple_blog/src/branch/master/common/css/print.css) - Used to style printed pages.
* [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
#### [JS](/git/20xd6/simple_blog/src/branch/master/common/js)
#### JS
* [page_format.js](/git/20xd6/simple_blog/src/branch/master/common/js/page_format.js) - The main JS file used for formatting and adding extra functions to pages.
* font_size.js
* [page_format.js]() - The main JS file used for formatting and adding extra functions to pages.
* gallery.js
#### PHP
+1 -1
View File
@@ -5,7 +5,7 @@
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-->";
function read_tags($tags_file){
if (filesize($tags_file) == 0){
if (filesize($tags_vile) == 0){
echo "<br/>\n<br/>";
return;
}
+14 -11
View File
@@ -22,17 +22,20 @@
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 (file_exists('author') && (filesize('author') != 0)){
$author_name_raw = fopen('author', 'r');
$author_name = fread($author_name_raw, filesize('author'));
$author_name = str_replace("\n", "", $author_name);
$byline_path = $_SERVER['DOCUMENT_ROOT'].'blog/authors/'.$author_name.'/byline.md';
if (file_exists($byline_path)){
echo "<div class =\"byline\">\n"
. read_md($byline_path)
."</div><!--End byline div-->\n";
}
fclose($author_name_raw);
if (file_exists('author')){
$author_name_raw = fopen('author', 'r');
$author_name = fread($author_name_raw, filesize('author'));
$author_name = str_replace("\n", "", $author_name);
$byline_path = $_SERVER['DOCUMENT_ROOT'].'blog/authors/'.$author_name.'/byline.md';
if (file_exists($byline_path)){
echo "<div class =\"byline\">\n"
. read_md($byline_path)
."</div><!--End byline div-->\n";
} else {
echo "<h2>No byline</h2>";
echo "<p>$byline_path</p>";
}
fclose($author_name_raw);
}
if ($tag_data != NULL){
$page_tags = str_getcsv($tag_data);
+10 -1
View File
@@ -2,11 +2,20 @@
<html lang="en-US">
<?php
//Sets the page title based on the name of the current directory
function Title() {
function Title() {//Needs cleanup.
//~ $new_title = $_SERVER['REQUEST_URI'];
//~ $new_title = preg_replace("/^^\//i", "", $new_title);
//~ $new_title = preg_replace("/\//i", "", $new_title);
//~ $page_title = $_SERVER['REQUEST_URI'];
//~ $page_title = preg_replace("/^(.*)\//i", "", $page_title);
$page_title = basename($_SERVER['SCRIPT_FILENAME'], '.php');
//~ echo($page_title);
if(strtolower($page_title) == 'index'){
parse_str($_SERVER['REQUEST_URI'], $page_uri);
$page_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
//~ echo($page_path);
//~ $folder_name = sizeof($page_path);
$folder_name = explode("/", trim($page_path, "/"));
$page_title = $folder_name[(sizeof($folder_name) - 1)];
} elseif(strtolower($page_title) == 'homepage'){