1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 04:10:38 +02:00

Test all e_shortcode.php files in core. PHP8 Fix for featurebox.

This commit is contained in:
Cameron
2021-01-14 10:30:22 -08:00
parent aa3c267ef6
commit e51dfa1fc8
11 changed files with 127 additions and 22 deletions

View File

@@ -288,7 +288,7 @@ class featurebox_shortcodes// must match the plugin's folder name. ie. [PLUGIN_F
* @param string $parm parameters
* @param string $mod category template
*/
function sc_featurebox_items($parm, $mod = '')
function sc_featurebox_items($parm=null, $mod = '')
{
// TODO cache
if(!e107::isInstalled('featurebox')) //just in case
@@ -304,8 +304,11 @@ class featurebox_shortcodes// must match the plugin's folder name. ie. [PLUGIN_F
{
$ctemplate = $mod;
}
parse_str($parm, $parm);
if(!empty($parm))
{
parse_str($parm, $parm);
}
$category = clone $this->getCategoryModel($ctemplate);
if(!$category->hasData())

View File

@@ -21,12 +21,12 @@ class plugin_featurebox_tree extends e_tree_model
* Load tree data
* TODO - system cache
*
* @param integer $category_id
* @param integer $id
* @param array $options
* @param boolean $force
* @return plugin_featurebox_tree
*/
public function load($category_id, $options = array(), $force = false)
public function load($id=null, $force = false, $options=array())
{
if(!$force && !$this->isEmpty())
{
@@ -36,13 +36,13 @@ class plugin_featurebox_tree extends e_tree_model
$this->setParam('model_class', 'plugin_featurebox_item')
->setParam('model_message_stack', 'featurebox');
$this->updateParams($options);
// $this->updateParams($options);
$order = $this->getParam('random') ? ' ORDER BY rand()' : ' ORDER BY fb_order ASC';
$limit = $this->getParam('limit') ? ' LIMIT '.intval($this->getParam('from'), 0).','.intval($this->getParam('limit')) : '';
$ids = $this->getParam('ids') ? preg_replace('/[^0-9,]/', '', $this->getParam('ids')) : '';
$where = $ids ? ' AND fb_id IN('.$ids.')' : '';
$qry = 'SELECT SQL_CALC_FOUND_ROWS * FROM #featurebox WHERE fb_category='.intval($category_id).' AND fb_class IN('.USERCLASS_LIST.')'.$where.$order.$limit;
$qry = 'SELECT SQL_CALC_FOUND_ROWS * FROM #featurebox WHERE fb_category='.intval($id).' AND fb_class IN('.USERCLASS_LIST.')'.$where.$order.$limit;
$this->setParam('db_query', $qry);
parent::loadBatch($force);