From 818fdb453affd96a3103e5a357961f763c243162 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Wed, 31 May 2017 20:17:21 +0200 Subject: [PATCH] Bug fixes, filter by category and tags --- bl-kernel/abstract/dblist.class.php | 2 +- bl-kernel/dbsite.class.php | 2 +- bl-kernel/functions.php | 1 + bl-kernel/page.class.php | 1 + bl-plugins/categories/plugin.php | 3 --- bl-plugins/menu/plugin.php | 4 ++-- bl-plugins/pages/plugin.php | 26 ++++++++++++++++---------- install.php | 2 +- 8 files changed, 23 insertions(+), 18 deletions(-) diff --git a/bl-kernel/abstract/dblist.class.php b/bl-kernel/abstract/dblist.class.php index 2de37d23..3dab0084 100644 --- a/bl-kernel/abstract/dblist.class.php +++ b/bl-kernel/abstract/dblist.class.php @@ -24,7 +24,7 @@ class dbList extends dbJSON parent::__construct($file); } - private function getList($key, $amountOfItems, $pageNumber) + public function getList($key, $pageNumber, $amountOfItems) { if( !isset($this->db[$key]) ) { Log::set(__METHOD__.LOG_SEP.'Error key does not exist '.$key); diff --git a/bl-kernel/dbsite.class.php b/bl-kernel/dbsite.class.php index b190fdea..b130fb08 100644 --- a/bl-kernel/dbsite.class.php +++ b/bl-kernel/dbsite.class.php @@ -7,7 +7,7 @@ class dbSite extends dbJSON 'slogan'=> array('inFile'=>false, 'value'=>''), 'description'=> array('inFile'=>false, 'value'=>''), 'footer'=> array('inFile'=>false, 'value'=>'I wanna be a pirate!'), - 'itemsPerPage'=> array('inFile'=>false, 'value'=>''), + 'itemsPerPage'=> array('inFile'=>false, 'value'=>6), 'language'=> array('inFile'=>false, 'value'=>'en'), 'locale'=> array('inFile'=>false, 'value'=>'en_US'), 'timezone'=> array('inFile'=>false, 'value'=>'America/Argentina/Buenos_Aires'), diff --git a/bl-kernel/functions.php b/bl-kernel/functions.php index 7a3cef64..b5d062e2 100644 --- a/bl-kernel/functions.php +++ b/bl-kernel/functions.php @@ -115,6 +115,7 @@ function buildPagesFor($for, $categoryKey=false, $tagKey=false) { global $dbPages; global $dbCategories; + global $dbTags; global $Site; global $Url; global $pagesByKey; diff --git a/bl-kernel/page.class.php b/bl-kernel/page.class.php index be8d8211..2120cee6 100644 --- a/bl-kernel/page.class.php +++ b/bl-kernel/page.class.php @@ -153,6 +153,7 @@ class Page { { global $Url; + $key = $this->getField('key'); if($absolute) { return DOMAIN_PAGE.$key; } diff --git a/bl-plugins/categories/plugin.php b/bl-plugins/categories/plugin.php index 87972736..9711dffe 100644 --- a/bl-plugins/categories/plugin.php +++ b/bl-plugins/categories/plugin.php @@ -30,9 +30,6 @@ class pluginCategories extends Plugin { global $dbCategories; global $Url; - // URL base filter for categories - $filter = $Url->filters('category'); - // HTML for sidebar $html = '
'; $html .= '

'.$this->getValue('label').'

'; diff --git a/bl-plugins/menu/plugin.php b/bl-plugins/menu/plugin.php index 37037439..c856551c 100644 --- a/bl-plugins/menu/plugin.php +++ b/bl-plugins/menu/plugin.php @@ -29,7 +29,6 @@ class pluginMenu extends Plugin { global $Language; global $dbCategories; global $Url; - global $pagesByKey; // HTML for sidebar $html = '
'; @@ -45,7 +44,8 @@ class pluginMenu extends Plugin { $html .= ''.$fields['name'].''; $html .= '