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