diff --git a/blog/by_tag/index.php b/blog/by_tag/index.php
old mode 100644
new mode 100755
index 8bf0009..65945cd
--- a/blog/by_tag/index.php
+++ b/blog/by_tag/index.php
@@ -4,65 +4,51 @@
echo "Posts by Tag
\n"; - //print_r($tags_csv); - //echo $tags_coloums . "\n" . $tags_rows . "\n"; - //echo "\n"; - echo " \n"; + } + + + # Tags rewrite + if (file_exists('tags.csv')){ + read_tags('tags.csv'); + } elseif( file_exists('tags.csv.bak') ){ + if (copy('tags.csv.bak', './tags.csv')) { + read_tags('tags.csv'); + } + }else { + $empty_csv = fopen("tags.csv", "w") or die("Cannot write new tags.csv file."); + fwrite($empty_csv, ""); + fclose($empty_csv); } - echo "\n"; include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/footer.php'); ?> 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%; - } -} 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"; - } -} diff --git a/common/path_menu.php b/common/path_menu.php deleted file mode 100644 index e69de29..0000000 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 ""; 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"; 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 @@ -
Home | -
$link_title |