예제 #1
0
파일: group.php 프로젝트: h3len/Project
 public function detail()
 {
     if (isset($this->input['id'])) {
         $group_id = intval($this->input['id']);
     } elseif (isset($this->input['group_id'])) {
         $group_id = intval($this->input['group_id']);
     } else {
         $group_id = -1;
     }
     if ($group_id < 0) {
         $this->errorOutput(PARAM_WRONG);
     }
     $group = $this->group->detail($group_id, true);
     include_once ROOT_PATH . 'lib/class/mark.class.php';
     $mark = new mark();
     $tags = $mark->getInfoByType($group_id, 1);
     $group['tag'] = $tags;
     $this->setXmlNode('group_info', 'group');
     $this->addItem($group);
     $this->output();
 }
예제 #2
0
파일: group.php 프로젝트: h3len/Project
 public function detail()
 {
     $group_id = isset($this->input['group_id']) ? intval($this->input['group_id']) : -1;
     $action_id = isset($this->input['action_id']) ? intval($this->input['action_id']) : 0;
     $flag = !!$this->input['flag'];
     if ($group_id < 0 && $action_id <= 0) {
         $this->errorOutput(PARAM_WRONG);
     }
     if ($action_id > 0) {
         $sql = "SELECT group_id FROM " . DB_PREFIX . "group WHERE action_id = " . $action_id;
         $group = $this->db->query_first($sql);
         $group_id = $group['group_id'];
     }
     $this->setXmlNode('group_info', 'group');
     $group = $this->group->detail($group_id, $flag, $action_id);
     if (!$flag) {
         if (!$group['status']) {
             $this->errorOutput(OBJECT_NULL);
         }
     }
     $offset = isset($this->input['offset']) ? intval($this->input['offset']) : 0;
     $count = isset($this->input['count']) ? intval($this->input['count']) : 20;
     $threads = $this->thread->show($offset, $count, array('group_id' => $group_id, 'state' => 2));
     $material_num = isset($this->input['material_num']) ? intval($this->input['material_num']) : 3;
     $data_limit = 'LIMIT ' . $material_num;
     foreach ($threads as $k => $v) {
         $type = ' AND thread_id = ' . $v['thread_id'];
         $threads[$k]['material'] = $this->group->get_material_info($type, $data_limit);
     }
     $group['threads'] = $threads;
     $members = $this->group->get_member($group_id, false, array('state' => 1));
     $group['members'] = $members;
     $group['members_count'] = $this->group->get_member_num($group_id, array('state' => 1));
     include_once ROOT_PATH . 'lib/class/mark.class.php';
     $mark = new mark();
     $tags = $mark->getInfoByType($group_id, 1);
     $group['tag'] = $tags;
     $this->addItem($group);
     $this->output();
 }