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

Ignore:
Timestamp:
May 5, 2008, 5:12:30 PM (12 years ago)
Author:
ogawa
Message:

merged stable-2.12.x

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/work/ogawa/renew_OpenPNE_Auth/webapp/modules/admin/do/insert_c_banner.php

    r4933 r6963  
    1010    function execute($requests)
    1111    {
    12         //c_banner insert
     12        $upfile_obj = $_FILES['upfile'];
     13        if (empty($upfile_obj) || $upfile_obj['error'] === UPLOAD_ERR_NO_FILE) {
     14            admin_client_redirect('insert_c_banner', '画像は必ず指定してください');
     15        }
     16
     17        if (!($image = t_check_image($upfile_obj))) {
     18            admin_client_redirect('insert_c_banner', '画像は' . IMAGE_MAX_FILESIZE . 'KB以内のGIF・JPEG・PNGにしてください');
     19        }
     20
    1321        $c_banner_id = db_admin_insert_c_banner($requests['a_href'], $requests['type'], $requests['nickname']);
    14         //c_banner insert
    1522
    16         //c_image delete && insert
    17         $ext = t_check_image_format($_FILES['upfile']);
    18         $c_banner['image_filename'] = "b_{$c_banner_id}_".time().".{$ext}";
    19         admin_insert_c_image($_FILES['upfile'], $c_banner['image_filename']);
    20         //c_image delete && insert
    21 
    22         //c_banner update
     23        $ext = t_check_image_format($upfile_obj);
     24        $c_banner['image_filename'] = sprintf('b_%d_%d.%s', $c_banner_id, time(), $ext);
     25        admin_insert_c_image($upfile_obj, $c_banner['image_filename']);
    2326        db_admin_update_c_banner($c_banner_id, $c_banner);
    24         //c_banner update
    2527
    2628        admin_client_redirect('edit_c_banner', 'バナーを追加しました');
Note: See TracChangeset for help on using the changeset viewer.