mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 06:07:32 +02:00
more featurebox flexibility
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (c) e107 Inc 2009 - e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id: e_shortcode.php,v 1.7 2009-12-11 13:12:38 secretr Exp $
|
||||
* $Id: e_shortcode.php,v 1.8 2009-12-11 13:45:12 secretr Exp $
|
||||
*
|
||||
* Featurebox shortcode batch class - shortcodes available site-wide. ie. equivalent to multiple .sc files.
|
||||
*/
|
||||
@@ -155,6 +155,7 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
|
||||
* Available parameters (GET string format)
|
||||
* - loop (boolean): loop using 'nav_loop' template, default 0
|
||||
* - base (string): template key prefix, default is 'nav'. Example: 'mynav' base key will search templates 'mynav_start', 'mynav_loop', 'mynav_end'.
|
||||
* - nolimit (boolean): ignore 'limit' field , us 'total' items number for navigation looping
|
||||
*
|
||||
* @param string $parm parameters
|
||||
* @param string $mod category template
|
||||
@@ -199,7 +200,8 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
|
||||
|
||||
if(isset($parm['loop']) && $tree->getTotal() > 0 && vartrue($tmpl[$base.'item']))
|
||||
{
|
||||
$total = ceil($tree->getTotal() / ($category->sc_featurebox_category_limit() ? intval($category->sc_featurebox_category_limit()) : $tree->getTotal()) );
|
||||
if(isset($parm['nolimit'])) $total = $tree->getTotal();
|
||||
else $total = ceil($tree->getTotal() / ($category->sc_featurebox_category_limit() ? intval($category->sc_featurebox_category_limit()) : $tree->getTotal()) );
|
||||
$model = clone $category;
|
||||
$tmp = array();
|
||||
for ($index = 1; $index <= $total; $index++)
|
||||
@@ -265,8 +267,7 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
|
||||
|
||||
$cols = intval(vartrue($parm['cols'], 1));
|
||||
$limit = intval(varset($parm['limit'], $category->sc_featurebox_category_limit()));
|
||||
$from = (intval(vartrue($parm['from'], 1)) - 1) * $cols;
|
||||
|
||||
$from = (intval(vartrue($parm['from'], 1)) - 1) * $limit;
|
||||
$category->setParam('cols', $cols)
|
||||
->setParam('no_fill_empty', isset($parm['no_fill_empty']) ? 1 : 0)
|
||||
->setParam('limit', $limit)
|
||||
|
Reference in New Issue
Block a user