function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     $c_member_ids = $requests['c_member_id'];
     $body = $requests['body'];
     // ----------
     if (!$c_member_ids) {
         $p = array('target_c_commu_topic_id' => $c_commu_topic_id);
         openpne_redirect('pc', 'page_c_event_mail', $p);
     }
     $c_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if (!db_commu_is_c_event_admin($c_commu_topic_id, $u) && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if (in_array($u, $c_member_ids)) {
         handle_kengen_error();
     }
     //---
     $this->set('c_commu', db_commu_c_commu4c_commu_id($c_commu_id));
     $this->set('inc_navi', fetch_inc_navi('c', $c_commu_id));
     $this->set('c_mail_member', db_commu_c_event_mail_confirm_list4c_member_ids($c_member_ids));
     $this->set('body', $body);
     $this->set('c_member_ids', implode(',', $c_member_ids));
     $this->set("c_commu_id", $c_commu_id);
     $this->set("c_commu_topic_id", $c_commu_topic_id);
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if (!db_commu_is_c_topic_admin($c_commu_topic_id, $u) && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     $c_commu = db_commu_c_commu4c_commu_id2($c_commu_id);
     if ($c_commu['is_topic'] == 'admin_only' && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if ($c_commu['is_topic'] == 'member' && !db_commu_is_c_commu_member($c_commu_id, $u)) {
         handle_kengen_error();
     }
     //---
     $this->set('inc_navi', fetch_inc_navi('c', $c_commu_id));
     $this->set('c_commu_id', $c_commu_id);
     $this->set('c_commu_topic_id', $c_commu_topic_id);
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $c_commu_topic_comment_id = $requests['target_c_commu_topic_comment_id'];
     // ----------
     $c_commu_topic_comment = db_commu_c_commu_topic_comment4c_commu_topic_comment_id_3($c_commu_topic_comment_id);
     $c_commu_id = $c_commu_topic_comment['c_commu_id'];
     $c_commu_topic_id = $c_commu_topic_comment['c_commu_topic_id'];
     $c_commu = db_commu_c_commu4c_commu_id($c_commu_id);
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     $status = db_common_commu_status($u, $c_commu_id);
     if (!$status['is_commu_admin'] && $c_commu_topic_comment['c_member_id'] != $u) {
         handle_kengen_error();
     }
     //---
     $this->set('inc_navi', fetch_inc_navi("c", $c_commu_id));
     $this->set('c_commu_id', $c_commu_id);
     $this->set('c_commu_topic_id', $c_commu_topic_id);
     $this->set('c_commu_topic_comment', $c_commu_topic_comment);
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     $tail = $GLOBALS['KTAI_URL_TAIL'];
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     $c_member_id = $requests['c_member_id'];
     $body = $requests['body'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     // イベント閲覧権限がないと送信できない
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     // 自分が送信対象
     if ($u == $c_member_id) {
         handle_kengen_error();
     }
     //---
     list($msg_subject, $msg_body) = create_message_event_invite($u, $body, $c_commu_topic_id);
     db_message_send_message_event_invite($u, $c_member_id, $msg_subject, $msg_body);
     $p = array('target_c_commu_topic_id' => $c_commu_topic_id);
     openpne_redirect('ktai', 'page_c_bbs', $p);
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     $c_member_ids = $requests['c_member_id'];
     $body = $requests['body'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     if (!$c_member_ids) {
         $p = array('target_c_commu_topic_id' => $c_commu_topic_id, 'msg' => "紹介先の" . WORD_MY_FRIEND . "を選択してださい");
         openpne_redirect('pc', 'page_c_event_invite', $p);
     }
     //--- 権限チェック
     // イベント閲覧権限がないと送信できない
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     // 自分が送信対象に含まれている
     if (in_array($u, $c_member_ids)) {
         handle_kengen_error();
     }
     //---
     list($msg_subject, $msg_body) = create_message_event_invite($u, $body, $c_commu_topic_id);
     foreach ($c_member_ids as $key => $value) {
         db_message_send_message_event_invite($u, $value, $msg_subject, $msg_body);
     }
     $p = array('target_c_commu_topic_id' => $c_commu_topic_id);
     openpne_redirect('pc', 'page_c_event_invite_end', $p);
 }
 function execute($requests)
 {
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     $tail = $GLOBALS['KTAI_URL_TAIL'];
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if (!db_commu_is_c_topic_admin($c_commu_topic_id, $u) && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     //---
     if (MAIL_ADDRESS_HASHED) {
         $mail_address = 'ti' . $c_commu_topic_id . '-' . t_get_user_hash($u) . "@" . MAIL_SERVER_DOMAIN;
     } else {
         $mail_address = 'ti' . $c_commu_topic_id . "@" . MAIL_SERVER_DOMAIN;
     }
     $mail_address = MAIL_ADDRESS_PREFIX . $mail_address;
     $this->set('mail_address', $mail_address);
     $this->set('c_topic', $c_topic);
     $this->set("c_commu", db_commu_c_commu4c_commu_id2($c_commu_id));
     return 'success';
 }
Exemple #7
0
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     $c_commu_id = $requests['target_c_commu_id'];
     $c_commu = db_commu_c_commu4c_commu_id2($c_commu_id);
     //コミュニティの存在の有無
     if (!$c_commu) {
         openpne_redirect('pc', 'page_h_err_c_home');
     }
     $inc_navi = fetch_inc_navi('c', $c_commu_id);
     $this->set('inc_navi', $inc_navi);
     $this->set('c_commu', $c_commu);
     // 副管理者情報
     if ($c_commu['c_member_id_sub_admin']) {
         $c_member_sub_admin = db_member_c_member4c_member_id($c_commu['c_member_id_sub_admin']);
         $this->set('sub_admin', $c_member_sub_admin);
     }
     $this->set('is_c_commu_admin', db_commu_is_c_commu_admin($c_commu_id, $u));
     $this->set('is_c_commu_member', db_commu_is_c_commu_member($c_commu_id, $u));
     $this->set('is_c_commu_view', db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u));
     $this->set('is_receive_mail', db_commu_is_receive_mail_ktai($c_commu_id, $u));
     $this->set('is_receive_mail_pc', db_commu_is_receive_mail_pc($c_commu_id, $u));
     $this->set('is_receive_message', db_commu_is_receive_message($c_commu_id, $u));
     //コミュニティメンバー
     $c_commu_member_list = db_commu_c_commu_member_list4c_commu_id($c_commu_id, 9);
     $this->set('c_commu_member_list', $c_commu_member_list);
     $c_member_secure = db_member_c_member_secure4c_member_id($u);
     if (empty($c_member_secure['ktai_address'])) {
         $is_registered_ktai_address = false;
     } else {
         $is_registered_ktai_address = true;
     }
     //非公開コミュニティに管理者から招待されたかどうか
     $this->set('admin_invite', db_commu_c_commu4c_admin_invite_id($c_commu_id, $u));
     //参加コミュニティの新着トピック書き込み
     $new_topic_comment = db_commu_new_topic_comment4c_commu_id($c_commu_id, 7);
     $this->set('new_topic_comment', $new_topic_comment);
     //参加コミュニティの新着イベント書き込み
     $new_topic_comment_event = db_commu_new_topic_comment4c_commu_id($c_commu_id, 7, 1);
     $this->set('new_topic_comment_event', $new_topic_comment_event);
     //参加コミュニティの新着おすすめレビュー
     $this->set('new_commu_review', db_review_new_commu_review4c_commu_id($c_commu_id, 7));
     // 携帯メールアドレス登録状況
     $this->set('is_registered_ktai_address', $is_registered_ktai_address);
     $this->set('is_unused_pc_bbs', util_is_unused_mail('m_pc_bbs_info'));
     $this->set('is_unused_ktai_bbs', util_is_unused_mail('m_ktai_bbs_info'));
     // inc_entry_point
     $this->set('inc_entry_point', fetch_inc_entry_point($this->getView(), 'c_home'));
     return 'success';
 }
Exemple #8
0
 function execute($requests)
 {
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     // --- リクエスト変数
     $target_c_commu_id = $requests['target_c_commu_id'];
     // ----------
     $c_commu = db_commu_c_commu4c_commu_id($target_c_commu_id);
     //コミュニティの存在の有無
     if (!$c_commu) {
         openpne_redirect('ktai', 'page_h_home');
     }
     //--- 権限チェック
     //未処理
     //掲示板の閲覧権限チェック tplでやっている
     $this->set("is_c_commu_view", db_commu_is_c_commu_view4c_commu_idAc_member_id($target_c_commu_id, $u));
     $this->set("is_c_commu_member", db_commu_is_c_commu_member($target_c_commu_id, $u));
     $this->set('is_c_commu_admin', db_commu_is_c_commu_admin($target_c_commu_id, $u));
     //---
     //管理画面HTML
     $this->set('c_siteadmin', p_common_c_siteadmin4target_pagename('k_c_home'));
     //コミュニティ情報
     $this->set("c_commu", db_commu_c_commu4c_commu_id_k($target_c_commu_id));
     // 副管理者情報
     if ($c_commu['c_member_id_sub_admin']) {
         $c_member_sub_admin = db_member_c_member4c_member_id($c_commu['c_member_id_sub_admin']);
         $this->set('sub_admin', $c_member_sub_admin);
     }
     //コミュニティメンバーリスト
     $this->set("c_commu_member_list", db_commu_c_commu_member_list_random4c_commu_id($target_c_commu_id, 5));
     //参加コミュニティの新着トピック書き込み
     $this->set("new_topic_comment", db_commu_new_topic_comment4c_commu_id($target_c_commu_id, 5));
     //参加コミュニティの新着イベント書き込み
     $this->set("new_topic_comment_event", db_commu_new_topic_comment4c_commu_id($target_c_commu_id, 5, 1));
     //自分($u)とこのコミュとの関係
     $this->set("relation_c_member_and_c_commu", db_commu_relationship_between_member_commu($target_c_commu_id, $u));
     //コミュニティメール(ktai)受信設定
     $this->set("is_receive_mail", db_commu_is_receive_mail_ktai($target_c_commu_id, $u));
     //コミュニティメール(pc)受信設定
     $this->set("is_receive_mail_pc", db_commu_is_receive_mail_pc($target_c_commu_id, $u));
     //管理者からのメッセージ受信設定
     $this->set("is_receive_message", db_commu_is_receive_message($target_c_commu_id, $u));
     $this->set('is_unused_pc_bbs', util_is_unused_mail('m_pc_bbs_info'));
     $this->set('is_unused_ktai_bbs', util_is_unused_mail('m_ktai_bbs_info'));
     // inc_entry_point
     $this->set('inc_ktai_entry_point', fetch_inc_entry_point($this->getView(), 'ktai_c_home'));
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     $title = $requests['title'];
     $body = $requests['body'];
     $err_msg = $requests['err_msg'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if (!db_commu_is_c_topic_admin($c_commu_topic_id, $u) && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     $c_commu = db_commu_c_commu4c_commu_id2($c_commu_id);
     if ($c_commu['is_topic'] == 'admin_only' && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if ($c_commu['is_topic'] == 'member' && !db_commu_is_c_commu_member($c_commu_id, $u)) {
         handle_kengen_error();
     }
     //---
     if ($c_topic['event_flag']) {
         $p = array('target_c_commu_topic_id' => $c_topic['c_commu_topic_id']);
         openpne_redirect('pc', 'page_c_event_edit', $p);
     }
     $this->set('inc_navi', fetch_inc_navi('c', $c_commu_id));
     if ($err_msg) {
         $c_topic['name'] = $title;
         $c_topic['body'] = $body;
     }
     if (!empty($c_topic['filename'])) {
         $original_filename = db_file_original_filename4filename($c_topic['filename']);
         $c_topic['original_filename'] = $original_filename;
     }
     $this->set('err_msg', $err_msg);
     $this->set('c_topic', $c_topic);
     // 許可されている拡張子のリスト
     $this->set('allowed_extensions', util_get_file_allowed_extensions('string'));
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     //---
     $this->set('inc_navi', fetch_inc_navi('c', $c_commu_id));
     $this->set("c_commu_id", $c_commu_id);
     $this->set("c_commu_topic_id", $c_commu_topic_id);
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $keyword = $requests['keyword'];
     $page = $requests['page'];
     $type = $requests['type'];
     $c_commu_id = $requests['c_commu_id'];
     $target_commu = $requests['target_commu'];
     // ----------
     if ($target_commu == 'all') {
         openpne_forward('ktai', 'page', 'h_com_topic_find_all');
         exit;
     }
     //--- 権限チェック
     //掲示板閲覧権限
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     //バグ回避のため全角空白を半角空白に統一
     $keyword = str_replace(" ", " ", $keyword);
     do_common_insert_search_log($u, $keyword);
     $page_size = 20;
     $this->set('page', $page);
     //検索結果
     list($result, $is_prev, $is_next, $total_num, $start_num, $end_num) = db_commu_search_c_commu_topic($keyword, $page_size, $page, $type, $c_commu_id);
     $this->set('c_commu_topic_search_list', $result);
     $this->set('is_prev', $is_prev);
     $this->set('is_next', $is_next);
     $this->set('total_num', $total_num);
     $this->set('start_num', $start_num);
     $this->set('end_num', $end_num);
     $this->set('keyword', $keyword);
     $search_val_list = array('type' => $type);
     $this->set('search_val_list', $search_val_list);
     $this->set('c_commu_id', $c_commu_id);
     if ($c_commu_id) {
         $this->set('c_commu', db_commu_c_commu4c_commu_id($c_commu_id));
     }
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     $tail = $GLOBALS['KTAI_URL_TAIL'];
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if (!db_commu_is_c_event_admin($c_commu_topic_id, $u) && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     //---
     $this->set('c_commu', db_commu_c_commu4c_commu_id($c_commu_id));
     $this->set('c_commu_id', $c_commu_id);
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     //---
     $this->set("host", OPENPNE_URL);
     $this->set('inc_navi', fetch_inc_navi("c", $c_commu_id));
     $this->set("c_commu_id", $c_commu_id);
     $this->set("c_commu_topic_id", $c_commu_topic_id);
     //フレンドリストをアサインする
     $this->set("c_friend_list", db_friend_c_friend_list4c_member_id2($u));
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     $tail = $GLOBALS['KTAI_URL_TAIL'];
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     $title = $requests['title'];
     $body = $requests['body'];
     $err_msg = $requests['err_msg'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if (!db_commu_is_c_topic_admin($c_commu_topic_id, $u) && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     $c_commu = db_commu_c_commu4c_commu_id2($c_commu_id);
     if ($c_commu['is_topic'] == 'admin_only' && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if ($c_commu['is_topic'] == 'member' && !db_commu_is_c_commu_member($c_commu_id, $u)) {
         handle_kengen_error();
     }
     //---
     if ($c_topic['event_flag']) {
         $p = array('target_c_commu_topic_id' => $c_topic['c_commu_topic_id']);
         openpne_redirect('ktai', 'page_c_event_edit', $p);
     }
     if ($err_msg) {
         $c_topic['name'] = $title;
         $c_topic['body'] = $body;
     }
     $this->set('err_msg', $err_msg);
     $this->set('c_topic', $c_topic);
     $this->set("c_commu", db_commu_c_commu4c_commu_id2($c_commu_id));
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     $tail = $GLOBALS['KTAI_URL_TAIL'];
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     $img_num = $requests['img_num'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if (!db_commu_is_c_topic_admin($c_commu_topic_id, $u) && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     //---
     $target_image_filename = '';
     switch ($img_num) {
         case '1':
             $target_image_filename = $c_topic['image_filename1'];
             break;
         case '2':
             $target_image_filename = $c_topic['image_filename2'];
             break;
         case '3':
             $target_image_filename = $c_topic['image_filename3'];
             break;
     }
     if (empty($target_image_filename)) {
         handle_kengen_error();
     }
     $this->set('c_topic', $c_topic);
     $this->set("c_commu", db_commu_c_commu4c_commu_id2($c_commu_id));
     $this->set('img_num', $img_num);
     $this->set('target_image_filename', $target_image_filename);
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     $page = $requests['page'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     //---
     $this->set('c_commu', db_commu_c_commu4c_commu_id($c_commu_id));
     $this->set('c_topic', $c_topic);
     $this->set('inc_navi', fetch_inc_navi('c', $c_commu_id));
     $this->set('page', $page);
     $page_size = 50;
     $c_event_member_list = db_commu_c_event_member_list4c_commu_topic_id($c_commu_topic_id, $page, $page_size);
     $total_c_event_member = db_commu_count_c_event_member_list4c_commu_topic_id($c_commu_topic_id);
     $start_num = ($page - 1) * $page_size + 1;
     $end_num = $page * $page_size;
     if ($end_num > $total_c_event_member) {
         $end_num = $total_c_event_member;
     }
     $end_page = ceil($total_c_event_member / $page_size);
     for ($i = 1; $i <= $end_page; $i++) {
         $page_num[] = $i;
     }
     $this->set("page_num", $page_num);
     $this->set('c_event_member_list', $c_event_member_list);
     $this->set('total_c_event_member', $total_c_event_member);
     $this->set('is_prev', $start_num != 1);
     $this->set('is_next', $end_num != $total_c_event_member);
     $this->set('start_num', $start_num);
     $this->set('end_num', $end_num);
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     $tail = $GLOBALS['KTAI_URL_TAIL'];
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     $img_num = $requests['img_num'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if (!db_commu_is_c_topic_admin($c_commu_topic_id, $u) && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     //---
     $target_image_filename = '';
     switch ($img_num) {
         case '1':
             $target_image_filename = $c_topic['image_filename1'];
             break;
         case '2':
             $target_image_filename = $c_topic['image_filename2'];
             break;
         case '3':
             $target_image_filename = $c_topic['image_filename3'];
             break;
     }
     if (empty($target_image_filename)) {
         handle_kengen_error();
     }
     db_image_data_delete($target_image_filename, $u);
     db_commu_delete_c_commu_topic_comment_image($c_commu_topic_id, $img_num);
     $p = array('target_c_commu_topic_id' => $c_commu_topic_id);
     openpne_redirect('ktai', 'page_c_topic_edit_image', $p);
 }
 function execute($requests)
 {
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     // --- リクエスト変数
     $target_c_commu_topic_id = $requests['target_c_commu_topic_id'];
     // ----------
     $c_commu = db_commu_c_commu4c_commu_topic_id($target_c_commu_topic_id);
     $c_commu_id = $c_commu['c_commu_id'];
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     $target_c_commu_topic = db_commu_c_topic4c_commu_topic_id_2($target_c_commu_topic_id);
     if (!$target_c_commu_topic['event_flag']) {
         handle_kengen_error();
     }
     $this->set('c_commu_topic', $target_c_commu_topic);
     // コミュニティ
     $this->set("c_commu", $c_commu);
     // ランダムフレンドリスト
     //    イベント参加済のメンバーも含まれる
     $this->set("c_friend_list", db_friend_ktai_c_friend_list_random4c_member_id($u));
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     // --- リクエスト変数
     $c_commu_id = $requests['target_c_commu_id'];
     $page = $requests['page'];
     // ----------
     //--- 権限チェック
     //掲示板閲覧権限
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     $page_size = 10;
     $this->set('c_commu', db_commu_c_commu4c_commu_id($c_commu_id));
     list($result, $is_prev, $is_next, $total_num, $start_num, $end_num) = db_commu_c_topic_list4target_c_commu_id($c_commu_id, $u, $page, $page_size, 1, 1);
     $this->set("c_topic_list", $result);
     $this->set("is_prev", $is_prev);
     $this->set("is_next", $is_next);
     $this->set("page", $page);
     $this->set("total_num", $total_num);
     $this->set('start_num', $start_num);
     $this->set('end_num', $end_num);
     return 'success';
 }
function p_common_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $c_member_id)
{
    return db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $c_member_id);
}
Exemple #21
0
 function execute($requests)
 {
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     $target_response_comment_id = $requests['target_response_comment_id'];
     $page = $requests['page'];
     // ----------
     $page_size = 5;
     // トピックのコメントリスト
     if ($requests['order'] === 'asc') {
         $desc = false;
     } else {
         $desc = true;
     }
     list($list, $pager) = db_commu_c_topic_write4c_commu_topic_id($c_commu_topic_id, $page, $page_size, $desc);
     foreach ($list as $key => $value) {
         if ($value['filename']) {
             $list[$key]['original_filename'] = db_file_original_filename4filename($value['filename']);
         }
     }
     $this->set('c_commu_topic_comment_list', $list);
     $this->set('pager', $pager);
     //トピック名
     $this->set('c_commu_topic_name', db_commu_c_commu_topic_name4c_commu_topic_id($c_commu_topic_id));
     //トピックID
     $this->set('c_commu_topic_id', $c_commu_topic_id);
     //トピック
     $c_commu_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id);
     $c_commu_topic['original_filename'] = db_file_original_filename4filename($c_commu_topic['filename']);
     $this->set('c_commu_topic', $c_commu_topic);
     //コミュニティ
     $c_commu = db_commu_c_commu4c_commu_topic_id($c_commu_topic_id);
     $c_commu_id = $c_commu['c_commu_id'];
     $c_commu = db_commu_c_commu4c_commu_id($c_commu_id);
     $this->set('c_commu', $c_commu);
     //--- 権限チェック
     //コミュニティの存在の有無
     if (!$c_commu) {
         handle_kengen_error();
     }
     //コミュニティ掲示板閲覧権限
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if ($target_response_comment_id) {
         $target_comment = db_commu_c_commu_topic_comment4c_commu_topic_comment_id($target_response_comment_id);
         $response_set = db_member_c_member4c_member_id_LIGHT($target_comment['c_member_id']);
         $this->set('response_comment_format', '>>' . $target_comment['number'] . ' ' . $response_set['nickname'] . "さん\n");
     }
     //掲示板の閲覧権限 tplでやっている
     $this->set('is_c_commu_view', db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu['c_commu_id'], $u));
     $this->set('is_c_commu_member', db_commu_is_c_commu_member($c_commu['c_commu_id'], $u));
     $this->set('is_c_event_member', db_commu_is_c_event_member($c_commu_topic_id, $u));
     $this->set('is_c_event_admin', db_commu_is_c_event_admin($c_commu_topic_id, $u));
     $this->set('is_event_join_date', db_commu_is_event_join_date($c_commu_topic_id));
     $this->set('is_event_join_capacity', db_commu_is_event_join_capacity($c_commu_topic_id));
     $this->set('is_writable_comment', db_commu_is_writable_c_commu_topic_comment4c_commu_topic_id($c_commu_topic_id));
     //メンバーがコミュニティ管理者かどうか
     $this->set('is_admin', db_commu_is_admin4c_member_id_c_commu_topic_id($u, $c_commu_topic_id));
     //コミュニティ管理者
     $this->set('c_member_admin', db_commu_c_member_admin4c_commu_topic_id($c_commu_topic_id));
     if (MAIL_ADDRESS_HASHED) {
         $mail_address = "t{$c_commu_topic_id}-" . t_get_user_hash($u) . '@' . MAIL_SERVER_DOMAIN;
     } else {
         $mail_address = "t{$c_commu_topic_id}" . '@' . MAIL_SERVER_DOMAIN;
     }
     $mail_address = MAIL_ADDRESS_PREFIX . $mail_address;
     $this->set('mail_address', $mail_address);
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     $tail = $GLOBALS['KTAI_URL_TAIL'];
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     $err_msg = $requests['err_msg'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if (!db_commu_is_c_topic_admin($c_commu_topic_id, $u) && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     $c_commu = db_commu_c_commu4c_commu_id2($c_commu_id);
     if ($c_commu['is_topic'] == 'admin_only' && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if ($c_commu['is_topic'] == 'member' && !db_commu_is_c_commu_member($c_commu_id, $u)) {
         handle_kengen_error();
     }
     //---
     if (!$c_topic['event_flag']) {
         openpne_redirect('ktai', 'page_c_topic_edit', array('target_c_commu_topic_id' => $c_topic['c_commu_topic_id']));
     }
     $this->set("c_commu", db_commu_c_commu4c_commu_id2($c_commu_id));
     $this->set("year", db_commu_year4null());
     $this->set('month', p_regist_prof_c_profile_month_list4null());
     $this->set('day', p_regist_prof_c_profile_day_list4null());
     $this->set('pref', p_regist_prof_c_profile_pref_list4null());
     $this->set('err_msg', $err_msg);
     //編集確認画面でエラーがでたときここに戻ってくる。そのときのためにrequestから取得
     //保留
     if ($err_msg) {
         $c_topic_temp = p_c_event_add_confirm_event4request();
         $c_topic['name'] = $c_topic_temp['title'];
         $c_topic['body'] = $c_topic_temp['detail'];
         $c_topic['open_date_comment'] = $c_topic_temp['open_date_comment'];
         $c_topic['open_pref_id'] = $c_topic_temp['open_pref_id'];
         $c_topic['open_pref_comment'] = $c_topic_temp['open_pref_comment'];
         $c_topic['open_date_year'] = $c_topic_temp['open_date_year'];
         $c_topic['open_date_month'] = $c_topic_temp['open_date_month'];
         $c_topic['open_date_day'] = $c_topic_temp['open_date_day'];
         $c_topic['invite_period_year'] = $c_topic_temp['invite_period_year'];
         $c_topic['invite_period_month'] = $c_topic_temp['invite_period_month'];
         $c_topic['invite_period_day'] = $c_topic_temp['invite_period_day'];
     } else {
         $open_date_arr = explode("-", $c_topic['open_date']);
         $invite_period_arr = explode("-", $c_topic['invite_period']);
         $c_topic['open_date_year'] = $open_date_arr[0];
         $c_topic['open_date_month'] = $open_date_arr[1];
         $c_topic['open_date_day'] = $open_date_arr[2];
         $c_topic['invite_period_year'] = $invite_period_arr[0];
         $c_topic['invite_period_month'] = $invite_period_arr[1];
         $c_topic['invite_period_day'] = $invite_period_arr[2];
     }
     $this->set('event', $c_topic);
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     $page = $requests['page'];
     $err_msg = $requests['err_msg'];
     $body = $requests['body'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     //---
     $c_commu = db_commu_c_commu4c_commu_id($c_commu_id);
     if (!$c_commu) {
         openpne_redirect('pc', 'page_h_err_c_home');
     }
     if (!$c_topic['event_flag']) {
         $p = array('target_c_commu_topic_id' => $c_topic['c_commu_topic_id']);
         openpne_redirect('pc', 'page_c_topic_detail', $p);
     }
     $this->set('inc_navi', fetch_inc_navi('c', $c_commu_id));
     //詳細部分
     $this->set('c_commu', $c_commu);
     $c_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id);
     $c_topic['original_filename'] = db_file_original_filename4filename($c_topic['filename']);
     $this->set('c_topic', $c_topic);
     //書き込み一覧部分
     if ($requests['page_size'] == 100) {
         $page_size = 100;
     } else {
         $page_size = 20;
     }
     if ($requests['order'] === 'asc') {
         $desc = false;
     } else {
         $desc = true;
     }
     list($c_topic_write, $pager) = db_commu_c_topic_write4c_commu_topic_id($c_commu_topic_id, $page, $page_size, $desc);
     foreach ($c_topic_write as $key => $value) {
         if ($value['filename']) {
             $c_topic_write[$key]['original_filename'] = db_file_original_filename4filename($value['filename']);
         }
     }
     $this->set('c_topic_write', $c_topic_write);
     $this->set('pager', $pager);
     $this->set('is_c_commu_admin', db_commu_is_c_commu_admin($c_commu_id, $u));
     $this->set('is_c_commu_member', db_commu_is_c_commu_member($c_commu_id, $u));
     $this->set('is_c_event_member', db_commu_is_c_event_member($c_commu_topic_id, $u));
     $this->set('is_c_event_admin', db_commu_is_c_event_admin($c_commu_topic_id, $u));
     $this->set('is_event_join_date', db_commu_is_event_join_date($c_commu_topic_id));
     $this->set('is_event_join_capacity', db_commu_is_event_join_capacity($c_commu_topic_id));
     $this->set('is_writable_comment', db_commu_is_writable_c_commu_topic_comment4c_commu_topic_id($c_commu_topic_id));
     $this->set('err_msg', $err_msg);
     $this->set('body', $body);
     $this->set('c_member_id', $u);
     // 許可されている拡張子のリスト
     $this->set('allowed_extensions', util_get_file_allowed_extensions('string'));
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     $body = $requests['body'];
     $button = $requests['button'];
     // ----------
     $upfile_obj1 = $_FILES['image_filename1'];
     $upfile_obj2 = $_FILES['image_filename2'];
     $upfile_obj3 = $_FILES['image_filename3'];
     //添付ファイル
     $upfile_obj4 = $_FILES['uploadfile'];
     $c_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if (!db_commu_is_writable_c_commu_topic_comment4c_commu_topic_id($c_commu_topic_id)) {
         $err_msg[] = 'コメントが1000番に達したので、このイベントにはコメントできません';
         $_REQUEST['err_msg'] = $err_msg;
         openpne_forward('pc', 'page', "c_event_detail");
         exit;
     }
     //---
     if ($button == "イベントに参加する") {
         $event_write['add_event_member'] = 1;
     } elseif ($button == "参加をキャンセルする") {
         $event_write['add_event_member'] = -1;
     }
     //エラーチェック
     $err_msg = array();
     $filesize = 0;
     if (trim($body) == '') {
         $err_msg[] = "本文を入力してください";
     }
     if (!empty($upfile_obj1) && $upfile_obj1['error'] !== UPLOAD_ERR_NO_FILE) {
         if (!($image = t_check_image($upfile_obj1))) {
             $err_msg[] = '画像1は' . IMAGE_MAX_FILESIZE . 'KB以内のGIF・JPEG・PNGにしてください';
         }
         $filesize += $image['size'];
     }
     if (!empty($upfile_obj2) && $upfile_obj2['error'] !== UPLOAD_ERR_NO_FILE) {
         if (!($image = t_check_image($upfile_obj2))) {
             $err_msg[] = '画像2は' . IMAGE_MAX_FILESIZE . 'KB以内のGIF・JPEG・PNGにしてください';
         }
         $filesize += $image['size'];
     }
     if (!empty($upfile_obj3) && $upfile_obj3['error'] !== UPLOAD_ERR_NO_FILE) {
         if (!($image = t_check_image($upfile_obj3))) {
             $err_msg[] = '画像3は' . IMAGE_MAX_FILESIZE . 'KB以内のGIF・JPEG・PNGにしてください';
         }
         $filesize += $image['size'];
     }
     //---画像アップロードサイズチェック
     if ($filesize) {
         $result = util_image_check_add_image_upload($filesize, $u, 'commu');
         if ($result) {
             if ($result == 2) {
                 $result = 3;
             }
             $err_msg[] = util_image_get_upload_err_msg($result);
         }
     }
     if (OPENPNE_USE_FILEUPLOAD) {
         if (!empty($upfile_obj4) && $upfile_obj4['error'] !== UPLOAD_ERR_NO_FILE) {
             // ファイルサイズ制限
             if ($upfile_obj4['size'] === 0 || $upfile_obj4['size'] > FILE_MAX_FILESIZE * 1024) {
                 $err_msg[] = 'ファイルは' . FILE_MAX_FILESIZE . 'KB以内のファイルにしてください(ただし空のファイルはアップロードできません)';
             }
             // 拡張子制限
             if (!util_check_file_extention($upfile_obj4['name'])) {
                 $err_msg[] = sprintf('アップロードできるファイルの種類は(%s)です', util_get_file_allowed_extensions('string'));
             }
         }
     }
     if ($event_write['add_event_member'] === 1 && $c_topic['capacity'] && $c_topic['capacity'] <= $c_topic['member_num']) {
         $err_msg[] = 'イベントの参加者数制限を超えています';
     }
     if ($event_write['add_event_member']) {
         if (!db_commu_is_event_join_date($c_commu_topic_id)) {
             $err_msg[] = '現在このイベントへの参加・キャンセルの変更はできません';
         }
     }
     if ($err_msg) {
         $_REQUEST['err_msg'] = $err_msg;
         $_REQUEST['body'] = $body;
         openpne_forward('pc', 'page', "c_event_detail");
         exit;
     }
     $sessid = session_id();
     t_image_clear_tmp($sessid);
     t_file_clear_tmp($sessid);
     $tmpfile1 = t_image_save2tmp($upfile_obj1, $sessid, "tc_1");
     $tmpfile2 = t_image_save2tmp($upfile_obj2, $sessid, "tc_2");
     $tmpfile3 = t_image_save2tmp($upfile_obj3, $sessid, "tc_3");
     if (OPENPNE_USE_FILEUPLOAD) {
         // 一時ファイルをvar/tmpにコピー
         $tmpfile4 = t_file_save2tmp($upfile_obj4, $sessid, "tc_4");
     }
     $this->set('inc_navi', fetch_inc_navi("c", $c_commu_id));
     $event_write['target_c_commu_id'] = $c_commu_id;
     $event_write['target_c_commu_topic_id'] = $c_commu_topic_id;
     $event_write['body'] = $body;
     $event_write['image_filename1_tmpfile'] = $tmpfile1;
     $event_write['image_filename2_tmpfile'] = $tmpfile2;
     $event_write['image_filename3_tmpfile'] = $tmpfile3;
     $event_write['image_filename1'] = $upfile_obj1["name"];
     $event_write['image_filename2'] = $upfile_obj2["name"];
     $event_write['image_filename3'] = $upfile_obj3["name"];
     $event_write['filename4_tmpfile'] = $tmpfile4;
     $event_write['filename4_original_filename'] = $upfile_obj4["name"];
     $this->set('event_write', $event_write);
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     $err_msg = $requests['err_msg'];
     // ----------
     $c_topic = db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id);
     $c_commu_id = $c_topic['c_commu_id'];
     //--- 権限チェック
     if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if (!db_commu_is_c_topic_admin($c_commu_topic_id, $u) && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     $c_commu = db_commu_c_commu4c_commu_id2($c_commu_id);
     if ($c_commu['is_topic'] == 'admin_only' && !db_commu_is_c_commu_admin($c_commu_id, $u)) {
         handle_kengen_error();
     }
     if ($c_commu['is_topic'] == 'member' && !db_commu_is_c_commu_member($c_commu_id, $u)) {
         handle_kengen_error();
     }
     //---
     if (!$c_topic['event_flag']) {
         $p = array('target_c_commu_topic_id' => $c_topic['c_commu_topic_id']);
         openpne_redirect('pc', 'page_c_topic_edit', $p);
     }
     if (!empty($c_topic['filename'])) {
         $c_topic['original_filename'] = db_file_original_filename4filename($c_topic['filename']);
     }
     $this->set('inc_navi', fetch_inc_navi("c", $c_commu_id));
     $this->set("year", db_commu_year4null());
     $this->set('month', p_regist_prof_c_profile_month_list4null());
     $this->set('day', p_regist_prof_c_profile_day_list4null());
     $this->set('pref', p_regist_prof_c_profile_pref_list4null());
     $this->set('err_msg', $err_msg);
     //編集確認画面でエラーがでたときここに戻ってくる。そのときのためにrequestから取得
     //保留
     if ($err_msg) {
         $c_topic_temp = p_c_event_add_confirm_event4request();
         $c_topic['name'] = $c_topic_temp['title'];
         $c_topic['body'] = $c_topic_temp['detail'];
         $c_topic['open_date_comment'] = $c_topic_temp['open_date_comment'];
         $c_topic['open_pref_id'] = $c_topic_temp['open_pref_id'];
         $c_topic['open_pref_comment'] = $c_topic_temp['open_pref_comment'];
         $c_topic['open_date_year'] = $c_topic_temp['open_date_year'];
         $c_topic['open_date_month'] = $c_topic_temp['open_date_month'];
         $c_topic['open_date_day'] = $c_topic_temp['open_date_day'];
         $c_topic['invite_period_year'] = $c_topic_temp['invite_period_year'];
         $c_topic['invite_period_month'] = $c_topic_temp['invite_period_month'];
         $c_topic['invite_period_day'] = $c_topic_temp['invite_period_day'];
     } else {
         $open_date_arr = explode("-", $c_topic['open_date']);
         $invite_period_arr = explode("-", $c_topic['invite_period']);
         $c_topic['open_date_year'] = $open_date_arr[0];
         $c_topic['open_date_month'] = $open_date_arr[1];
         $c_topic['open_date_day'] = $open_date_arr[2];
         $c_topic['invite_period_year'] = $invite_period_arr[0];
         $c_topic['invite_period_month'] = $invite_period_arr[1];
         $c_topic['invite_period_day'] = $invite_period_arr[2];
     }
     $this->set('event', $c_topic);
     // 許可されている拡張子のリスト
     $this->set('allowed_extensions', util_get_file_allowed_extensions('string'));
     return 'success';
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $c_commu_id = $requests['target_c_commu_id'];
     $title = $requests['title'];
     $body = $requests['body'];
     // ----------
     //--- 権限チェック
     $c_commu = db_commu_c_commu4c_commu_id2($c_commu_id);
     switch ($c_commu['is_topic']) {
         case 'public':
             //誰でも作成可能
             break;
         case 'member':
             if (!db_commu_is_c_commu_view4c_commu_idAc_member_id($c_commu_id, $u)) {
                 handle_kengen_error();
             }
             break;
         case 'admin_only':
             //トピック作成権限チェック
             if (!db_commu_is_c_commu_admin($c_commu_id, $u)) {
                 handle_kengen_error();
             }
             break;
     }
     //画像ファイル
     $upfile_obj1 = $_FILES['image_filename1'];
     $upfile_obj2 = $_FILES['image_filename2'];
     $upfile_obj3 = $_FILES['image_filename3'];
     //添付ファイル
     $upfile_obj4 = $_FILES['uploadfile'];
     $err_msg = array();
     $filesize = 0;
     if (!empty($upfile_obj1) && $upfile_obj1['error'] !== UPLOAD_ERR_NO_FILE) {
         if (!($image = t_check_image($upfile_obj1))) {
             $err_msg[] = '画像1は' . IMAGE_MAX_FILESIZE . 'KB以内のGIF・JPEG・PNGにしてください';
         }
         $filesize += $image['size'];
     }
     if (!empty($upfile_obj2) && $upfile_obj2['error'] !== UPLOAD_ERR_NO_FILE) {
         if (!($image = t_check_image($upfile_obj2))) {
             $err_msg[] = '画像2は' . IMAGE_MAX_FILESIZE . 'KB以内のGIF・JPEG・PNGにしてください';
         }
         $filesize += $image['size'];
     }
     if (!empty($upfile_obj3) && $upfile_obj3['error'] !== UPLOAD_ERR_NO_FILE) {
         if (!($image = t_check_image($upfile_obj3))) {
             $err_msg[] = '画像3は' . IMAGE_MAX_FILESIZE . 'KB以内のGIF・JPEG・PNGにしてください';
         }
         $filesize += $image['size'];
     }
     // 画像アップロードサイズチェック
     if ($filesize) {
         $result = util_image_check_add_image_upload($filesize, $u, 'commu');
         if ($result) {
             if ($result == 2) {
                 $result = 3;
             }
             $err_msg[] = util_image_get_upload_err_msg($result);
         }
     }
     if (OPENPNE_USE_FILEUPLOAD) {
         if (!empty($upfile_obj4) && $upfile_obj4['error'] !== UPLOAD_ERR_NO_FILE) {
             // ファイルサイズ制限
             if ($upfile_obj4['size'] === 0 || $upfile_obj4['size'] > FILE_MAX_FILESIZE * 1024) {
                 $err_msg[] = 'ファイルは' . FILE_MAX_FILESIZE . 'KB以内のファイルにしてください(ただし空のファイルはアップロードできません)';
             }
             // 拡張子制限
             if (!util_check_file_extention($upfile_obj4['name'])) {
                 $err_msg[] = sprintf('アップロードできるファイルの種類は(%s)です', util_get_file_allowed_extensions('string'));
             }
         }
     }
     if ($err_msg) {
         $_REQUEST['err_msg'] = $err_msg;
         openpne_forward('pc', 'page', "c_topic_add");
         exit;
     }
     $sessid = session_id();
     //-----
     t_image_clear_tmp($sessid);
     t_file_clear_tmp($sessid);
     //画像をvar/tmpフォルダにコピー
     $tmpfile1 = t_image_save2tmp($upfile_obj1, $sessid, "t_1");
     $tmpfile2 = t_image_save2tmp($upfile_obj2, $sessid, "t_2");
     $tmpfile3 = t_image_save2tmp($upfile_obj3, $sessid, "t_3");
     if (OPENPNE_USE_FILEUPLOAD) {
         // 一次ファイルをvar/tmpにコピー
         $tmpfile4 = t_file_save2tmp($upfile_obj4, $sessid, "t_4");
     }
     $this->set('inc_navi', fetch_inc_navi("c", $c_commu_id));
     $c_topic = array('c_commu_id' => $c_commu_id, 'title' => $title, 'body' => $body, 'image_filename1_tmpfile' => $tmpfile1, 'image_filename2_tmpfile' => $tmpfile2, 'image_filename3_tmpfile' => $tmpfile3, 'image_filename1' => $upfile_obj1["name"], 'image_filename2' => $upfile_obj2["name"], 'image_filename3' => $upfile_obj3["name"], 'filename4_tmpfile' => $tmpfile4, 'filename4_original_filename' => $upfile_obj4["name"]);
     $this->set('c_topic', $c_topic);
     return 'success';
 }