From 88b08fd1fcbe9b48840b73ddd7bd4e9816fb0000 Mon Sep 17 00:00:00 2001 From: 20xd6 <20xd6@airmail.cc> Date: Tue, 26 Jul 2022 11:01:36 -0400 Subject: [PATCH 1/8] If not author is identified do nothing --- common/php/article.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/php/article.php b/common/php/article.php index e8622b8..cf7ca4c 100644 --- a/common/php/article.php +++ b/common/php/article.php @@ -36,8 +36,6 @@ echo "

$byline_path

"; } fclose($author_name_raw); - }else { - echo "

No author

"; } if ($tag_data != NULL){ $page_tags = str_getcsv($tag_data); From dc66b2db0f55498d4bdb0b6041771fcb8b0fa63c Mon Sep 17 00:00:00 2001 From: 20xd6 <20xd6@airmail.cc> Date: Tue, 26 Jul 2022 11:20:33 -0400 Subject: [PATCH 2/8] Remove depracated JS files for issue #7 The functions in these files have been merged into the main JS file for page formatting. --- common/js/font_size.js | 1 - common/js/gallery.js | 32 -------------------------------- 2 files changed, 33 deletions(-) delete mode 100644 common/js/font_size.js delete mode 100644 common/js/gallery.js diff --git a/common/js/font_size.js b/common/js/font_size.js deleted file mode 100644 index 8b13789..0000000 --- a/common/js/font_size.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/common/js/gallery.js b/common/js/gallery.js deleted file mode 100644 index 9ff212f..0000000 --- a/common/js/gallery.js +++ /dev/null @@ -1,32 +0,0 @@ -var modalEle = document.querySelector(".modal_gal"); -var modalImage = document.querySelector(".gallery_img"); -Array.from(document.querySelectorAll(".img_thumb")).forEach(item => { - item.addEventListener("click", event => { - modalEle.style.display = "block"; - modalImage.src = event.target.src; - }); -}); -document.querySelector(".close").addEventListener("click", () => { - modalEle.style.display = "none"; -}); - -function image_modal(document){ - // Get the modal - var modal = document.getElementById("modal_gallery"); - // Get the image and insert it inside the modal - use its "alt" text as a caption - var img = document.getElementById("myImg"); - var modalImg = document.getElementById("modal_img"); - var captionText = document.getElementById("modal_img_caption"); - img.onclick = function(){ - modal.style.display = "block"; - modalImg.src = this.src; - captionText.innerHTML = this.alt; - } - // Get the element that closes the modal - var span = document.getElementsByClassName("close_modal")[0]; - - // When the user clicks on (x), close the modal - span.onclick = function() { - modal.style.display = "none"; - } -} From b7688ae2d44c16675cfc60cb2b754ac52518784d Mon Sep 17 00:00:00 2001 From: 20xd6 <20xd6@airmail.cc> Date: Tue, 26 Jul 2022 11:21:52 -0400 Subject: [PATCH 3/8] Removed empty php file --- common/path_menu.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 common/path_menu.php diff --git a/common/path_menu.php b/common/path_menu.php deleted file mode 100644 index e69de29..0000000 From 3e169d54edf822e5ccf8429a14a0bc9d70e74041 Mon Sep 17 00:00:00 2001 From: 20xd6 <20xd6@airmail.cc> Date: Tue, 26 Jul 2022 11:22:18 -0400 Subject: [PATCH 4/8] Remove depracated PHP for issue #7 --- common/php/page_menu_table.php | 36 ---------------------------------- 1 file changed, 36 deletions(-) delete mode 100644 common/php/page_menu_table.php diff --git a/common/php/page_menu_table.php b/common/php/page_menu_table.php deleted file mode 100644 index b636e00..0000000 --- a/common/php/page_menu_table.php +++ /dev/null @@ -1,36 +0,0 @@ - - - - -"; print_r( $files_arr ); echo ""; - // 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=="php" || $file_ext=="html" || $file_ext=="htm" || $file_ext == "") { - $file_array[] = $file; - } - } - foreach($file_array as $file) { - $_replace = array('.php', '.html', '.htm'); - $link_title = str_replace('_',' ',$file); - $link_title = str_replace($_replace,'',$link_title); - $link_title = ucwords($link_title); - echo("\n"); - } -} -else { - echo "Directory does not exists"; -} - -?> -
Home
$link_title
From 81629aa13326f33f2b7d516bdcf531263a56872b Mon Sep 17 00:00:00 2001 From: 20xd6 <20xd6@airmail.cc> Date: Tue, 26 Jul 2022 11:25:03 -0400 Subject: [PATCH 5/8] Remove deperacted CSS for issue #7 The style rules have been moved into the main styles.css --- common/css/gallery.css | 79 ------------------------------------------ 1 file changed, 79 deletions(-) delete mode 100644 common/css/gallery.css diff --git a/common/css/gallery.css b/common/css/gallery.css deleted file mode 100644 index a30d3cf..0000000 --- a/common/css/gallery.css +++ /dev/null @@ -1,79 +0,0 @@ - /* Style the Image Used to Trigger the Modal */ -#myImg { - border-radius: 5px; - cursor: pointer; - transition: 0.3s; -} - -img:hover {opacity: 0.7;} - -/* The Modal (background) */ -.modal_gal { - display: none; /* Hidden by default */ - position: fixed; /* Stay in place */ - z-index: 1; /* Sit on top */ - padding-top: 100px; /* Location of the box */ - left: 0; - top: 0; - width: 100%; /* Full width */ - height: 100%; /* Full height */ - overflow: auto; /* Enable scroll if needed */ - background-color: rgb(0,0,0); /* Fallback color */ - background-color: rgba(0,0,0,0.9); /* Black w/ opacity */ -} - -/* Modal Content (Image) */ -.gallery_img { - margin: auto; - display: block; - width: 80%; - max-width: 700px; -} - -/* Caption of Modal Image (Image Text) - Same Width as the Image */ -#modal_img_caption { - margin: auto; - display: block; - width: 80%; - max-width: 700px; - text-align: center; - color: #ccc; - padding: 10px 0; - height: 150px; -} - -/* Add Animation - Zoom in the Modal */ -.gallery_img, #caption { - animation-name: zoom; - animation-duration: 0.6s; -} - -@keyframes zoom { - from {transform:scale(0)} - to {transform:scale(1)} -} - -/* The Close Button */ -.close_modal { - position: absolute; - top: 15px; - right: 35px; - color: #00cc00; - font-size: 40px; - font-weight: bold; - transition: 0.3s; -} - -.close_modal:hover, -.close_modal:focus { - color: #bbb; - text-decoration: none; - cursor: pointer; -} - -/* 100% Image Width on Smaller Screens */ -@media only screen and (max-width: 700px){ - .gallery_img { - width: 100%; - } -} From dd3405137f675cadfbe75d32f8d82355bfd7b9f3 Mon Sep 17 00:00:00 2001 From: 20xd6 <20xd6@airmail.cc> Date: Tue, 26 Jul 2022 13:06:52 -0400 Subject: [PATCH 6/8] Update tags index to handle issue # 9 Now checks for the file and either copies a backup or creates a blank file. --- blog/by_tag/index.php | 70 ++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 28 deletions(-) mode change 100644 => 100755 blog/by_tag/index.php diff --git a/blog/by_tag/index.php b/blog/by_tag/index.php old mode 100644 new mode 100755 index 8bf0009..5513f89 --- a/blog/by_tag/index.php +++ b/blog/by_tag/index.php @@ -32,37 +32,51 @@ //} //echo "\n"; //} - - # Tags rewrite - $tags_csv = array_map('str_getcsv', file('tags.csv')); - $tags_rows = sizeof($tags_csv); - $tags_coloums = sizeof($tags_csv[0]); - //echo "
\n";
-  //print_r($tags_csv);
-  //echo $tags_coloums . "\n" . $tags_rows . "\n";
-  //echo "
\n"; - echo "\n"; include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/footer.php'); ?> From 4958a76f9a6eb982874074e5e0f53612b83d65bf Mon Sep 17 00:00:00 2001 From: 20xd6 <20xd6@airmail.cc> Date: Tue, 26 Jul 2022 13:29:08 -0400 Subject: [PATCH 7/8] Remove old csv reading code. --- blog/by_tag/index.php | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/blog/by_tag/index.php b/blog/by_tag/index.php index 5513f89..65945cd 100755 --- a/blog/by_tag/index.php +++ b/blog/by_tag/index.php @@ -4,34 +4,6 @@ echo "

Posts by Tag

"; echo "
"; - - //if(file_exists("tags.csv")){ - //echo "\n"; - //} function read_tags($tags_file){ $tags_csv = array_map('str_getcsv', file('tags.csv')); $tags_rows = sizeof($tags_csv); From 015c5ef6db857c836679a16bb850dc0e5fd6d1dd Mon Sep 17 00:00:00 2001 From: 20xd6 <20xd6@airmail.cc> Date: Tue, 26 Jul 2022 13:33:49 -0400 Subject: [PATCH 8/8] Fix for issue #18 The page generation now checks for the size of $file_arr and only generates a menu if the size os greater than 0. --- common/php/page_menu.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/common/php/page_menu.php b/common/php/page_menu.php index 3960ead..dc116d2 100644 --- a/common/php/page_menu.php +++ b/common/php/page_menu.php @@ -18,11 +18,12 @@ function remove_sorting_number($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 "
"; print_r( $files_arr ); echo "
"; - // Get each files of our directory with line break + // 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 "
"; print_r( $files_arr ); echo "
"; + // Get each files of our directory with line break + if (sizeof($files_arr) != 0 ) { foreach ($files_arr as $file) { //Get the file path $file_path = "./".$file; @@ -41,6 +42,7 @@ if (file_exists($dir) && is_dir($dir) ) { $link_title = remove_sorting_number($link_title);//Removes the number used to keep articles in post order from the displayed title. echo("\n");//Output the result. } + } } else { echo "Directory does not exists";