comments, bug fixes for buildpages by tags
This commit is contained in:
parent
c16741808f
commit
e548d75e3e
|
@ -30,11 +30,9 @@ class dbJSON {
|
|||
|
||||
// Unserialize, JSON to Array
|
||||
$array = $this->unserialize($implode);
|
||||
|
||||
if (empty($array)) {
|
||||
$this->db = array();
|
||||
$this->dbBackup = array();
|
||||
Log::set(__METHOD__.LOG_SEP.'Error trying to read the JSON file: '.$file, LOG_TYPE_ERROR);
|
||||
} else {
|
||||
$this->db = $array;
|
||||
$this->dbBackup = $array;
|
||||
|
@ -100,7 +98,8 @@ class dbJSON {
|
|||
{
|
||||
// NULL is returned if the json cannot be decoded
|
||||
$decode = json_decode($data, true);
|
||||
if (empty($decode)) {
|
||||
if ($decode===NULL) {
|
||||
Log::set(__METHOD__.LOG_SEP.'Error trying to read the JSON file: '.$this->file, LOG_TYPE_ERROR);
|
||||
return false;
|
||||
}
|
||||
return $decode;
|
||||
|
|
|
@ -126,7 +126,7 @@ class dbList extends dbJSON
|
|||
}
|
||||
|
||||
// Sort the categories by "Natural order"
|
||||
private function sortAlphanumeric()
|
||||
public function sortAlphanumeric()
|
||||
{
|
||||
// Sort key alphanumeric strings, a01, a10, b10, c02
|
||||
return ksort($this->db);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit e0b144877b87f41d08a634f812726da5c887918c
|
||||
Subproject commit f616042ccc0eaa37dab6a0c3ad67bb022574952b
|
|
@ -9,7 +9,7 @@ define('BLUDIT_BUILD', '20190228');
|
|||
// Debug mode
|
||||
// Change to FALSE, for prevent warning or errors on browser
|
||||
define('DEBUG_MODE', TRUE);
|
||||
define('DEBUG_TYPE', 'INFO'); // INFO, TRACE
|
||||
define('DEBUG_TYPE', 'TRACE'); // INFO, TRACE
|
||||
error_reporting(0); // Turn off all error reporting
|
||||
if (DEBUG_MODE) {
|
||||
// Turn on all error reporting
|
||||
|
|
|
@ -118,7 +118,12 @@ function buildPagesFor($for, $categoryKey=false, $tagKey=false) {
|
|||
foreach ($list as $pageKey) {
|
||||
try {
|
||||
$page = new Page($pageKey);
|
||||
array_push($content, $page);
|
||||
if ( ($page->type()=='published') ||
|
||||
($page->type()=='sticky') ||
|
||||
($page->type()=='static')
|
||||
) {
|
||||
array_push($content, $page);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// continue
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ class Pages extends dbJSON {
|
|||
'description'=>'',
|
||||
'username'=>'',
|
||||
'tags'=>array(),
|
||||
'type'=>'published', // published, draft, sticky, scheduled
|
||||
'type'=>'published', // published, static, draft, sticky, scheduled
|
||||
'date'=>'',
|
||||
'dateModified'=>'',
|
||||
'position'=>0,
|
||||
|
|
|
@ -31,9 +31,8 @@ class Tags extends dbList {
|
|||
}
|
||||
}
|
||||
|
||||
// Sort database by alphabet
|
||||
ksort($tagsIndex);
|
||||
$this->db = $tagsIndex;
|
||||
$this->sortAlphanumeric();
|
||||
return $this->save();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue