1 | <?php |
---|
2 | /** |
---|
3 | * @copyright 2005-2007 OpenPNE Project |
---|
4 | * @license http://www.php.net/license/3_01.txt PHP License 3.01 |
---|
5 | */ |
---|
6 | |
---|
7 | class mail_sns |
---|
8 | { |
---|
9 | var $decoder; |
---|
10 | var $from; |
---|
11 | var $to; |
---|
12 | |
---|
13 | var $c_member_id; |
---|
14 | |
---|
15 | function mail_sns(&$decoder) |
---|
16 | { |
---|
17 | $this->decoder =& $decoder; |
---|
18 | $this->from = $decoder->get_from(); |
---|
19 | $this->to = $decoder->get_to(); |
---|
20 | |
---|
21 | $this->c_member_id = do_common_c_member_id4ktai_address($this->from); |
---|
22 | |
---|
23 | // メンバーIDが見つからない場合は、ローカルパートに二重引用符を付加してリトライ |
---|
24 | if (!$this->c_member_id) { |
---|
25 | list($local, $domain) = explode('@', $this->from, 2); |
---|
26 | $this->c_member_id = do_common_c_member_id4ktai_address('"' . $local . '"' . '@' . $domain); |
---|
27 | } |
---|
28 | } |
---|
29 | |
---|
30 | function main() |
---|
31 | { |
---|
32 | $matches = array(); |
---|
33 | list($from_user, $from_host) = explode('@', $this->from, 2); |
---|
34 | list($to_user, $to_host) = explode('@', $this->to, 2); |
---|
35 | |
---|
36 | // from_host が携帯ドメイン以外はエラー |
---|
37 | if (!is_ktai_mail_address($this->from)) { |
---|
38 | m_debug_log('mail_sns::main() from wrong host'); |
---|
39 | return false; |
---|
40 | } |
---|
41 | |
---|
42 | if (MAIL_ADDRESS_PREFIX) { |
---|
43 | if (strpos($to_user, MAIL_ADDRESS_PREFIX) === 0) { |
---|
44 | $to_user = substr($to_user, strlen(MAIL_ADDRESS_PREFIX)); |
---|
45 | } |
---|
46 | } |
---|
47 | |
---|
48 | if (!$this->c_member_id) { |
---|
49 | // 送信者がSNSメンバーでない場合 |
---|
50 | |
---|
51 | if (!IS_CLOSED_SNS) { |
---|
52 | // get 新規登録 |
---|
53 | if ($to_user == 'get') { |
---|
54 | // アフィリエイトIDが付いている場合 |
---|
55 | $body = $this->decoder->get_text_body(); |
---|
56 | |
---|
57 | m_debug_log('mail_sns::regist_get()', PEAR_LOG_INFO); |
---|
58 | return $this->regist_get($body); |
---|
59 | } |
---|
60 | } |
---|
61 | |
---|
62 | m_debug_log('mail_sns::main() action not found'); |
---|
63 | return false; |
---|
64 | } |
---|
65 | |
---|
66 | // 送信者がログイン停止登録されているメンバーの場合 |
---|
67 | if (db_member_is_login_rejected($this->c_member_id)) { |
---|
68 | m_debug_log('mail_sns::main() mail from rejected member'); |
---|
69 | return false; |
---|
70 | } |
---|
71 | |
---|
72 | // 送信者がブラックリスト登録済みメンバーの場合 |
---|
73 | if (db_member_is_blacklist($this->c_member_id)) { |
---|
74 | m_debug_log('mail_sns::main() mail from member on blacklist'); |
---|
75 | return false; |
---|
76 | } |
---|
77 | |
---|
78 | //--- |
---|
79 | |
---|
80 | // ログインURL通知 |
---|
81 | if ($to_user == 'get') { |
---|
82 | m_debug_log('mail_sns::login_get()', PEAR_LOG_INFO); |
---|
83 | return $this->login_get(); |
---|
84 | } |
---|
85 | |
---|
86 | //--- |
---|
87 | |
---|
88 | // コミュニティ掲示板投稿 |
---|
89 | elseif ( |
---|
90 | preg_match('/^t(\d+)$/', $to_user, $matches) || |
---|
91 | preg_match('/^t(\d+)-([0-9a-f]{12})$/', $to_user, $matches) |
---|
92 | ) { |
---|
93 | |
---|
94 | // トピックIDのチェック |
---|
95 | if (!$c_commu_topic_id = $matches[1]) { |
---|
96 | return false; |
---|
97 | } |
---|
98 | |
---|
99 | if (MAIL_ADDRESS_HASHED) { |
---|
100 | if (empty($matches[2])) return false; |
---|
101 | |
---|
102 | // メンバーハッシュのチェック |
---|
103 | if ($matches[2] != t_get_user_hash($this->c_member_id)) { |
---|
104 | return false; |
---|
105 | } |
---|
106 | } |
---|
107 | |
---|
108 | m_debug_log('mail_sns::add_commu_topic_comment()', PEAR_LOG_INFO); |
---|
109 | return $this->add_commu_topic_comment($c_commu_topic_id); |
---|
110 | } |
---|
111 | |
---|
112 | //--- |
---|
113 | |
---|
114 | // 日記投稿 |
---|
115 | elseif ( |
---|
116 | $to_user == 'blog' || |
---|
117 | preg_match('/^b(\d+)-([0-9a-f]{12})$/', $to_user, $matches) |
---|
118 | ) { |
---|
119 | |
---|
120 | if (MAIL_ADDRESS_HASHED) { |
---|
121 | if (empty($matches[1]) || empty($matches[2])) return false; |
---|
122 | |
---|
123 | // メンバーIDのチェック |
---|
124 | if ($matches[1] != $this->c_member_id) { |
---|
125 | return false; |
---|
126 | } |
---|
127 | // メンバーハッシュのチェック |
---|
128 | if ($matches[2] != t_get_user_hash($this->c_member_id)) { |
---|
129 | return false; |
---|
130 | } |
---|
131 | } |
---|
132 | |
---|
133 | m_debug_log('mail_sns::add_diary()', PEAR_LOG_INFO); |
---|
134 | return $this->add_diary(); |
---|
135 | } |
---|
136 | |
---|
137 | //--- |
---|
138 | |
---|
139 | //プロフィール写真変更 |
---|
140 | elseif ( |
---|
141 | preg_match('/^p(\d+)$/', $to_user, $matches) || |
---|
142 | preg_match('/^p(\d+)-([0-9a-f]{12})$/', $to_user, $matches) |
---|
143 | ) { |
---|
144 | |
---|
145 | // メンバーIDのチェック |
---|
146 | if ($matches[1] != $this->c_member_id) { |
---|
147 | return false; |
---|
148 | } |
---|
149 | |
---|
150 | if (MAIL_ADDRESS_HASHED) { |
---|
151 | if (empty($matches[2])) return false; |
---|
152 | |
---|
153 | // メンバーハッシュのチェック |
---|
154 | if ($matches[2] != t_get_user_hash($this->c_member_id)) { |
---|
155 | return false; |
---|
156 | } |
---|
157 | } |
---|
158 | |
---|
159 | m_debug_log('mail_sns::add_member_image()', PEAR_LOG_INFO); |
---|
160 | return $this->add_member_image(); |
---|
161 | } |
---|
162 | |
---|
163 | //--- |
---|
164 | |
---|
165 | // 日記写真変更 |
---|
166 | elseif ( |
---|
167 | preg_match('/^bi(\d+)$/', $to_user, $matches) || |
---|
168 | preg_match('/^bi(\d+)-([0-9a-f]{12})$/', $to_user, $matches) |
---|
169 | ) { |
---|
170 | // 日記IDのチェック |
---|
171 | if (!$c_diary_id = $matches[1]) { |
---|
172 | return false; |
---|
173 | } |
---|
174 | |
---|
175 | if (MAIL_ADDRESS_HASHED) { |
---|
176 | if (empty($matches[2])) return false; |
---|
177 | |
---|
178 | // メンバーハッシュのチェック |
---|
179 | if ($matches[2] != t_get_user_hash($this->c_member_id)) { |
---|
180 | return false; |
---|
181 | } |
---|
182 | } |
---|
183 | |
---|
184 | m_debug_log('mail_sns::add_diary_image()', PEAR_LOG_INFO); |
---|
185 | return $this->add_diary_image($c_diary_id); |
---|
186 | } |
---|
187 | |
---|
188 | //--- |
---|
189 | |
---|
190 | // コミュニティ写真変更 |
---|
191 | elseif ( |
---|
192 | preg_match('/^ci(\d+)$/', $to_user, $matches) || |
---|
193 | preg_match('/^ci(\d+)-([0-9a-f]{12})$/', $to_user, $matches) |
---|
194 | ) { |
---|
195 | // コミュニティIDのチェック |
---|
196 | if (!$c_commu_id = $matches[1]) { |
---|
197 | return false; |
---|
198 | } |
---|
199 | |
---|
200 | if (MAIL_ADDRESS_HASHED) { |
---|
201 | if (empty($matches[2])) return false; |
---|
202 | |
---|
203 | // メンバーハッシュのチェック |
---|
204 | if ($matches[2] != t_get_user_hash($this->c_member_id)) { |
---|
205 | return false; |
---|
206 | } |
---|
207 | } |
---|
208 | |
---|
209 | m_debug_log('mail_sns::add_commu_image()', PEAR_LOG_INFO); |
---|
210 | return $this->add_commu_image($c_commu_id); |
---|
211 | } |
---|
212 | |
---|
213 | //--- |
---|
214 | |
---|
215 | // トピック・イベント写真変更 |
---|
216 | elseif ( |
---|
217 | preg_match('/^ti(\d+)$/', $to_user, $matches) || |
---|
218 | preg_match('/^ti(\d+)-([0-9a-f]{12})$/', $to_user, $matches) |
---|
219 | ) { |
---|
220 | // トピックIDのチェック |
---|
221 | if (!$c_commu_topic_id = $matches[1]) { |
---|
222 | return false; |
---|
223 | } |
---|
224 | |
---|
225 | if (MAIL_ADDRESS_HASHED) { |
---|
226 | if (empty($matches[2])) return false; |
---|
227 | |
---|
228 | // メンバーハッシュのチェック |
---|
229 | if ($matches[2] != t_get_user_hash($this->c_member_id)) { |
---|
230 | return false; |
---|
231 | } |
---|
232 | } |
---|
233 | |
---|
234 | m_debug_log('mail_sns::add_topic_image()', PEAR_LOG_INFO); |
---|
235 | return $this->add_topic_image($c_commu_topic_id); |
---|
236 | } |
---|
237 | |
---|
238 | m_debug_log('mail_sns::main() action not found(member)'); |
---|
239 | return false; |
---|
240 | } |
---|
241 | |
---|
242 | /** |
---|
243 | * 新規登録のURL取得 |
---|
244 | */ |
---|
245 | function regist_get($aff_id) |
---|
246 | { |
---|
247 | // 招待者は c_member_id = 1 (固定) |
---|
248 | $c_member_id_invite = 1; |
---|
249 | |
---|
250 | // _pre に追加 |
---|
251 | $session = create_hash(); |
---|
252 | mail_insert_c_member_ktai_pre($session, $this->from, $c_member_id_invite); |
---|
253 | |
---|
254 | do_common_send_mail_regist_get($session, $this->from, $aff_id); |
---|
255 | return true; |
---|
256 | } |
---|
257 | |
---|
258 | /** |
---|
259 | * ログインページのURL取得 |
---|
260 | */ |
---|
261 | function login_get() |
---|
262 | { |
---|
263 | do_mail_sns_login_get_mail_send($this->c_member_id, $this->from); |
---|
264 | return true; |
---|
265 | } |
---|
266 | |
---|
267 | /** |
---|
268 | * コミュニティ掲示板投稿 |
---|
269 | */ |
---|
270 | function add_commu_topic_comment($c_commu_topic_id) |
---|
271 | { |
---|
272 | if (!$topic = mail_c_commu_topic4c_commu_topic_id($c_commu_topic_id)) { |
---|
273 | return false; |
---|
274 | } |
---|
275 | |
---|
276 | $c_commu_id = $topic['c_commu_id']; |
---|
277 | if (!_db_is_c_commu_member($c_commu_id, $this->c_member_id)) { |
---|
278 | $this->error_mail('コミュニティに参加していないため投稿できませんでした。'); |
---|
279 | m_debug_log('mail_sns::add_commu_topic_comment() not a member'); |
---|
280 | return false; |
---|
281 | } |
---|
282 | |
---|
283 | $images = $this->decoder->get_images(); |
---|
284 | if ($images === false) { |
---|
285 | $this->error_mail('画像は' . IMAGE_MAX_FILESIZE . 'KB以内のGIF・JPEG・PNGにしてください。'); |
---|
286 | return false; |
---|
287 | } |
---|
288 | |
---|
289 | $body = $this->decoder->get_text_body(); |
---|
290 | if ($body === '') { |
---|
291 | $this->error_mail('本文が空のため投稿できませんでした。'); |
---|
292 | m_debug_log('mail_sns::add_commu_topic_comment() body is empty'); |
---|
293 | return false; |
---|
294 | } |
---|
295 | |
---|
296 | // 書き込みをDBに追加 |
---|
297 | $ins_id = db_commu_insert_c_commu_topic_comment($c_commu_id, $topic['c_commu_topic_id'], $this->c_member_id, $body); |
---|
298 | |
---|
299 | // 写真登録 |
---|
300 | $image_num = 1; |
---|
301 | foreach ($images as $image) { |
---|
302 | $image_ext = $image['ext']; |
---|
303 | $image_data = $image['data']; |
---|
304 | $filename = 'tc_' . $ins_id . '_' . $image_num . '_' . time() . '.' . $image_ext; |
---|
305 | |
---|
306 | db_image_insert_c_image($filename, $image_data); |
---|
307 | mail_update_c_commu_topic_comment_image($ins_id, $filename, $image_num); |
---|
308 | $image_num++; |
---|
309 | if ($image_num > 3) { |
---|
310 | break; |
---|
311 | } |
---|
312 | } |
---|
313 | |
---|
314 | //お知らせメール送信(携帯へ) |
---|
315 | send_bbs_info_mail($ins_id, $this->c_member_id); |
---|
316 | //お知らせメール送信(PCへ) |
---|
317 | send_bbs_info_mail_pc($ins_id, $this->c_member_id); |
---|
318 | |
---|
319 | if (OPENPNE_USE_POINT_RANK) { |
---|
320 | //トピック・イベントにコメントした人にポイント付与 |
---|
321 | $point = db_action_get_point4c_action_id(11); |
---|
322 | db_point_add_point($this->c_member_id, $point); |
---|
323 | } |
---|
324 | |
---|
325 | return true; |
---|
326 | } |
---|
327 | |
---|
328 | /** |
---|
329 | * 日記投稿 |
---|
330 | */ |
---|
331 | function add_diary() |
---|
332 | { |
---|
333 | $subject = $this->decoder->get_subject(); |
---|
334 | $body = $this->decoder->get_text_body(); |
---|
335 | |
---|
336 | if ($subject === '') { |
---|
337 | $subject = '無題'; |
---|
338 | } |
---|
339 | if ($body === '') { |
---|
340 | $this->error_mail('本文が空のため投稿できませんでした'); |
---|
341 | m_debug_log('mail_sns::add_diary() body is empty'); |
---|
342 | return false; |
---|
343 | } |
---|
344 | |
---|
345 | $images = $this->decoder->get_images(); |
---|
346 | if ($images === false) { |
---|
347 | $this->error_mail('画像は' . IMAGE_MAX_FILESIZE . 'KB以内のGIF・JPEG・PNGにしてください。'); |
---|
348 | return false; |
---|
349 | } |
---|
350 | |
---|
351 | $c_member = db_common_c_member4c_member_id($this->c_member_id); |
---|
352 | if (!$ins_id = db_diary_insert_c_diary($this->c_member_id, $subject, $body, $c_member['public_flag_diary'])) { |
---|
353 | return false; |
---|
354 | } |
---|
355 | |
---|
356 | // 写真登録 |
---|
357 | $image_num = 1; |
---|
358 | foreach ($images as $image) { |
---|
359 | $image_ext = $image['ext']; |
---|
360 | $image_data = $image['data']; |
---|
361 | $filename = 'd_' . $ins_id . '_' . $image_num . '_' . time() . '.' . $image_ext; |
---|
362 | |
---|
363 | db_image_insert_c_image($filename, $image_data); |
---|
364 | db_diary_update_c_diary_image_filename($ins_id, $filename, $image_num); |
---|
365 | $image_num++; |
---|
366 | if ($image_num > 3) { |
---|
367 | break; |
---|
368 | } |
---|
369 | } |
---|
370 | |
---|
371 | if (OPENPNE_USE_POINT_RANK) { |
---|
372 | //日記を書いた人にポイント付与 |
---|
373 | $point = db_action_get_point4c_action_id(4); |
---|
374 | db_point_add_point($this->c_member_id, $point); |
---|
375 | } |
---|
376 | |
---|
377 | return true; |
---|
378 | } |
---|
379 | |
---|
380 | /** |
---|
381 | * プロフィール写真変更 |
---|
382 | */ |
---|
383 | function add_member_image() |
---|
384 | { |
---|
385 | $c_member = db_common_c_member4c_member_id($this->c_member_id); |
---|
386 | |
---|
387 | // 登録する写真番号(1-3)を決める |
---|
388 | $target_number = 0; |
---|
389 | if ($c_member['image_filename']) { |
---|
390 | if (!$c_member['image_filename_1']) { |
---|
391 | $target_number = 1; |
---|
392 | } elseif (!$c_member['image_filename_2']) { |
---|
393 | $target_number = 2; |
---|
394 | } elseif (!$c_member['image_filename_3']) { |
---|
395 | $target_number = 3; |
---|
396 | } else { |
---|
397 | $this->error_mail('プロフィール写真の登録は最大3枚までです。'); |
---|
398 | m_debug_log('mail_sns::add_diary() image is full'); |
---|
399 | return false; |
---|
400 | } |
---|
401 | } else { |
---|
402 | $target_number = 1; |
---|
403 | } |
---|
404 | |
---|
405 | // 写真登録 |
---|
406 | if ($images = $this->decoder->get_images()) { |
---|
407 | $image = $images[0]; |
---|
408 | $image_ext = $image['ext']; |
---|
409 | $image_data = $image['data']; |
---|
410 | $filename = 'm_' . $this->c_member_id . '_' . time() . '.' . $image_ext; |
---|
411 | |
---|
412 | db_image_insert_c_image($filename, $image_data); |
---|
413 | mail_update_c_member_image($this->c_member_id, $filename, $target_number); |
---|
414 | return true; |
---|
415 | } else { |
---|
416 | $this->error_mail('写真が添付されていないか、ファイルサイズが大きすぎるため、登録できませんでした。'); |
---|
417 | m_debug_log('mail_sns::add_member_image() no images'); |
---|
418 | return false; |
---|
419 | } |
---|
420 | } |
---|
421 | |
---|
422 | /** |
---|
423 | * 日記写真変更 |
---|
424 | */ |
---|
425 | function add_diary_image($c_diary_id) |
---|
426 | { |
---|
427 | if (!$c_diary = db_diary_get_c_diary4id($c_diary_id)) { |
---|
428 | return false; |
---|
429 | } |
---|
430 | |
---|
431 | if ($c_diary['c_member_id'] != $this->c_member_id) { |
---|
432 | return false; |
---|
433 | } |
---|
434 | |
---|
435 | // 登録する写真番号(1-3)を決める |
---|
436 | $target_number = 0; |
---|
437 | if ($c_diary['image_filename_1'] || $c_diary['image_filename_2'] || $c_diary['image_filename_3']) { |
---|
438 | if (!$c_diary['image_filename_1']) { |
---|
439 | $target_number = 1; |
---|
440 | } elseif (!$c_diary['image_filename_2']) { |
---|
441 | $target_number = 2; |
---|
442 | } elseif (!$c_diary['image_filename_3']) { |
---|
443 | $target_number = 3; |
---|
444 | } else { |
---|
445 | $this->error_mail('日記写真の登録は最大3枚までです。'); |
---|
446 | m_debug_log('mail_sns::add_diary_image() image is full'); |
---|
447 | return false; |
---|
448 | } |
---|
449 | } else { |
---|
450 | $target_number = 1; |
---|
451 | } |
---|
452 | |
---|
453 | // 写真登録 |
---|
454 | if ($images = $this->decoder->get_images()) { |
---|
455 | $image = $images[0]; |
---|
456 | $image_ext = $image['ext']; |
---|
457 | $image_data = $image['data']; |
---|
458 | $filename = 'd_' . $c_diary_id . '_' . $target_number . '_' . time() . '.' . $image_ext; |
---|
459 | db_image_insert_c_image($filename, $image_data); |
---|
460 | db_diary_update_c_diary_image_filename($c_diary_id, $filename, $target_number); |
---|
461 | return true; |
---|
462 | } else { |
---|
463 | $this->error_mail('写真が添付されていないか、ファイルサイズが大きすぎるため、登録できませんでした。'); |
---|
464 | m_debug_log('mail_sns::add_diary_image() no images'); |
---|
465 | return false; |
---|
466 | } |
---|
467 | } |
---|
468 | |
---|
469 | /** |
---|
470 | * コミュニティ写真変更 |
---|
471 | */ |
---|
472 | function add_commu_image($c_commu_id) |
---|
473 | { |
---|
474 | if (!$c_commu = db_commu_c_commu4c_commu_id($c_commu_id)) { |
---|
475 | return false; |
---|
476 | } |
---|
477 | |
---|
478 | if ($c_commu['c_member_id_admin'] != $this->c_member_id && $c_commu['c_member_id_sub_admin'] != $this->c_member_id ) { |
---|
479 | return false; |
---|
480 | } |
---|
481 | |
---|
482 | if ($c_commu['image_filename']) { |
---|
483 | $this->error_mail('コミュニティ写真の登録は最大1枚までです。'); |
---|
484 | m_debug_log('mail_sns::add_commu_image() image is full'); |
---|
485 | return false; |
---|
486 | } |
---|
487 | |
---|
488 | // 写真登録 |
---|
489 | if ($images = $this->decoder->get_images()) { |
---|
490 | $image = $images[0]; |
---|
491 | $image_ext = $image['ext']; |
---|
492 | $image_data = $image['data']; |
---|
493 | $filename = 'c_' . $c_commu_id . '_' . time() . '.' . $image_ext; |
---|
494 | db_image_insert_c_image($filename, $image_data); |
---|
495 | db_commu_update_c_commu_image_filename($c_commu_id, $filename); |
---|
496 | return true; |
---|
497 | } else { |
---|
498 | $this->error_mail('写真が添付されていないか、ファイルサイズが大きすぎるため、登録できませんでした。'); |
---|
499 | m_debug_log('mail_sns::add_commu_image() no images'); |
---|
500 | return false; |
---|
501 | } |
---|
502 | } |
---|
503 | |
---|
504 | /** |
---|
505 | * トピック・イベント写真変更 |
---|
506 | */ |
---|
507 | function add_topic_image($c_commu_topic_id) |
---|
508 | { |
---|
509 | if (!$c_topic = db_commu_c_topic4c_commu_topic_id($c_commu_topic_id)) { |
---|
510 | return false; |
---|
511 | } |
---|
512 | |
---|
513 | $c_commu_id = $c_topic['c_commu_id']; |
---|
514 | |
---|
515 | if (!db_commu_is_c_topic_admin($c_commu_topic_id, $this->c_member_id) && |
---|
516 | !db_commu_is_c_commu_admin($c_commu_id, $this->c_member_id)) { |
---|
517 | return false; |
---|
518 | } |
---|
519 | |
---|
520 | // 登録する写真番号(1-3)を決める |
---|
521 | $target_number = 0; |
---|
522 | if ($c_topic['image_filename1'] || $c_topic['image_filename2'] || $c_topic['image_filename3']) { |
---|
523 | if (!$c_topic['image_filename1']) { |
---|
524 | $target_number = 1; |
---|
525 | } elseif (!$c_topic['image_filename2']) { |
---|
526 | $target_number = 2; |
---|
527 | } elseif (!$c_topic['image_filename3']) { |
---|
528 | $target_number = 3; |
---|
529 | } else { |
---|
530 | $this->error_mail('トピック・イベント写真の登録は最大3枚までです。'); |
---|
531 | m_debug_log('mail_sns::add_topic_image() image is full'); |
---|
532 | return false; |
---|
533 | } |
---|
534 | } else { |
---|
535 | $target_number = 1; |
---|
536 | } |
---|
537 | |
---|
538 | // 写真登録 |
---|
539 | if ($images = $this->decoder->get_images()) { |
---|
540 | $image = $images[0]; |
---|
541 | $image_ext = $image['ext']; |
---|
542 | $image_data = $image['data']; |
---|
543 | $filename = 't_' . $c_commu_topic_id . '_' . $target_number . '_' . time() . '.' . $image_ext; |
---|
544 | |
---|
545 | $c_topic['image_filename' . $target_number] = $filename; |
---|
546 | db_image_insert_c_image($filename, $image_data); |
---|
547 | db_commu_update_c_commu_topic_comment_images($c_topic['c_commu_topic_comment_id'], $c_topic['image_filename1'], $c_topic['image_filename2'], $c_topic['image_filename3']); |
---|
548 | return true; |
---|
549 | } else { |
---|
550 | $this->error_mail('写真が添付されていないか、ファイルサイズが大きすぎるため、登録できませんでした。'); |
---|
551 | m_debug_log('mail_sns::add_topic_image() no images'); |
---|
552 | return false; |
---|
553 | } |
---|
554 | |
---|
555 | } |
---|
556 | |
---|
557 | /** |
---|
558 | * エラーメールをメール送信者へ返信 |
---|
559 | */ |
---|
560 | function error_mail($body) |
---|
561 | { |
---|
562 | $subject = '['.SNS_NAME.']メール投稿エラー'; |
---|
563 | t_send_email($this->from, $subject, $body); |
---|
564 | } |
---|
565 | } |
---|
566 | |
---|
567 | ?> |
---|