1 | <?php |
---|
2 | /** |
---|
3 | * @copyright 2005-2008 OpenPNE Project |
---|
4 | * @license http://www.php.net/license/3_01.txt PHP License 3.01 |
---|
5 | */ |
---|
6 | |
---|
7 | class pc_page_c_event_detail extends OpenPNE_Action |
---|
8 | { |
---|
9 | function execute($requests) |
---|
10 | { |
---|
11 | $u = $GLOBALS['AUTH']->uid(); |
---|
12 | |
---|
13 | // --- リクエスト変数 |
---|
14 | $c_commu_topic_id = $requests['target_c_commu_topic_id']; |
---|
15 | $page = $requests['page']; |
---|
16 | $err_msg = $requests['err_msg']; |
---|
17 | $body = $requests['body']; |
---|
18 | // ---------- |
---|
19 | |
---|
20 | $c_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id); |
---|
21 | $c_commu_id = $c_topic['c_commu_id']; |
---|
22 | |
---|
23 | //--- 権限チェック |
---|
24 | if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) { |
---|
25 | handle_kengen_error(); |
---|
26 | } |
---|
27 | //--- |
---|
28 | |
---|
29 | $c_commu = db_commu_c_commu4c_commu_id($c_commu_id); |
---|
30 | if (!$c_commu) { |
---|
31 | openpne_redirect('pc', 'page_h_err_c_home'); |
---|
32 | } |
---|
33 | if (!$c_topic['event_flag']) { |
---|
34 | $p = array('target_c_commu_topic_id' => $c_topic['c_commu_topic_id']); |
---|
35 | openpne_redirect('pc', 'page_c_topic_detail', $p); |
---|
36 | } |
---|
37 | |
---|
38 | $this->set('inc_navi', fetch_inc_navi('c', $c_commu_id)); |
---|
39 | |
---|
40 | //詳細部分 |
---|
41 | $this->set('c_commu', $c_commu); |
---|
42 | $c_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id); |
---|
43 | $this->set('c_topic', $c_topic); |
---|
44 | |
---|
45 | //書き込み一覧部分 |
---|
46 | if ($requests['page_size'] == 100) { |
---|
47 | $page_size = 100; |
---|
48 | } else { |
---|
49 | $page_size = 20; |
---|
50 | } |
---|
51 | if ($requests['order'] === 'asc') { |
---|
52 | $desc = false; |
---|
53 | } else { |
---|
54 | $desc = true; |
---|
55 | } |
---|
56 | |
---|
57 | list($c_topic_write, $pager) = db_commu_c_topic_write4c_commu_topic_id($c_commu_topic_id, $page, $page_size, $desc); |
---|
58 | |
---|
59 | $this->set('c_topic_write', $c_topic_write); |
---|
60 | $this->set('pager', $pager); |
---|
61 | |
---|
62 | $this->set('is_c_commu_admin', db_commu_is_c_commu_admin($c_commu_id, $u)); |
---|
63 | $this->set('is_c_commu_member', db_commu_is_c_commu_member($c_commu_id, $u)); |
---|
64 | $this->set('is_c_event_member', db_commu_is_c_event_member($c_commu_topic_id, $u)); |
---|
65 | $this->set('is_c_event_admin', db_commu_is_c_event_admin($c_commu_topic_id, $u)); |
---|
66 | $this->set('is_event_join_date', db_commu_is_event_join_date($c_commu_topic_id)); |
---|
67 | $this->set('is_event_join_capacity', db_commu_is_event_join_capacity($c_commu_topic_id)); |
---|
68 | $this->set('is_writable_comment', db_commu_is_writable_c_commu_topic_comment4c_commu_topic_id($c_commu_topic_id)); |
---|
69 | |
---|
70 | $this->set('err_msg', $err_msg); |
---|
71 | $this->set('body', $body); |
---|
72 | |
---|
73 | $this->set('c_member_id', $u); |
---|
74 | |
---|
75 | return 'success'; |
---|
76 | } |
---|
77 | } |
---|
78 | ?> |
---|