Changeset 17360
- Timestamp:
- 2008/06/18 21:35:45 (16 years ago)
- Location:
- branches/comu-ver2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/Smarty/templates/default/products/detail_image.tpl
r17336 r17360 22 22 <!--{include file="`$smarty.const.TEMPLATE_DIR`popup_header.tpl" subtitle="拡大画像"}--> 23 23 24 <!--{if $tpl_ width > 300}-->24 <!--{if $tpl_image_key == 'main_large_image'}--> 25 25 <!--{assign var=id value=bigimage}--> 26 26 <!--{else}--> -
branches/comu-ver2/data/class/SC_Image.php
r16680 r17360 29 29 function SC_Image($tmp_dir) { 30 30 // ヘッダファイル読込 31 if (!ereg("/$", $tmp_dir)) {31 if (!ereg("/$", $tmp_dir)) { 32 32 $this->tmp_dir = $tmp_dir . "/"; 33 33 } else { … … 52 52 $from_path = $this->tmp_dir.$filename; 53 53 $to_path = $save_dir."/".$filename; 54 if (file_exists($from_path) && file_exists($save_dir)) {55 if (copy($from_path , $to_path)) {54 if (file_exists($from_path) && file_exists($save_dir)) { 55 if (copy($from_path , $to_path)) { 56 56 unlink($from_path); 57 57 } … … 63 63 //---- 指定ファイルを削除 64 64 function deleteImage($filename, $dir) { 65 if (file_exists($dir."/".$filename)) {65 if (file_exists($dir."/".$filename)) { 66 66 unlink($dir."/".$filename); 67 67 } … … 88 88 $PreWord = $head; 89 89 90 91 92 93 94 90 //拡張子取得 91 if (!$ext) { 92 $array_ext = explode(".", $FromImgPath); 93 $ext = $array_ext[count($array_ext) - 1]; 94 } 95 95 96 96 $MW = $ThmMaxWidth; 97 if ($tmpMW) $MW = $tmpMW; // $MWに最大横幅セット97 if ($tmpMW) $MW = $tmpMW; // $MWに最大横幅セット 98 98 99 99 $MH = $ThmMaxHeight; 100 if ($tmpMH) $MH = $tmpMH; // $MHに最大縦幅セット101 102 if (empty($FromImgPath) || empty($ToImgPath)){100 if ($tmpMH) $MH = $tmpMH; // $MHに最大縦幅セット 101 102 if (empty($FromImgPath) || empty($ToImgPath)){ 103 103 return array(0,"出力元画像パス、または出力先フォルダが指定されていません。"); 104 104 } 105 105 106 if (!file_exists($FromImgPath)){106 if (!file_exists($FromImgPath)){ 107 107 return array(0,"出力元画像が見つかりません。"); 108 108 } … … 111 111 $re_size = $size; 112 112 113 if (!$size[2] || $size[2] > 3){ // 画像の種類が不明 or swf113 if (!$size[2] || $size[2] > 3){ // 画像の種類が不明 or swf 114 114 return array(0,"画像形式がサポートされていません。"); 115 115 } … … 118 118 $tmp_w = $size[0] / $MW; 119 119 120 if ($MH != 0){120 if ($MH != 0){ 121 121 $tmp_h = $size[1] / $MH; 122 122 } 123 123 124 if ($tmp_w > 1 || $tmp_h > 1){125 if ($MH == 0){126 if ($tmp_w > 1){124 if ($tmp_w > 1 || $tmp_h > 1){ 125 if ($MH == 0){ 126 if ($tmp_w > 1){ 127 127 $re_size[0] = $MW; 128 128 $re_size[1] = $size[1] * $MW / $size[0]; 129 129 } 130 130 } else { 131 if ($tmp_w > $tmp_h){131 if ($tmp_w > $tmp_h){ 132 132 $re_size[0] = $MW; 133 133 $re_size[1] = $size[1] * $MW / $size[0]; … … 148 148 switch($size[2]) { 149 149 case "1": //gif形式 150 if ($tmp_w <= 1 && $tmp_h <= 1){151 if ( $newFileName) {150 if ($tmp_w <= 1 && $tmp_h <= 1){ 151 if ($newFileName) { 152 152 $ToFile = $newFileName; 153 153 } elseif ($ext) { … … 156 156 $ToFile .= ".gif"; 157 157 } 158 if (!@copy($FromImgPath , $ToImgPath.$ToFile)) { // エラー処理158 if (!@copy($FromImgPath , $ToImgPath.$ToFile)) { // エラー処理 159 159 return array(0,"ファイルのコピーに失敗しました。"); 160 160 } … … 169 169 ImageRectangle ($ImgNew,0,0,($re_size[0]-1),($re_size[1]-1), $black); 170 170 171 if ( $newFileName) {171 if ($newFileName) { 172 172 $ToFile = $newFileName; 173 } elseif ($ext) {173 } elseif ($ext) { 174 174 $ToFile .= "." . $ext; 175 175 } else { … … 178 178 $TmpPath = $ToImgPath.$ToFile; 179 179 @Imagepng($ImgNew,$TmpPath); 180 if (!@file_exists($TmpPath)){ // 画像が作成されていない場合180 if (!@file_exists($TmpPath)){ // 画像が作成されていない場合 181 181 return array(0,"画像の出力に失敗しました。"); 182 182 } … … 188 188 //ImageCopyResized( $ImgNew,$ImgDefault, 0, 0, 0, 0,$re_size[0], $re_size[1],$size[0], $size[1]); 189 189 190 if ($re_size[0] != $size[0] || $re_size[0] != $size[0]) {190 if ($re_size[0] != $size[0] || $re_size[0] != $size[0]) { 191 191 ImageCopyResampled( $ImgNew,$ImgDefault, 0, 0, 0, 0,$re_size[0], $re_size[1],$size[0], $size[1]); 192 192 } … … 197 197 198 198 199 if ( $newFileName) {199 if ($newFileName) { 200 200 $ToFile = $newFileName; 201 } elseif ($ext) {201 } elseif ($ext) { 202 202 $ToFile .= "." . $ext; 203 203 } else { … … 206 206 $TmpPath = $ToImgPath.$ToFile; 207 207 @ImageJpeg($ImgNew,$TmpPath); 208 if (!@file_exists($TmpPath)){ // 画像が作成されていない場合208 if (!@file_exists($TmpPath)){ // 画像が作成されていない場合 209 209 return array(0,"画像の出力に失敗しました。<br>${ImgNew}<br>${TmpPath}"); 210 210 } … … 217 217 ImageCopyResampled($ImgNew, $ImgDefault, 0, 0, 0, 0,$re_size[0], $re_size[1],$size[0], $size[1]); 218 218 219 if ( $newFileName) {219 if ($newFileName) { 220 220 $ToFile = $newFileName; 221 221 } elseif ($ext) { … … 226 226 $TmpPath = $ToImgPath.$ToFile; 227 227 @ImagePNG($ImgNew,$TmpPath ); 228 if (!@file_exists($TmpPath)){ // 画像が作成されていない場合228 if (!@file_exists($TmpPath)){ // 画像が作成されていない場合 229 229 return array(0,"画像の出力に失敗しました。"); 230 230 } -
branches/comu-ver2/data/class/pages/products/LC_Page_Products_DetailImage.php
r16582 r17360 58 58 59 59 // 管理ページからの確認の場合は、非公開の商品も表示する。 60 if (isset($_GET['admim']) && $_GET['admin'] == 'on') {60 if (isset($_GET['admim']) && $_GET['admin'] == 'on') { 61 61 $where = "del_flg = 0"; 62 62 } else { … … 65 65 66 66 // 値の正当性チェック 67 if (!SC_Utils_Ex::sfIsInt($_GET['product_id']) || !$objDb->sfIsRecord("dtb_products", "product_id", $_GET['product_id'], $where)) {67 if (!SC_Utils_Ex::sfIsInt($_GET['product_id']) || !$objDb->sfIsRecord("dtb_products", "product_id", $_GET['product_id'], $where)) { 68 68 SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND); 69 69 } … … 75 75 $col = "name, $image_key"; 76 76 $arrRet = $objQuery->select($col, "dtb_products", "product_id = ?", array($_GET['product_id'])); 77 78 79 if(file_exists($image_path)) {80 81 82 83 84 85 86 87 77 $image_path = IMAGE_SAVE_DIR . $arrRet[0][$image_key]; 78 79 if (file_exists($image_path)) { 80 list($width, $height) = getimagesize($image_path); 81 } else { 82 $width = 0; 83 $height = 0; 84 } 85 86 $this->tpl_width = $width; 87 $this->tpl_height = $height; 88 88 $this->tpl_table_width = $this->tpl_width + 20; 89 89 $this->tpl_table_height = $this->tpl_height + 20; … … 91 91 $this->tpl_image = $arrRet[0][$image_key]; 92 92 $this->tpl_name = $arrRet[0]['name']; 93 $this->tpl_image_key = $image_key; 93 94 94 95 $objView->assignobj($this); -
branches/comu-ver2/html/user_data/packages/default/css/window.css
r16708 r17360 1 1 @charset "utf-8"; 2 2 3 4 /* 商品詳細拡大写真 3 /* ポップアップウィンドウ 5 4 ----------------------------------------------- */ 6 div#bigimage { 7 width: 520px; 8 margin: 15px auto 0 auto; 9 background-color: #ffffff; 5 div#windowcolumn { 6 margin: 15px 15px 0 15px; 7 background-color: #fff; 8 border-top: 5px solid #ffa85c; 9 border-bottom: 5px solid #ffa85c; 10 10 } 11 11 12 div#bigimage img { 13 padding: 10px; 12 /* 商品詳細拡大写真、カート拡大写真 13 ----------------------------------------------- */ 14 div#bigimage, 15 div#cartimage { 16 margin-top: 15px; 14 17 background-color: #ffffff; 18 text-align: center; 15 19 } 16 20 17 18 /* カート拡大写真 19 ----------------------------------------------- */ 20 div#cartimage { 21 width: 280px; 22 margin: 15px auto 0 auto; 23 background-color: #ffffff; 24 } 25 21 div#bigimage img, 26 22 div#cartimage img { 27 23 padding: 10px; … … 29 25 } 30 26 31 32 /* お客様の声の書き込み・新しいお届け先の追加・変更 27 /* お客様の声の書き込み、新しいお届け先の追加・変更 33 28 ----------------------------------------------- */ 34 div#windowcolumn {35 width: 550px;36 margin: 15px auto 0 auto;37 background-color: #fff;38 border-top: 5px solid #ffa85c;39 border-bottom: 5px solid #ffa85c;40 }41 42 29 div#windowcolumn h2 { 43 width: 500px;44 30 margin: 0 0 15px 0; 45 31 }
Note: See TracChangeset
for help on using the changeset viewer.