ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 8609


Ignore:
Timestamp:
Oct 8, 2008, 11:54:30 AM (12 years ago)
Author:
shingo
Message:

#3004:pc_do_c_event_edit_update_c_commu_topic・ pc_do_c_topic_edit_update_c_commu_topic の画像アップロード関数を共通化

Location:
OpenPNE/branches/stable-2.10.x/webapp
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/stable-2.10.x/webapp/lib/util/image.php

    r8606 r8609  
    312312 * @params array $upfile_obj
    313313 * @params string $prefix
    314  * @params int $uid
    315314 * @return string 画像ファイル名 | 失敗時false
    316315 */
    317 function image_insert_c_image_direct($upfile_obj, $prefix, $uid)
     316function image_insert_c_image_direct($upfile_obj, $prefix)
    318317{
    319318    if (!file_exists($upfile_obj['tmp_name'])) {
     
    328327        return false;
    329328    }
    330     $image_filename = image_insert_c_image4tmp($prefix . '_' . $uid, $tmpfile);
     329    $image_filename = image_insert_c_image4tmp($prefix, $tmpfile);
    331330    t_image_clear_tmp($sessid);
    332331
  • OpenPNE/branches/stable-2.10.x/webapp/modules/pc/do/c_edit_update_c_commu.php

    r8606 r8609  
    8989
    9090        //画像アップデート
    91         $image_filename = image_insert_c_image_direct($upfile_obj, 'c', $target_c_commu_id);
     91        $image_filename = image_insert_c_image_direct($upfile_obj, 'c_' . $target_c_commu_id);
    9292
    9393        if ($image_filename) {
  • OpenPNE/branches/stable-2.10.x/webapp/modules/pc/do/c_event_edit_update_c_commu_topic.php

    r8606 r8609  
    9090        }
    9191
    92         //画像コピー
    93         $sessid = session_id();
    94         t_image_clear_tmp($sessid);
    95         if (file_exists($upfile_obj1["tmp_name"])) {
    96             $tmpfile1 = t_image_save2tmp($upfile_obj1, $sessid, "t_1");
    97         }
    98         if (file_exists($upfile_obj2["tmp_name"])) {
    99             $tmpfile2 = t_image_save2tmp($upfile_obj2, $sessid, "t_2");
    100         }
    101         if (file_exists($upfile_obj3["tmp_name"])) {
    102             $tmpfile3 = t_image_save2tmp($upfile_obj3, $sessid, "t_3");
    103         }
    104 
    105         if ($tmpfile1) {
    106             $filename1 = image_insert_c_image4tmp("t_{$c_commu_topic_id}_1", $tmpfile1);
    107         }
    108         if ($tmpfile2) {
    109             $filename2 = image_insert_c_image4tmp("t_{$c_commu_topic_id}_2", $tmpfile2);
    110         }
    111         if ($tmpfile3) {
    112             $filename3 = image_insert_c_image4tmp("t_{$c_commu_topic_id}_3", $tmpfile3);
    113         }
    114         t_image_clear_tmp(session_id());
     92        // 画像アップデート
     93        $filename1 = image_insert_c_image_direct($upfile_obj1, "t_{$c_commu_topic_id}_1");
     94        $filename2 = image_insert_c_image_direct($upfile_obj2, "t_{$c_commu_topic_id}_2");
     95        $filename3 = image_insert_c_image_direct($upfile_obj3, "t_{$c_commu_topic_id}_3");
    11596
    11697        $update_c_commu_topic = array(
  • OpenPNE/branches/stable-2.10.x/webapp/modules/pc/do/c_topic_edit_update_c_commu_topic.php

    r5878 r8609  
    8282        }
    8383
    84         //画像コピー
     84        // 画像アップデート
     85        $filename1 = image_insert_c_image_direct($upfile_obj1, "t_{$c_commu_topic_id}_1");
     86        $filename2 = image_insert_c_image_direct($upfile_obj2, "t_{$c_commu_topic_id}_2");
     87        $filename3 = image_insert_c_image_direct($upfile_obj3, "t_{$c_commu_topic_id}_3");
     88
     89        //ファイルアップロード
    8590        $sessid = session_id();
    8691        t_image_clear_tmp($sessid);
    87         $tmpfile1 = t_image_save2tmp($upfile_obj1, $sessid, "t_1");
    88         $tmpfile2 = t_image_save2tmp($upfile_obj2, $sessid, "t_2");
    89         $tmpfile3 = t_image_save2tmp($upfile_obj3, $sessid, "t_3");
    9092        if (OPENPNE_USE_FILEUPLOAD) {
    9193            $tmpfile4 = t_file_save2tmp($upfile_obj4, $sessid, "t_4");
    92         }
    93 
    94         if ($tmpfile1) {
    95             $filename1 = image_insert_c_image4tmp("t_{$c_commu_topic_id}_1", $tmpfile1);
    96         }
    97         if ($tmpfile2) {
    98             $filename2 = image_insert_c_image4tmp("t_{$c_commu_topic_id}_2", $tmpfile2);
    99         }
    100         if ($tmpfile3) {
    101             $filename3 = image_insert_c_image4tmp("t_{$c_commu_topic_id}_3", $tmpfile3);
    10294        }
    10395        if ($tmpfile4) {
    10496            $filename4 = file_insert_c_file4tmp("t_{$c_commu_topic_id}_4", $tmpfile4, $upfile_obj4['name']);
    10597        }
    106         t_image_clear_tmp(session_id());
    10798        t_file_clear_tmp(session_id());
    108 
    10999
    110100        $update_c_commu_topic = array(
  • OpenPNE/branches/stable-2.10.x/webapp/modules/pc/do/h_config_image.php

    r8606 r8609  
    3939
    4040        //画像をDBに格納
    41         $image_filename = image_insert_c_image_direct($upfile_obj, 'm', $u);
     41        $image_filename = image_insert_c_image_direct($upfile_obj, 'm_' . $u);
    4242
    4343        if ($image_filename) {
Note: See TracChangeset for help on using the changeset viewer.