mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 22:57:14 +02:00
featurebox front-end - dynamic (AJAX) loading added, the rest is only theme styling; working examples in jayya and _blank (better one)
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
* Featurebox Category model
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/category.php,v $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2009-12-09 18:36:32 $
|
||||
* $Revision: 1.4 $
|
||||
* $Date: 2009-12-10 22:46:45 $
|
||||
* $Author: secretr $
|
||||
*
|
||||
*/
|
||||
@@ -78,8 +78,44 @@ class plugin_featurebox_category extends e_model
|
||||
|
||||
public function sc_featurebox_category_template()
|
||||
{
|
||||
return $this->get('');
|
||||
return $this->get('fb_category_template');
|
||||
}
|
||||
|
||||
public function sc_featurebox_category_limit()
|
||||
{
|
||||
return $this->get('fb_category_limit');
|
||||
}
|
||||
|
||||
public function sc_featurebox_category_total()
|
||||
{
|
||||
return $this->getParam('total', 0);
|
||||
}
|
||||
|
||||
public function sc_featurebox_category_all()
|
||||
{
|
||||
return $this->getItemTree()->getTotal();
|
||||
}
|
||||
|
||||
public function sc_featurebox_category_cols()
|
||||
{
|
||||
return $this->getParam('cols', 1);
|
||||
}
|
||||
|
||||
public function sc_featurebox_nav_counter()
|
||||
{
|
||||
return $this->getParam('counter', 1);
|
||||
}
|
||||
|
||||
public function sc_featurebox_nav_active()
|
||||
{
|
||||
return $this->getParam('active') ? ' active' : '';
|
||||
}
|
||||
|
||||
public function sc_featurebox_category_emptyfill()
|
||||
{
|
||||
return $this->getParam('no_fill_empty', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load category data by layout
|
||||
* TODO - system cache
|
||||
@@ -116,6 +152,7 @@ class plugin_featurebox_category extends e_model
|
||||
$this->_tree = new plugin_featurebox_tree();
|
||||
$options = array(
|
||||
'limit' => $this->getParam('limit', $this->get('fb_category_limit')),
|
||||
'from' => $this->getParam('from', 0),
|
||||
'random' => $this->getParam('random', $this->get('fb_category_random'))
|
||||
);
|
||||
$this->_tree->load($this->getId(), $options, $force);
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* Featurebox Item model
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/item.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-12-08 17:21:32 $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2009-12-10 22:46:45 $
|
||||
* $Author: secretr $
|
||||
*
|
||||
*/
|
||||
@@ -103,6 +103,32 @@ class plugin_featurebox_item extends e_model
|
||||
return $this->getParam('counter', 1);
|
||||
}
|
||||
|
||||
public function sc_featurebox_limit()
|
||||
{
|
||||
return $this->getParam('limit', 0);
|
||||
}
|
||||
|
||||
public function sc_featurebox_total()
|
||||
{
|
||||
return $this->getParam('total', 0);
|
||||
}
|
||||
|
||||
public function sc_featurebox_all()
|
||||
{
|
||||
return $this->getCategory()->sc_featurebox_category_all();
|
||||
}
|
||||
|
||||
public function sc_featurebox_cols()
|
||||
{
|
||||
return $this->getParam('cols', 1);
|
||||
}
|
||||
|
||||
|
||||
public function sc_featurebox_colcount()
|
||||
{
|
||||
return $this->getParam('col_counter', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set current category
|
||||
* @param plugin_featurebox_category $category
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* Featurebox Category Tree model
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/tree.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-12-08 17:21:32 $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2009-12-10 22:46:45 $
|
||||
* $Author: secretr $
|
||||
*
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ class plugin_featurebox_tree extends e_tree_model
|
||||
$this->updateParams($options);
|
||||
|
||||
$order = $this->getParam('random') ? ' ORDER BY rand()' : ' ORDER BY fb_order ASC';
|
||||
$limit = $this->getParam('limit') ? ' LIMIT 0,'.intval($this->getParam('limit')) : '';
|
||||
$limit = $this->getParam('limit') ? ' LIMIT '.intval($this->getParam('from'), 0).','.intval($this->getParam('limit')) : '';
|
||||
$qry = 'SELECT SQL_CALC_FOUND_ROWS * FROM #featurebox WHERE fb_category='.intval($category_id).' AND fb_class IN('.USERCLASS_LIST.')'.$order.$limit;
|
||||
$this->setParam('db_query', $qry);
|
||||
|
||||
|
Reference in New Issue
Block a user