소스 검색

include sticky and static pages to the categories

Diego Najar 6 년 전
부모
커밋
54868df652
1개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 9 3
      bl-kernel/categories.class.php

+ 9 - 3
bl-kernel/categories.class.php

@@ -21,13 +21,19 @@ 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'])) {
-					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);
+					}
 				}
 			}
 		}