Compare commits

...

3 Commits

Author SHA1 Message Date
8da50f2841 Merge pull request 'Merge upstream master' (#5) from 20xd6/simple_blog:master into master
Reviewed-on: #5
2022-07-27 20:19:37 -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

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_vile) == 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');
?>