0
A
回答
0
我們修改了tep_image函數來接受-1,這意味着它只會輸出「高度」或「寬度」約束,但不能同時輸出。您可以根據自己的喜好進行修改,但您想查看tep_image的includes/functions/html_output.php()
// The HTML image wrapper function
function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
if ((empty($enter code heresrc) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false')) {
return false;
}
if($src=='images/')
$src='images/noimage.jpg';
// alt is added to the img tag even if it is null to prevent browsers from outputting
// the image filename as default
$image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';
if (tep_not_null($alt)) {
$image .= ' title=" ' . tep_output_string($alt) . ' "';
}
if(((int)$height==-1) && ((int)$width)==-1){
$image .= '';
}elseif((!empty($width) && ((int)$height)==-1)){
$image .= ' width="' . tep_output_string($width) . '" ';
}elseif((!empty($height) && ((int)$width)==-1)){
$image .= ' height="' . tep_output_string($height) . '" ';
}else{
if ((CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height))) {
if ($image_size = @getimagesize($src)) {
if (empty($width) && tep_not_null($height)) {
$ratio = $height/$image_size[1];
$width = intval($image_size[0] * $ratio);
} elseif (tep_not_null($width) && empty($height)) {
$ratio = $width/$image_size[0];
$height = intval($image_size[1] * $ratio);
} elseif (empty($width) && empty($height)) {
$width = $image_size[0];
$height = $image_size[1];
}
} elseif (IMAGE_REQUIRED == 'false') {
return false;
}
}
if (tep_not_null($width) && tep_not_null($height)) {
$image .= ' wddidth="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
}
}
if (tep_not_null($parameters)) $image .= ' ' . $parameters;
$image .= '>';
return $image;
}
相關問題
- 1. 更改產品圖片
- 2. OSCommerce - 重組產品列表
- 3. Django。製作拇指圖片
- 4. 圖片標籤導致Woocommerce產品大拇指看起來混亂
- 5. Prestashop產品圖片
- 6. 產品圖片API
- 7. 當鼠標滾動滾動拇指div的原始大拇指位置div
- 8. 如何更改UISlider的繪圖矩形和拇指圖像
- 9. 的.htaccess拇指PHP圖片鏈接
- 10. 指定陣列以新的變量,改變原始改變新
- 11. 編輯產品 - 改變圖像
- 12. HTML/JS - 產品圖片
- 13. 產品圖片數據庫
- 14. DataFlow上傳產品圖片
- 15. woocommerce景觀產品圖片
- 16. Woocommerce + wpml產品圖片
- 17. Spree REST API產品圖片
- 18. osCommerce圖片不顯示
- 19. 將Woocommerce品牌形象設置爲產品佔位符圖像
- 20. jquery fancybox大拇指 - 沒有大拇指 - 沒有幻燈片
- 21. 如何改變UISlider拇指圖像的大小
- 22. Magento:關於產品圖片(小,拇指等)的信息,在數據庫中的位置?
- 23. 清單產品表和產品形象---表連接查詢
- 24. 試圖改變一個單選按鈕產品選擇的小圖片
- 25. 獲取產品的所有Magento圖像(原始尺寸)
- 26. fontawesome + jQuery的:它不「拇指向下」圖標更改爲「豎起大拇指」
- 27. Facebook圖形API獲取原始圖片大小不起作用
- 28. Android更改Seekbar拇指與Java導致拇指位置重置
- 29. dynamic_cast更改原始對象?
- 30. Zara的產品形象功能