12 Commits

Author SHA1 Message Date
b4ffc0b9f8 Merge branch 'master' into issue#5 2022-12-20 16:13:44 -05:00
b40b877a3f Update Readme.md 2022-12-20 15:54:03 -05:00
7734de9fa4 Merge pull request 'Fix issues #25 and #26' (#27) from issue#26 into master
Reviewed-on: #27
2022-08-09 14:15:37 -04:00
470773721a Stop parsing if the author isn't found 2022-08-09 14:10:44 -04:00
5d7b4cc121 Add a size check before attempting to parse the author
The author file is now checked to insure it's non-zero before attempting
to parse it for the author who's byline will be displayed at the bottom
of the post.
2022-08-09 14:07:40 -04:00
efe61157e8 Merge pull request 'Cleanup header.php' (#22) from issue#10 into master
Reviewed-on: #22
2022-07-31 17:12:49 -04:00
5016fa8ce8 Cleanup header.php
Cleanup debugging code for issue #10
2022-07-31 17:10:41 -04:00
206f94f5db Fix variable being tested for empty file in PR #21 2022-07-27 22:11:36 -04:00
7ff2cf1d0f Resolve issue #9 (#21) 2022-07-27 20:17:34 -04:00
f80bc8dafa File permissions change, check for non-zero tags.csv for issue #9
The tags index.php file now checks for the tags.csv to be non-zero as
well as existing.
Updated the permission of the generated tags.csv file to allow the CMS
to updated it with out requiring root/sudo permissions.
2022-07-27 20:08:55 -04:00
32f7d23ee4 Merge pull request 'Merge upstream master' (#4) from 20xd6/simple_blog:master into master
Reviewed-on: manfromhuh/simple_blog#4
2022-07-27 13:02:23 -04:00
d2861f1203 Merge pull request 'Merge with upstream' (#3) from 20xd6/simple_blog:master into master
Reviewed-on: manfromhuh/simple_blog#3
2022-07-26 10:42:54 -04:00
4 changed files with 31 additions and 40 deletions

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,16 +71,13 @@ 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/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
* [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.
#### JS
#### [JS](/git/20xd6/simple_blog/src/branch/master/common/js)
* font_size.js
* [page_format.js]() - The main JS file used for formatting and adding extra functions to pages.
* gallery.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.
#### PHP

View File

@@ -5,6 +5,10 @@
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){
echo "<br/>\n<br/>";
return;
}
$tags_csv = array_map('str_getcsv', file('tags.csv'));
$tags_rows = sizeof($tags_csv);
$tags_coloums = sizeof($tags_csv[0]);
@@ -49,6 +53,8 @@
$empty_csv = fopen("tags.csv", "w") or die("Cannot write new tags.csv file.");
fwrite($empty_csv, "");
fclose($empty_csv);
chmod('./tags.csv', 0666);
read_tags('tags.csv');
}
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/footer.php');
?>

View File

@@ -22,7 +22,7 @@
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')){
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);
@@ -31,9 +31,6 @@
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);
}

View File

@@ -2,20 +2,11 @@
<html lang="en-US">
<?php
//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);
//~ $new_title = preg_replace("/\//i", "", $new_title);
//~ $page_title = $_SERVER['REQUEST_URI'];
//~ $page_title = preg_replace("/^(.*)\//i", "", $page_title);
function 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'){