Exemplo n.º 1
0
 public function getBoard()
 {
     $this->category = PaForumCategory::getPaForumCategory($this->category_id);
     $this->board = $this->category->getBoard();
     return $this->board;
 }
 private function setCategory($category_id, $request_data, $render = true)
 {
     $forums = array();
     $category = PaForumCategory::getPaForumCategory($category_id);
     if ($category) {
         $this->category = $category;
         $category->statistics = $category->getCategoryStatistics();
         if (!empty($category->statistics['forums'])) {
             $forums = $category->statistics['forums'];
         }
         $board = $category->getBoard();
         $this->setupBoard($board);
         $this->user_status = $this->checkUser($request_data);
     }
     if ($render && $this->category) {
         $this->set_inner_template('cnmodule_content_forum_category.php');
         $this->inner_HTML = $this->generate_inner_html(array('page_id' => $this->page_id, 'forums' => $forums, 'category' => $category, 'forums_url' => $this->forums_url, 'theme_url' => $this->theme_url, 'user_status' => $this->user_status, 'message' => $this->message, 'description' => $this->category->get_description(), 'board' => $this->board, 'board_settings' => $this->board_settings));
     }
 }
 public function getCategories($pagesize = null, $page = null)
 {
     $categories = array();
     $conditionalStatement = "board_id = {$this->id} AND is_active = 1";
     $orderby = "created_at";
     $sort = "DESC";
     $categories = PaForumCategory::listPaForumCategory($conditionalStatement, $orderby, $sort);
     return $categories;
 }
 /**
  * Retrieved list of objects base on a given parameters - dynamic method: list_PaForumCategory()
  *
  *
  * Generated with the DalClassGenerator created by: 
  * Zoran Hron <*****@*****.**> 
  *
  * @param conditionalStatement = null
  * @param orderby = null
  * @param sort = null
  * @param limit = 0
  * @param fetchmode = DB_FETCHMODE_OBJECT
  * @result array of objects: PaForumCategory
  **/
 public function list_PaForumCategory($conditionalStatement = null, $orderby = null, $sort = null, $limit = 0, $fetchmode = DB_FETCHMODE_OBJECT)
 {
     $this->initialize($conditionalStatement, $orderby, $sort);
     // build MySQL query
     $sql = "SELECT * FROM { pa_forum_category } ";
     if ($conditionalStatement) {
         $sql .= "WHERE {$conditionalStatement}";
     }
     if ($orderby) {
         $sql .= " ORDER BY {$orderby}";
     }
     if ($sort) {
         $sql .= " {$sort}";
     }
     if ($limit) {
         $sql .= " LIMIT {$limit}";
     }
     $sql .= ";";
     // execute query
     $res = Dal::query($sql);
     $objects = array();
     // data found?
     if ($res->numRows() > 0) {
         // retrieve data objects
         while ($row = $res->fetchRow($fetchmode)) {
             if ($fetchmode == DB_FETCHMODE_OBJECT) {
                 $obj = new PaForumCategory();
                 $obj->populateFromObject($row);
                 $objects[] = $obj;
             } else {
                 $objects[] = $row;
             }
         }
     }
     return $objects;
 }