/** * コミュニティ掲示板投稿 */ function add_commu_topic_comment($c_commu_topic_id) { if (!($topic = db_commu_c_commu_topic4c_commu_topic_id_3($c_commu_topic_id))) { return false; } $c_commu_id = $topic['c_commu_id']; if (!db_commu_is_c_commu_member($c_commu_id, $this->c_member_id)) { $this->error_mail(WORD_COMMUNITY . 'に参加していないため投稿できませんでした。'); m_debug_log('mail_sns::add_commu_topic_comment() not a member'); return false; } $images = $this->decoder->get_images(); if ($images === false) { $this->error_mail('画像は' . IMAGE_MAX_FILESIZE . 'KB以内のGIF・JPEG・PNGにしてください。'); return false; } // 画像アップロード可能サイズチェック if ($images) { $filesize = 0; $image_num = 1; foreach ($images as $image) { $filesize += $image['filesize']; $image_num++; if ($image_num > 3) { break; } } $result = util_image_check_add_image_upload($filesize, $this->c_member_id, 'commu'); if ($result) { $msg = util_image_get_upload_err_msg($result); $this->error_mail($msg); m_debug_log('mail_sns::add_commu_topic_comment() imagesize is full'); return false; } } $body = $this->decoder->get_text_body(); if ($body === '') { $this->error_mail('本文が空のため投稿できませんでした。'); m_debug_log('mail_sns::add_commu_topic_comment() body is empty'); return false; } // 書き込みをDBに追加 $ins_id = db_commu_insert_c_commu_topic_comment($c_commu_id, $topic['c_commu_topic_id'], $this->c_member_id, $body); // 写真登録 $image_num = 1; foreach ($images as $image) { $image_ext = $image['ext']; $image_data = $image['data']; $filename = 'tc_' . $ins_id . '_' . $image_num . '_' . time() . '.' . $image_ext; db_image_insert_c_image($filename, $image_data, $image['filesize'], $this->c_member_id); db_commu_update_c_commu_topic_comment_image($ins_id, $filename, $image_num); $image_num++; if ($image_num > 3) { break; } } //お知らせメール送信(携帯へ) send_bbs_info_mail($ins_id, $this->c_member_id); //お知らせメール送信(PCへ) send_bbs_info_mail_pc($ins_id, $this->c_member_id); if (OPENPNE_USE_POINT_RANK) { //トピック・イベントにコメントした人にポイント付与 $point = db_action_get_point4c_action_id(11); db_point_add_point($this->c_member_id, $point); } return true; }
/** * トピックコメント書き込み */ function db_commu_insert_c_commu_topic_comment_2($c_member_id, $target_c_commu_topic_id, $body) { $c_commu_topic = db_commu_c_commu_topic4c_commu_topic_id($target_c_commu_topic_id); $target_c_commu_topic_id = $c_commu_topic['c_commu_topic_id']; $target_c_commu_id = $c_commu_topic['c_commu_id']; return db_commu_insert_c_commu_topic_comment($target_c_commu_id, $target_c_commu_topic_id, $c_member_id, $body); }