Changes and bug fixes
This commit is contained in:
parent
e81a67d49c
commit
65b95fb93f
@ -93,7 +93,7 @@ class dbJSON
|
|||||||
// Returns a JSON encoded string on success or FALSE on failure.
|
// Returns a JSON encoded string on success or FALSE on failure.
|
||||||
private function serialize($data)
|
private function serialize($data)
|
||||||
{
|
{
|
||||||
return json_encode($data, JSON_PRETTY_PRINT);
|
return json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the value encoded in json in appropriate PHP type.
|
// Returns the value encoded in json in appropriate PHP type.
|
||||||
|
@ -92,7 +92,8 @@ function displayFiles(files) {
|
|||||||
// Regenerate the table
|
// Regenerate the table
|
||||||
$.each(files, function(key, filename) {
|
$.each(files, function(key, filename) {
|
||||||
tableRow = '<tr id="js'+filename+'">'+
|
tableRow = '<tr id="js'+filename+'">'+
|
||||||
'<td style="width:80px"><img class="img-thumbnail" alt="200x200" src="<?php echo HTML_PATH_UPLOADS_THUMBNAILS ?>'+filename+'" style="width: 50px; height: 50px;"></td>'+
|
//do not need php here. we already have these variables declared in javascript above
|
||||||
|
'<td style="width:80px"><img class="img-thumbnail" alt="200x200" src="'+ HTML_PATH_UPLOADS_THUMBNAILS + filename+'" style="width: 50px; height: 50px;"></td>'+
|
||||||
'<td class="information">'+
|
'<td class="information">'+
|
||||||
'<div class="pb-2">'+filename+'</div>'+
|
'<div class="pb-2">'+filename+'</div>'+
|
||||||
'<div>'+
|
'<div>'+
|
||||||
@ -108,10 +109,11 @@ function displayFiles(files) {
|
|||||||
|
|
||||||
// Get the list of files via AJAX, filter by the page number
|
// Get the list of files via AJAX, filter by the page number
|
||||||
function getFiles(pageNumber) {
|
function getFiles(pageNumber) {
|
||||||
$.post("<?php echo HTML_PATH_ADMIN_ROOT ?>ajax/list-files",
|
$.post(HTML_PATH_ADMIN_ROOT+"ajax/list-files",
|
||||||
{ tokenCSRF: tokenCSRF,
|
{ tokenCSRF: tokenCSRF,
|
||||||
pageNumber: pageNumber,
|
pageNumber: pageNumber,
|
||||||
path: "<?php echo PATH_UPLOADS_THUMBNAILS ?>"
|
//ajax/list-files is changed
|
||||||
|
path: HTML_PATH_UPLOADS_THUMBNAILS
|
||||||
},
|
},
|
||||||
function(data) {
|
function(data) {
|
||||||
displayFiles(data.files);
|
displayFiles(data.files);
|
||||||
@ -120,7 +122,7 @@ function getFiles(pageNumber) {
|
|||||||
|
|
||||||
// Delete the file and the thumbnail if exist
|
// Delete the file and the thumbnail if exist
|
||||||
function deleteMedia(filename) {
|
function deleteMedia(filename) {
|
||||||
$.post("<?php echo HTML_PATH_ADMIN_ROOT ?>ajax/delete-file",
|
$.post(HTML_PATH_ADMIN_ROOT + "ajax/delete-file",
|
||||||
{ tokenCSRF: tokenCSRF,
|
{ tokenCSRF: tokenCSRF,
|
||||||
filename: filename
|
filename: filename
|
||||||
},
|
},
|
||||||
@ -145,7 +147,7 @@ $(document).ready(function() {
|
|||||||
// Check file type/extension ?
|
// Check file type/extension ?
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "<?php echo HTML_PATH_ADMIN_ROOT ?>ajax/upload-files",
|
url: HTML_PATH_ADMIN_ROOT+"ajax/upload-files",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: new FormData($("#jsbluditFormUpload")[0]),
|
data: new FormData($("#jsbluditFormUpload")[0]),
|
||||||
cache: false,
|
cache: false,
|
||||||
|
@ -17,7 +17,8 @@ if ($path==false) {
|
|||||||
'files'=>'Invalid path.'
|
'files'=>'Invalid path.'
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
//absolute path
|
||||||
|
$path = PATH_ROOT.$path;
|
||||||
// Get all files from the directory $path, also split the array by numberOfItems
|
// Get all files from the directory $path, also split the array by numberOfItems
|
||||||
$listOfFilesByPage = Filesystem::listFiles($path, '*', '*', $GLOBALS['BLUDIT_MEDIA_MANAGER_SORT_BY_DATE'], $GLOBALS['BLUDIT_MEDIA_MANAGER_AMOUNT_OF_FILES']);
|
$listOfFilesByPage = Filesystem::listFiles($path, '*', '*', $GLOBALS['BLUDIT_MEDIA_MANAGER_SORT_BY_DATE'], $GLOBALS['BLUDIT_MEDIA_MANAGER_AMOUNT_OF_FILES']);
|
||||||
|
|
||||||
|
@ -110,7 +110,9 @@ class dbSite extends dbJSON
|
|||||||
|
|
||||||
public function extremeFriendly()
|
public function extremeFriendly()
|
||||||
{
|
{
|
||||||
return $this->getField('extremeFriendly');
|
//always true. value is string not bool. here i convert it to boolean
|
||||||
|
//return $this->getField('extremeFriendly');
|
||||||
|
return filter_var($this->getField('extremeFriendly'), FILTER_VALIDATE_BOOLEAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function twitter()
|
public function twitter()
|
||||||
|
@ -150,7 +150,8 @@ class Text {
|
|||||||
$string = trim($string, '-');
|
$string = trim($string, '-');
|
||||||
$string = self::lowercase($string);
|
$string = self::lowercase($string);
|
||||||
$string = preg_replace("/[\/_|+ -]+/", $separator, $string);
|
$string = preg_replace("/[\/_|+ -]+/", $separator, $string);
|
||||||
|
//trim separator
|
||||||
|
$string = trim($string, $separator);
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
if (!file_exists('bl-content/databases/site.php')) {
|
if (!file_exists('bl-content/databases/site.php')) {
|
||||||
$base = dirname($_SERVER['SCRIPT_NAME']);
|
$base = dirname($_SERVER['SCRIPT_NAME']);
|
||||||
$base = rtrim($base, '/');
|
$base = rtrim($base, '/');
|
||||||
|
//fix for windows
|
||||||
|
$base = rtrim($base, '\\');
|
||||||
header('Location:'.$base.'/install.php');
|
header('Location:'.$base.'/install.php');
|
||||||
exit('<a href="./install.php">Install Bludit first.</a>');
|
exit('<a href="./install.php">Install Bludit first.</a>');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user