コード例 #1
0
ファイル: tree.php プロジェクト: notzen/e107
 /**
  * Load tree data
  * TODO - system cache
  * 
  * @param integer $category_id
  * @param array $options
  * @param boolean $force
  * @return plugin_featurebox_tree
  */
 public function load($category_id, $options = array(), $force = false)
 {
     if (!$force && !$this->isEmpty()) {
         return $this;
     }
     $this->setParam('model_class', 'plugin_featurebox_item')->setParam('model_message_stack', 'featurebox');
     $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;
     $this->setParam('db_query', $qry);
     parent::load($force);
     return $this;
 }
コード例 #2
0
ファイル: user_model.php プロジェクト: JBeezygit/e107
 /**
  * Load tree data
  *
  * @param boolean $force
  */
 public function load($force = false)
 {
     $this->setParam('nocount', true)->setParam('model_class', 'e_user_extended_structure_model')->setParam('db_order', 'user_extended_struct_order ASC');
     parent::load($force);
     return $this;
 }