1 | <?php |
---|
2 | /** |
---|
3 | * @copyright 2005-2006 OpenPNE Project |
---|
4 | * @license http://www.php.net/license/3_01.txt PHP License 3.01 |
---|
5 | */ |
---|
6 | |
---|
7 | /** |
---|
8 | * 日記を書く |
---|
9 | */ |
---|
10 | class pc_do_h_diary_add_insert_c_diary extends OpenPNE_Action |
---|
11 | { |
---|
12 | function handleError($errors) |
---|
13 | { |
---|
14 | $_REQUEST['msg1'] = $errors['subject']; |
---|
15 | $_REQUEST['msg2'] = $errors['body']; |
---|
16 | $_REQUEST['msg3'] = $errors['public_flag']; |
---|
17 | openpne_forward('pc', 'page', 'h_diary_add', $errors); |
---|
18 | exit; |
---|
19 | } |
---|
20 | |
---|
21 | function execute($requests) |
---|
22 | { |
---|
23 | $u = $GLOBALS['AUTH']->uid(); |
---|
24 | |
---|
25 | // --- リクエスト変数 |
---|
26 | $subject = $requests['subject']; |
---|
27 | $body = $requests['body']; |
---|
28 | $public_flag = $requests['public_flag']; |
---|
29 | $tmpfile_1 = $requests['tmpfile_1']; |
---|
30 | $tmpfile_2 = $requests['tmpfile_2']; |
---|
31 | $tmpfile_3 = $requests['tmpfile_3']; |
---|
32 | // ---------- |
---|
33 | |
---|
34 | $sessid = session_id(); |
---|
35 | $c_member_id = $u; |
---|
36 | |
---|
37 | $c_diary_id = db_diary_insert_c_diary($c_member_id, $subject, $body, $public_flag); |
---|
38 | |
---|
39 | $filename_1 = image_insert_c_image4tmp("d_{$c_diary_id}_1", $tmpfile_1); |
---|
40 | $filename_2 = image_insert_c_image4tmp("d_{$c_diary_id}_2", $tmpfile_2); |
---|
41 | $filename_3 = image_insert_c_image4tmp("d_{$c_diary_id}_3", $tmpfile_3); |
---|
42 | t_image_clear_tmp($sessid); |
---|
43 | |
---|
44 | db_diary_update_c_diary($c_diary_id, $subject, $body, $public_flag, $filename_1, $filename_2, $filename_3); |
---|
45 | |
---|
46 | pne_cache_drop('db_diary_get_c_diary_list4c_member_id', $u, 5); |
---|
47 | |
---|
48 | $p = array('target_c_diary_id' => $c_diary_id); |
---|
49 | openpne_redirect('pc', 'page_fh_diary', $p); |
---|
50 | } |
---|
51 | } |
---|
52 | |
---|
53 | ?> |
---|