include sticky and static pages to the categories

This commit is contained in:
Diego Najar 2019-02-28 19:44:46 +01:00
parent bdf585b8db
commit 54868df652
1 changed files with 9 additions and 3 deletions

View File

@ -21,13 +21,19 @@ class Categories extends dbList {
$this->db[$key]['list'] = array(); $this->db[$key]['list'] = array();
} }
// Get a database with published pages // Get pages database
$db = $pages->getPublishedDB(false); $db = $pages->getDB(false);
foreach ($db as $pageKey=>$pageFields) { foreach ($db as $pageKey=>$pageFields) {
if (!empty($pageFields['category'])) { if (!empty($pageFields['category'])) {
$categoryKey = $pageFields['category']; $categoryKey = $pageFields['category'];
if (isset($this->db[$categoryKey]['list'])) { if (isset($this->db[$categoryKey]['list'])) {
array_push($this->db[$categoryKey]['list'], $pageKey); if (
($db[$pageKey]['type']=='published') ||
($db[$pageKey]['type']=='sticky') ||
($db[$pageKey]['type']=='static')
) {
array_push($this->db[$categoryKey]['list'], $pageKey);
}
} }
} }
} }