Changeset 17360


Ignore:
Timestamp:
2008/06/18 21:35:45 (16 years ago)
Author:
Seasoft
Message:

小さい拡大画像で乱れるのを回避。id属性の決定方法を変更。

Location:
branches/comu-ver2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/Smarty/templates/default/products/detail_image.tpl

    r17336 r17360  
    2222<!--{include file="`$smarty.const.TEMPLATE_DIR`popup_header.tpl" subtitle="拡大画像"}--> 
    2323 
    24 <!--{if $tpl_width > 300}--> 
     24<!--{if $tpl_image_key == 'main_large_image'}--> 
    2525  <!--{assign var=id value=bigimage}--> 
    2626<!--{else}--> 
  • branches/comu-ver2/data/class/SC_Image.php

    r16680 r17360  
    2929    function SC_Image($tmp_dir) { 
    3030        // ヘッダファイル読込 
    31         if(!ereg("/$", $tmp_dir)) { 
     31        if (!ereg("/$", $tmp_dir)) { 
    3232            $this->tmp_dir = $tmp_dir . "/"; 
    3333        } else { 
     
    5252        $from_path = $this->tmp_dir.$filename; 
    5353        $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)) { 
    5656                unlink($from_path); 
    5757            } 
     
    6363    //---- 指定ファイルを削除 
    6464    function deleteImage($filename, $dir) { 
    65         if(file_exists($dir."/".$filename)) { 
     65        if (file_exists($dir."/".$filename)) { 
    6666            unlink($dir."/".$filename); 
    6767        } 
     
    8888        $PreWord = $head; 
    8989 
    90             //拡張子取得 
    91             if (!$ext) { 
    92                 $array_ext = explode(".", $FromImgPath); 
    93                 $ext = $array_ext[count($array_ext) - 1]; 
    94             } 
     90        //拡張子取得 
     91        if (!$ext) { 
     92            $array_ext = explode(".", $FromImgPath); 
     93            $ext = $array_ext[count($array_ext) - 1]; 
     94        } 
    9595 
    9696        $MW = $ThmMaxWidth; 
    97         if($tmpMW) $MW = $tmpMW; // $MWに最大横幅セット 
     97        if ($tmpMW) $MW = $tmpMW; // $MWに最大横幅セット 
    9898 
    9999        $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)){ 
    103103            return array(0,"出力元画像パス、または出力先フォルダが指定されていません。"); 
    104104        } 
    105105 
    106         if(!file_exists($FromImgPath)){ 
     106        if (!file_exists($FromImgPath)){ 
    107107            return array(0,"出力元画像が見つかりません。"); 
    108108        } 
     
    111111        $re_size = $size; 
    112112 
    113         if(!$size[2] || $size[2] > 3){ // 画像の種類が不明 or swf 
     113        if (!$size[2] || $size[2] > 3){ // 画像の種類が不明 or swf 
    114114            return array(0,"画像形式がサポートされていません。"); 
    115115        } 
     
    118118        $tmp_w = $size[0] / $MW; 
    119119 
    120         if($MH != 0){ 
     120        if ($MH != 0){ 
    121121            $tmp_h = $size[1] / $MH; 
    122122        } 
    123123 
    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){ 
    127127                    $re_size[0] = $MW; 
    128128                    $re_size[1] = $size[1] * $MW / $size[0]; 
    129129                } 
    130130            } else { 
    131                 if($tmp_w > $tmp_h){ 
     131                if ($tmp_w > $tmp_h){ 
    132132                    $re_size[0] = $MW; 
    133133                    $re_size[1] = $size[1] * $MW / $size[0]; 
     
    148148        switch($size[2]) { 
    149149        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) { 
    152152                    $ToFile = $newFileName; 
    153153                } elseif  ($ext) { 
     
    156156                    $ToFile .= ".gif"; 
    157157                } 
    158                 if(!@copy($FromImgPath , $ToImgPath.$ToFile)) { // エラー処理 
     158                if (!@copy($FromImgPath , $ToImgPath.$ToFile)) { // エラー処理 
    159159                    return array(0,"ファイルのコピーに失敗しました。"); 
    160160                } 
     
    169169            ImageRectangle ($ImgNew,0,0,($re_size[0]-1),($re_size[1]-1),    $black); 
    170170 
    171             if ( $newFileName ) { 
     171            if ($newFileName) { 
    172172                $ToFile = $newFileName; 
    173             } elseif($ext) { 
     173            } elseif ($ext) { 
    174174                $ToFile .= "." . $ext; 
    175175            } else { 
     
    178178            $TmpPath = $ToImgPath.$ToFile; 
    179179            @Imagepng($ImgNew,$TmpPath); 
    180             if(!@file_exists($TmpPath)){ // 画像が作成されていない場合 
     180            if (!@file_exists($TmpPath)){ // 画像が作成されていない場合 
    181181                return array(0,"画像の出力に失敗しました。"); 
    182182            } 
     
    188188            //ImageCopyResized( $ImgNew,$ImgDefault, 0, 0, 0, 0,$re_size[0], $re_size[1],$size[0], $size[1]); 
    189189 
    190             if($re_size[0] != $size[0] || $re_size[0] != $size[0]) { 
     190            if ($re_size[0] != $size[0] || $re_size[0] != $size[0]) { 
    191191                ImageCopyResampled( $ImgNew,$ImgDefault, 0, 0, 0, 0,$re_size[0], $re_size[1],$size[0], $size[1]); 
    192192            } 
     
    197197 
    198198 
    199             if ( $newFileName ) { 
     199            if ($newFileName) { 
    200200                $ToFile = $newFileName; 
    201             } elseif($ext) { 
     201            } elseif ($ext) { 
    202202                $ToFile .= "." . $ext; 
    203203            } else { 
     
    206206            $TmpPath = $ToImgPath.$ToFile; 
    207207            @ImageJpeg($ImgNew,$TmpPath); 
    208             if(!@file_exists($TmpPath)){ // 画像が作成されていない場合 
     208            if (!@file_exists($TmpPath)){ // 画像が作成されていない場合 
    209209                return array(0,"画像の出力に失敗しました。<br>${ImgNew}<br>${TmpPath}"); 
    210210            } 
     
    217217            ImageCopyResampled($ImgNew, $ImgDefault, 0, 0, 0, 0,$re_size[0], $re_size[1],$size[0], $size[1]); 
    218218 
    219             if ( $newFileName ) { 
     219            if ($newFileName) { 
    220220                $ToFile = $newFileName; 
    221221            } elseif ($ext) { 
     
    226226            $TmpPath = $ToImgPath.$ToFile; 
    227227            @ImagePNG($ImgNew,$TmpPath ); 
    228             if(!@file_exists($TmpPath)){ // 画像が作成されていない場合 
     228            if (!@file_exists($TmpPath)){ // 画像が作成されていない場合 
    229229                return array(0,"画像の出力に失敗しました。"); 
    230230            } 
  • branches/comu-ver2/data/class/pages/products/LC_Page_Products_DetailImage.php

    r16582 r17360  
    5858 
    5959        // 管理ページからの確認の場合は、非公開の商品も表示する。 
    60         if(isset($_GET['admim']) && $_GET['admin'] == 'on') { 
     60        if (isset($_GET['admim']) && $_GET['admin'] == 'on') { 
    6161            $where = "del_flg = 0"; 
    6262        } else { 
     
    6565 
    6666        // 値の正当性チェック 
    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)) { 
    6868            SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND); 
    6969        } 
     
    7575        $col = "name, $image_key"; 
    7676        $arrRet = $objQuery->select($col, "dtb_products", "product_id = ?", array($_GET['product_id'])); 
    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; 
     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; 
    8888        $this->tpl_table_width = $this->tpl_width + 20; 
    8989        $this->tpl_table_height = $this->tpl_height + 20; 
     
    9191        $this->tpl_image = $arrRet[0][$image_key]; 
    9292        $this->tpl_name = $arrRet[0]['name']; 
     93        $this->tpl_image_key = $image_key; 
    9394 
    9495        $objView->assignobj($this); 
  • branches/comu-ver2/html/user_data/packages/default/css/window.css

    r16708 r17360  
    11@charset "utf-8"; 
    22 
    3  
    4 /* 商品詳細拡大写真 
     3/* ポップアップウィンドウ 
    54----------------------------------------------- */ 
    6 div#bigimage { 
    7     width: 520px; 
    8     margin: 15px auto 0 auto; 
    9     background-color: #ffffff; 
     5div#windowcolumn { 
     6    margin: 15px 15px 0 15px; 
     7    background-color: #fff; 
     8    border-top: 5px solid #ffa85c; 
     9    border-bottom: 5px solid #ffa85c; 
    1010} 
    1111 
    12 div#bigimage img { 
    13     padding: 10px; 
     12/* 商品詳細拡大写真、カート拡大写真 
     13----------------------------------------------- */ 
     14div#bigimage, 
     15div#cartimage { 
     16    margin-top: 15px; 
    1417    background-color: #ffffff; 
     18    text-align: center; 
    1519} 
    1620 
    17  
    18 /* カート拡大写真 
    19 ----------------------------------------------- */ 
    20 div#cartimage { 
    21     width: 280px; 
    22     margin: 15px auto 0 auto; 
    23     background-color: #ffffff; 
    24 } 
    25  
     21div#bigimage img, 
    2622div#cartimage img { 
    2723    padding: 10px; 
     
    2925} 
    3026 
    31  
    32 /* お客様の声の書き込み・新しいお届け先の追加・変更 
     27/* お客様の声の書き込み、新しいお届け先の追加・変更 
    3328----------------------------------------------- */ 
    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  
    4229div#windowcolumn h2 { 
    43     width: 500px; 
    4430    margin: 0 0 15px 0; 
    4531} 
Note: See TracChangeset for help on using the changeset viewer.