請問 奪寶奇兵 如何將縮圖置換成大圖呢?

2016-07-07 16:23 来源:www.chinab4c.com 作者:ecshop专家

最近再改樣版碰到一個問題,特來請教高手!
奪寶奇兵 商品圖片 是秀 產品縮圖,想把他換成 大一點的圖,於是將 $goods.goods_thumb 改成 $goods.goods_img 結果,圖片找不到?修改的方式如下:
原始:
<img src="{$goods.goods_thumb}" alt="{$goods.goods_name|escape:html}" class="thumb" />
改成:
<img src="{$goods.goods_img}" alt="{$goods.goods_name|escape:html}" class="thumb" />

請高手指正!感謝了!

回答:
自己推喔!沒人知道嗎?這下頭暈了!

還是沒人喔!哀!這問題問的太差了嗎?真是太沒人緣了....

snatch.php页面中把
/**
* 取得当前活动信息
*
* @accesspublic
*
* @return 活动名称
*/
function get_snatch($id)
{
$sql = "SELECT g.goods_id, g.goods_sn, g.is_real, g.goods_name, g.extension_code, g.market_price, g.shop_price AS org_price, " .
"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, " .
"g.promote_price, g.promote_start_date, g.promote_end_date, g.goods_brief, g.goods_thumb, " .
"ga.act_name AS snatch_name, ga.start_time, ga.end_time, ga.ext_info, ga.act_desc AS `desc` ".
"FROM " .$GLOBALS['ecs']->table('goods_activity'). " AS ga " .
"LEFT JOIN " . $GLOBALS['ecs']->table('goods')." AS g " .
"ON g.goods_id = ga.goods_id " .
"LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp " .
"ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' " .
"WHERE ga.act_id = '$id' AND g.is_delete = 0";

$goods = $GLOBALS['db']->GetRow($sql);

if ($goods)
{
$promote_price = bargain_price($goods['promote_price'], $goods['promote_start_date'], $goods['promote_end_date']);
$goods['formated_market_price']= price_format($goods['market_price']);
$goods['formated_shop_price'] = price_format($goods['shop_price']);
$goods['formated_promote_price'] = ($promote_price > 0) ? price_format($promote_price) : '';
$goods['goods_thumb']= get_image_path($goods['goods_id'], $goods['goods_thumb'], true);
$goods['url']= build_uri('goods', array('gid'=>$goods['goods_id']), $goods['goods_name']);
$goods['start_time'] = local_date($GLOBALS['_CFG']['time_format'], $goods['start_time']);

$info = unserialize($goods['ext_info']);
if ($info)
{
foreach ($info as $key => $val)
{
$goods[$key] = $val;
}
$goods['is_end'] = gmtime() > $goods['end_time'];
$goods['formated_start_price'] = price_format($goods['start_price']);
$goods['formated_end_price'] = price_format($goods['end_price']);
$goods['formated_max_price'] = price_format($goods['max_price']);
}
/* 将结束日期格式化为格林威治标准时间时间戳 */
$goods['gmt_end_time']= $goods['end_time'];
$goods['end_time']= local_date($GLOBALS['_CFG']['time_format'], $goods['end_time']);
$goods['snatch_time']= sprintf($GLOBALS['_LANG']['snatch_start_time'], $goods['start_time'], $goods['end_time']);

return $goods;
}
else
{
return false;
}
}
改为
/**
* 取得当前活动信息
*
* @accesspublic
*
* @return 活动名称
*/
function get_snatch($id)
{
$sql = "SELECT g.goods_id, g.goods_sn, g.is_real, g.goods_name, g.extension_code, g.market_price, g.shop_price AS org_price, " .
"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, " .
"g.promote_price, g.promote_start_date, g.promote_end_date, g.goods_brief, g.goods_img, " .
"ga.act_name AS snatch_name, ga.start_time, ga.end_time, ga.ext_info, ga.act_desc AS `desc` ".
"FROM " .$GLOBALS['ecs']->table('goods_activity'). " AS ga " .
"LEFT JOIN " . $GLOBALS['ecs']->table('goods')." AS g " .
"ON g.goods_id = ga.goods_id " .
"LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp " .
"ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' " .
"WHERE ga.act_id = '$id' AND g.is_delete = 0";

$goods = $GLOBALS['db']->GetRow($sql);

if ($goods)
{
$promote_price = bargain_price($goods['promote_price'], $goods['promote_start_date'], $goods['promote_end_date']);
$goods['formated_market_price']= price_format($goods['market_price']);
$goods['formated_shop_price'] = price_format($goods['shop_price']);
$goods['formated_promote_price'] = ($promote_price > 0) ? price_format($promote_price) : '';
$goods['goods_img']= get_image_path($goods['goods_id'], $goods['goods_img'], true);
$goods['url']= build_uri('goods', array('gid'=>$goods['goods_id']), $goods['goods_name']);
$goods['start_time'] = local_date($GLOBALS['_CFG']['time_format'], $goods['start_time']);

$info = unserialize($goods['ext_info']);
if ($info)
{
foreach ($info as $key => $val)
{
$goods[$key] = $val;
}
$goods['is_end'] = gmtime() > $goods['end_time'];
$goods['formated_start_price'] = price_format($goods['start_price']);
$goods['formated_end_price'] = price_format($goods['end_price']);
$goods['formated_max_price'] = price_format($goods['max_price']);
}
/* 将结束日期格式化为格林威治标准时间时间戳 */
$goods['gmt_end_time']= $goods['end_time'];
$goods['end_time']= local_date($GLOBALS['_CFG']['time_format'], $goods['end_time']);
$goods['snatch_time']= sprintf($GLOBALS['_LANG']['snatch_start_time'], $goods['start_time'], $goods['end_time']);

return $goods;
}
else
{
return false;
}
}


/**
* 取得当前活动信息
*
* @accesspublic
*
* @return 活动名称
*/
function get_snatch($id)
{
$sql = "SELECT g.goods_id, g.goods_sn, g.is_real, g.goods_name, g.extension_code, g.market_price, g.shop_price AS org_price, " .
"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, " .
"g.promote_price, g.promote_start_date, g.promote_end_date, g.goods_brief ,g.goods_thumb, g.goods_img, " .
"ga.act_name AS snatch_name, ga.start_time, ga.end_time, ga.ext_info, ga.act_desc AS `desc` ".
"FROM " .$GLOBALS['ecs']->table('goods_activity'). " AS ga " .
"LEFT JOIN " . $GLOBALS['ecs']->table('goods')." AS g " .
"ON g.goods_id = ga.goods_id " .
"LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp " .
"ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' " .
"WHERE ga.act_id = '$id' AND g.is_delete = 0";

$goods = $GLOBALS['db']->GetRow($sql);

if ($goods)
{
$promote_price = bargain_price($goods['promote_price'], $goods['promote_start_date'], $goods['promote_end_date']);
$goods['formated_market_price']= price_format($goods['market_price']);
$goods['formated_shop_price'] = price_format($goods['shop_price']);
$goods['formated_promote_price'] = ($promote_price > 0) ? price_format($promote_price) : '';
$goods['goods_img']= get_image_path($goods['goods_id'], $goods['goods_img'], true);
$goods['goods_thumb']= get_image_path($goods['goods_id'], $goods['goods_thumb'], true);
$goods['url']= build_uri('goods', array('gid'=>$goods['goods_id']), $goods['goods_name']);
$goods['start_time'] = local_date($GLOBALS['_CFG']['time_format'], $goods['start_time']);

$info = unserialize($goods['ext_info']);
if ($info)
{
foreach ($info as $key => $val)
{
$goods[$key] = $val;
}
$goods['is_end'] = gmtime() > $goods['end_time'];
$goods['formated_start_price'] = price_format($goods['start_price']);
$goods['formated_end_price'] = price_format($goods['end_price']);
$goods['formated_max_price'] = price_format($goods['max_price']);
}
/* 将结束日期格式化为格林威治标准时间时间戳 */
$goods['gmt_end_time']= $goods['end_time'];
$goods['end_time']= local_date($GLOBALS['_CFG']['time_format'], $goods['end_time']);
$goods['snatch_time']= sprintf($GLOBALS['_LANG']['snatch_start_time'], $goods['start_time'], $goods['end_time']);

return $goods;
}
else
{
return false;
}
}

说明:
snatch.php 只需在原来的函数中增加红色部分代码

难怪了!没有人愿意讲,还要改到官方的程式喔!
真的太感谢了!试用看看喔!