コード例 #1
0
     $uploadedimgsize = @getimagesize($image['tmp_name']);
     if ($uploadedimgsize[0] > $imglimit || $uploadedimgsize[0] > $imglimit) {
         $result = 'File is too big, max width/height allowed is ' . $imglimit . 'px';
     } else {
         $design->uploadImage($imgno, $image['tmp_name'], $image['name']);
         $result = webImage($design->{'image_' . $imgno}, $imgsize, $imgsize, $img_title, 'img-border');
     }
     echo utf8_encode($result);
     exit;
 } elseif ($_POST['me_action'] == 'DELETEIMAGE') {
     $imgfield = tep_db_prepare_input($_POST['imgfield']);
     $design = new design($id);
     $result = array();
     $result['id'] = $imgfield;
     if ($imgfield == 'image_1') {
         $design->removeImage('1', true);
         $result['img'] = webImage($design->image_1, $imgsize, $imgsize, 'Main Image', 'img-border', '');
     } elseif ($imgfield == 'image_2') {
         $design->removeImage('2', true);
         $result['img'] = webImage($design->image_2, $imgsize, $imgsize, 'Alternate Image', 'img-border', '');
     } elseif ($imgfield == 'image_3') {
         $design->removeImage('3', true);
         $result['img'] = webImage($design->image_3, $imgsize, $imgsize, 'Alternate Image', 'img-border', '');
     } elseif ($imgfield == 'image_4') {
         $design->removeImage('4', true);
         $result['img'] = webImage($design->image_4, $imgsize, $imgsize, 'Alternate Image', 'img-border', '');
     }
     echo ajaxReturn($result);
     exit;
 } elseif ($_POST['me_action'] == 'FLAGWATCHLIST') {
     $design->flagWatchlist($session_userinfo['id']);