Tag Archive for 'ECShop'

Ecshop上传商品图片模糊 缩略图不清晰修正方法

Posted on 2009-06-07 in 网页制作Comments

Ecshop上传商品图片默认生成jpg缩略图或商品图的质量是80,这些图片看起来有点模糊,有些时候不够满意,现提供调整生成jpg图片的质量,解决Ecshop商品缩略图不清晰的方法

找到includes/cls_image.php,在大约250行左右

       /* 生成文件 */
       if (function_exists(‘imagejpeg’))
       {
         $filename .= ‘.jpg’;
         imagejpeg($img_thumb, $dir . $filename);
       }

改为

       /* 生成文件 */
       if (function_exists(‘imagejpeg’))
       {
         $filename .= ‘.jpg’;
         imagejpeg($img_thumb, $dir . $filename, 95);
       }

这样应该足够清晰了,这里允许0-100的范围,不写默认是80的质量。

这样图像质量有所提高,但和原图还是不一样

还要修改admin/goods.php

613行:原:

        // 如果系统支持GD,缩放商品图片,且给商品图片和相册图片加水印
        if ($proc_thumb && $image->gd_version() > 0 && $image->check_img_function($_FILES['goods_img']['type']))
        {
            // 如果设置大小不为0,缩放图片
            if ($_CFG['image_width'] != 0 || $_CFG['image_height'] != 0)
            {
                $goods_img = $image->make_thumb(‘../’. $goods_img , $GLOBALS['_CFG']['image_width'],  $GLOBALS['_CFG']['image_height']);
                if ($goods_img === false)
                {
                    sys_msg($image->error_msg(), 1, array(), false);
                }
            }

改为:

// 如果系统支持GD,缩放商品图片,且给商品图片和相册图片加水印
        if ($image->gd_version() > 0 && $image->check_img_function($_FILES['goods_img']['type']) &&$_FILES['goods_img']['width'] > $GLOBALS['_CFG']['image_width'] &&$_FILES['goods_img']['height'] > $GLOBALS['_CFG']['image_height'])
        {
            // 如果设置大小不为0,缩放图片
            if ($_CFG['image_width'] != 0 || $_CFG['image_height'] != 0)
            {
                $goods_img = $image->make_thumb(‘../’. $goods_img , $GLOBALS['_CFG']['image_width'], $GLOBALS['_CFG']['image_height']);
                if ($goods_img === false)
                {
                    sys_msg($image->error_msg(), 1, array(), false);
                }
            }

这样只要你上传的图片长宽和你在后台,系统设置-》商店设置-》显示设置:商品图片宽度,高度一样,图像质量就不会变化了。

Ecshop上传商品图片生成的缩略图模糊终于圆满解决,开心ing^_^

修改ECShop首页缩略图大小的方法

Posted on 2009-01-21 in 电子商务Comments

今天自己想把包包批发网首页缩略图改大点,在ECShop论坛搜索了一下,都没有找到,就自己在css里找了一下,现在把他分享出来,

在相应模版文件夹下的style.css里,找到

/*单个商品*/
       .goodsItem{width:110px; float:left; position:relative; overflow:hidden; margin:0px 14px 15px 14px;}
       .goodsItem .goodsimg{width:100px; height:100px; border:4px solid #eef8ff; margin-bottom:4px;}
       .goodsItem img{width:52px; height:17px;}
       .goodsItem p{text-align:left; color:#3f3f3f;}
       .goodsItem p a{color:#3f3f3f; text-decoration:none;}
       .goodsItem p a:hover{color:#ff6600; text-decoration:none;}
       .goodsItem span{width:40px; height:40px; position:absolute;left:0px; top:0px;}
       .goodsItem span.best{background:url(images/bg.gif) no-repeat 0px -304px;}
       .goodsItem span.news{background:url(images/bg.gif) no-repeat -75px -304px;}
       .goodsItem span.hot{background:url(images/bg.gif) no-repeat -161px -304px;}

红色地方是要修改的,改好后,自己再到模版设置中设一下商品的显示数量
 

去掉ECShop首页跟频道标题间的”- Powered by ECShop”

Posted on 2009-01-19 in 电子商务Comments

在includes/lib_main.php找到lib_main.php文件,用Dreamweaver打开.
把$page_title = $GLOBALS['_CFG']['shop_title'] . ‘ - ‘ . ‘Powered by ECShop‘;改为$page_title = $GLOBALS['_CFG']['shop_title'];

用记事本打开改的话会出错