diff --git a/system/admin/views/add-content.html.php b/system/admin/views/add-content.html.php index 7b5065b..c9a5ec1 100644 --- a/system/admin/views/add-content.html.php +++ b/system/admin/views/add-content.html.php @@ -125,23 +125,24 @@ $( function() { - +
- +
- +
+ @@ -214,8 +215,38 @@ $( function() { + + + + diff --git a/system/admin/views/edit-content.html.php b/system/admin/views/edit-content.html.php index 4b2bab9..ae12c32 100644 --- a/system/admin/views/edit-content.html.php +++ b/system/admin/views/edit-content.html.php @@ -179,23 +179,24 @@ $( function() { - +
- +
- +
+ @@ -273,7 +274,37 @@ $( function() { + + + + diff --git a/system/includes/functions.php b/system/includes/functions.php index bd08213..0dd92f4 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -1628,7 +1628,8 @@ function has_prev($prev) 'quote' => $prev->quote, 'link' => $prev->link, 'categoryUrl' => $prev->categoryUrl, - 'readTime' => $prev->readTime + 'readTime' => $prev->readTime, + 'readTime' => $prev->lastMod ); } } @@ -1660,7 +1661,8 @@ function has_next($next) 'quote' => $next->quote, 'link' => $next->link, 'categoryUrl' => $next->categoryUrl, - 'readTime' => $next->readTime + 'readTime' => $next->readTime, + 'readTime' => $next->lastMod ); } } diff --git a/system/includes/session.php b/system/includes/session.php index 5bba1f4..308855b 100644 --- a/system/includes/session.php +++ b/system/includes/session.php @@ -6,8 +6,7 @@ if(PHP_VERSION_ID < 70300) { session_set_cookie_params(['samesite' => $samesite]); } -if (isset($_COOKIE['PHPSESSID'])) - session_start(); +session_start(); function login() { diff --git a/system/resources/js/media.uploader.js b/system/resources/js/media.uploader.js new file mode 100644 index 0000000..c21d39c --- /dev/null +++ b/system/resources/js/media.uploader.js @@ -0,0 +1,62 @@ +(function () { + + //======Media Uploader===== + + var dialogClose = function() { + $('#insertMediaDialog').modal('hide'); + $('#insertMediaDialogURL').val(''); + $('#insertMediaDialogFile').val(''); + }; + $('#insertMediaDialogInsert').click( function() { + $('.media-uploader').val(''); + $('.media-uploader').val( $('#insertMediaDialogURL').val().length > 0 ? $('#insertMediaDialogURL').val() : null ); + dialogClose(); + }); + $('#insertMediaDialogClose').click( function() { + dialogClose(); + }); + $('#insertMediaDialogCancel').click( function() { + dialogClose(); + }); + $('#insertMediaDialogFile').on('input', function(){ + var file = $("#insertMediaDialogFile").prop("files"); + var formData = new FormData(); + formData.append('file', file[0], file[0].name); + // Set up the request. + $.ajax({ + type: "POST", + url: base_path + 'upload.php', + data: formData, + processData: false, + contentType: false, + success: function (response) { + if (response.error == '0') + { + $('.media-uploader').val(''); + $('.media-uploader').val(base_path + response.path); + dialogClose(); + } + else + { + if (response.error !== '') alert(response.error); + else alert("An unknown error has occurred"); + console.error("Bad Response"); + console.error(response); + $('#insertMediaDialogFile').val(''); + } + }, + failure: function (response) { + if (response.error !== '') alert(response.error); + else alert("An unknown error has occurred"); + console.error("Unable to Upload"); + console.error(response); + $('#insertMediaDialogFile').val(''); + } + });//ajax + });//oninput + + $('#insertButton').click(function() { + $('#insertMediaDialog').modal('show'); + }); + +})(); \ No newline at end of file