function execute($requests)
 {
     $v = array();
     $target_c_commu_topic_comment_ids = $requests['target_c_commu_topic_comment_ids'];
     // トピックのコメントが選択されていない場合はエラー
     if (!$target_c_commu_topic_comment_ids) {
         admin_client_redirect('topic_comment_list', "トピックのコメントが選択されていません");
     }
     $id_ary = split(":", $target_c_commu_topic_comment_ids);
     $v = array();
     $topic_comment_list = array();
     foreach ($id_ary as $id) {
         $topic_comment = db_commu_c_commu_topic_comment4c_commu_topic_comment_id($id);
         if (!$topic_comment) {
             admin_client_redirect('topic_comment_list', '指定されたトピック・イベントのコメントは存在しません');
         }
         if ($topic_comment['number'] == 0) {
             admin_client_redirect('topic_comment_list', '指定されたコメントはトピック本文のためトピック削除にて削除してください');
         }
         $member = db_member_c_member4c_member_id($topic_comment['c_member_id']);
         $topic_comment['nickname'] = $member['nickname'];
         $topic_comment['count_comments'] = _db_count_c_commu_topic_comments4c_commu_topic_id($topic_comment['c_commu_topic_id']);
         $topic_comment['original_filename'] = db_file_original_filename4filename($topic_comment['filename']);
         array_push($topic_comment_list, $topic_comment);
     }
     $this->set('topic_comment_list', $topic_comment_list);
     $this->set('target_c_commu_topic_comment_ids', $target_c_commu_topic_comment_ids);
     $v['SNS_NAME'] = SNS_NAME;
     $v['OPENPNE_VERSION'] = OPENPNE_VERSION;
     $this->set($v);
     return 'success';
 }
 function execute($requests)
 {
     $topic_comment = db_commu_c_commu_topic_comment4c_commu_topic_comment_id($requests['target_c_commu_topic_comment_id']);
     if (!$topic_comment) {
         admin_client_redirect('topic_comment_list', '指定されたトピック・イベントのコメントは存在しません');
     }
     if ($topic_comment['number'] == 0) {
         admin_client_redirect('topic_comment_list', '指定されたコメントはトピック本文のためトピック削除にて削除してください');
     }
     db_commu_delete_c_commu_topic_comment($requests['target_c_commu_topic_comment_id']);
     admin_client_redirect('topic_comment_list', 'トピック・イベントのコメントを削除しました');
 }
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     // --- リクエスト変数
     $c_commu_topic_id = $requests['target_c_commu_topic_id'];
     $c_commu_topic_comment_id = $requests['target_c_commu_topic_comment_id'];
     // ----------
     if (!$c_commu_topic_id && !$c_commu_topic_comment_id) {
         handle_kengen_error();
     }
     if ($c_commu_topic_comment_id) {
         $c_topic_comment = db_commu_c_commu_topic_comment4c_commu_topic_comment_id($c_commu_topic_comment_id);
         $c_commu_id = $c_topic_comment['c_commu_id'];
         $filename = $c_topic_comment['filename'];
     } else {
         $c_topic = db_commu_c_topic4c_commu_topic_id($c_commu_topic_id);
         $c_commu_id = $c_topic['c_commu_id'];
         $filename = $c_topic['filename'];
     }
     //--- 権限チェック
     //コミュニティ参加者
     $status = db_common_commu_status($u, $c_commu_id);
     if (!$status['is_bbs_view']) {
         handle_kengen_error();
     }
     // ファイルアップロード機能がオフ
     if (!OPENPNE_USE_FILEUPLOAD) {
         handle_kengen_error();
     }
     // ファイルが存在しない
     $file = db_file_c_file4filename($filename);
     if (empty($file)) {
         handle_kengen_error();
     }
     // オリジナルファイル名
     $original_filename = $file['original_filename'];
     if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) {
         // IE の場合のみ、ファイル名を SJIS に変換し、キャッシュをさせないヘッダを出力しない
         $original_filename = mb_convert_encoding($original_filename, 'SJIS', 'UTF-8');
     } else {
         send_nocache_headers(true);
     }
     $original_filename = str_replace(array("\r", "\n"), '', $original_filename);
     header('Content-Disposition: attachment; filename="' . $original_filename . '"');
     header('Content-Length: ' . strlen($file['bin']));
     header('Content-Type: application/octet-stream');
     echo $file['bin'];
     exit;
 }
 function execute($requests)
 {
     $id_ary = split(":", $requests['target_c_commu_topic_comment_ids']);
     foreach ($id_ary as $id) {
         $topic_comment = db_commu_c_commu_topic_comment4c_commu_topic_comment_id($id);
         if (!$topic_comment) {
             admin_client_redirect('topic_comment_list', '指定されたトピック・イベントのコメントは存在しません');
         }
         if ($topic_comment['number'] == 0) {
             admin_client_redirect('topic_comment_list', '指定されたコメントはトピック本文のためトピック削除にて削除してください');
         }
     }
     foreach ($id_ary as $id) {
         db_commu_delete_c_commu_topic_comment($id);
     }
     admin_client_redirect('topic_comment_list', 'トピック・イベントのコメントを削除しました');
 }
 function execute($requests)
 {
     $v = array();
     $target_c_commu_topic_comment_id = $requests['target_c_commu_topic_comment_id'];
     $v = array();
     $topic_comment = db_commu_c_commu_topic_comment4c_commu_topic_comment_id($target_c_commu_topic_comment_id);
     if (!$topic_comment) {
         admin_client_redirect('topic_comment_list', '指定されたトピック・イベントのコメントは存在しません');
     }
     if ($topic_comment['number'] == 0) {
         admin_client_redirect('topic_comment_list', '指定されたコメントはトピック本文のためトピック削除にて削除してください');
     }
     $member = db_member_c_member4c_member_id($topic_comment['c_member_id']);
     $topic_comment['nickname'] = $member['nickname'];
     $topic_comment['count_comments'] = _db_count_c_commu_topic_comments4c_commu_topic_id($topic_comment['c_commu_topic_id']);
     $topic_comment['original_filename'] = db_file_original_filename4filename($topic_comment['filename']);
     $this->set('topic_comment', $topic_comment);
     $v['SNS_NAME'] = SNS_NAME;
     $v['OPENPNE_VERSION'] = OPENPNE_VERSION;
     $this->set($v);
     return 'success';
 }
function _db_common_c_commu_topic_comment4c_commu_topic_comment_id($c_commu_topic_comment_id)
{
    return db_commu_c_commu_topic_comment4c_commu_topic_comment_id($c_commu_topic_comment_id);
}
Exemple #7
0
function send_bbs_info_mail_pc($c_commu_topic_comment_id, $c_member_id)
{
    $comment = db_commu_c_commu_topic_comment4c_commu_topic_comment_id($c_commu_topic_comment_id);
    $c_member = db_member_c_member4c_member_id_LIGHT($c_member_id);
    $c_commu_id = $comment['c_commu_id'];
    $c_commu_topic_id = $comment['c_commu_topic_id'];
    $topic_name = $comment['topic_name'];
    $commu_name = $comment['commu_name'];
    $body = $comment['body'];
    $nickname = $c_member['nickname'];
    $p = array('target_c_commu_topic_id' => $c_commu_topic_id);
    $url = openpne_gen_url('pc', 'page_c_topic_detail', $p);
    $image_filename1 = $comment['image_filename1'];
    $image_filename2 = $comment['image_filename2'];
    $image_filename3 = $comment['image_filename3'];
    $image = $image_filename1 || $image_filename2 || $image_filename3;
    $params = array("topic_name" => $topic_name, "commu_name" => $commu_name, "nickname" => $nickname, "url" => $url, "body" => $body, "image_filename1" => $image_filename1, "image_filename2" => $image_filename2, "image_filename3" => $image_filename3);
    $tpl = fetch_mail_m_tpl("m_pc_bbs_info", $params);
    if (!$tpl) {
        return false;
    }
    list($subject, $body) = $tpl;
    $lst = db_common_receive_pc_address_list4c_commu_id($c_commu_id);
    foreach ($lst as $pc_address) {
        t_send_email($pc_address, $subject, $body, true);
    }
}
Exemple #8
0
/**
 * トピックコメント削除
 */
function kanshi_db_commu_delete_c_commu_topic_comment($c_commu_topic_comment_id)
{
    if (db_commu_c_commu_topic_comment4c_commu_topic_comment_id($c_commu_topic_comment_id)) {
        $sql = 'SELECT image_filename1, image_filename2, image_filename3' . ' FROM c_commu_topic_comment' . ' WHERE c_commu_topic_comment_id = ?';
        $params = array(intval($c_commu_topic_comment_id));
        $topic_comment = db_get_row($sql, $params);
        image_data_delete($topic_comment['image_filename1']);
        image_data_delete($topic_comment['image_filename2']);
        image_data_delete($topic_comment['image_filename3']);
        $sql = 'DELETE FROM c_commu_topic_comment WHERE c_commu_topic_comment_id = ?';
        if (db_query($sql, $params)) {
            return array(1, 0, '');
        } else {
            return array(0, 2, 'DB更新エラー');
        }
    } else {
        //        return array(0, 99, '既に削除されているか存在しません');
        // 監視ツールがリトライを行ってしまう為、成功フラグを返してしまう
        return array(1, 0, '');
    }
}
Exemple #9
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';
 }