Имеется
в ps_product.php
путь administrator\components\com_virtuemart\classes
функция "function image_tag", которая отвечает за размеры мини-картинок, т.е измененных полноразмерных картинок.
В админке имеется "Требуемая ширина мини-изображения" (все работает, мини-картинки нужны)
Ищу опцию "Требуемая ширина Большого-изображения".
Т.е. допустим, имеется картинка 1200(ш) х 800(в).
Если ширина больше 700, то 1200 -> 700,
если ширина меньше 700, то ширину полноразмерной картинки не изменяем.
В файле flypage.php установил
<img src="/components/com_virtuemart/shop_image/product/{full_image}" alt="{product_name}" title="{product_name}" style="max-width:700px;">
хотя картинка и уменшается до 700,
но ширина таблицы (MainBody) остается 1200. Т.е. таблице передается ширина большой картинки.
Хотя в интернет-коде стоит "style="max-width:700px;"
ВОПРОС
Подскажите, пожалуйста, какие условия нужно изменить в этой функции (или код в другом файле), чтобы ресайзить размеры самих больших картинок.
Т.е. чтобы были возможности для регулирования ширины мини-изображения и ширины большого-изображения.
/**
* Returns the img tag for the given product image
*
* @param string $image The name of the imahe OR the full URL to the image
* @param string $args Additional attributes for the img tag
* @param int $resize
* (1 = resize the image by using height and width attributes,
* 0 = do not resize the image)
* @param string $path_appendix The path to be appended to IMAGEURL / IMAGEPATH
* @return The HTML code of the img tag
*/
function image_tag($image, $args="", $resize=1, $path_appendix="product") {
global $mosConfig_live_site;
$border="";
if( !strpos( $args, "border=" ))
$border="border=\"0\"";
if ($image != "") {
// URL
if( substr( $image, 0, 4) == "http" )
$url = $image;
// local image file
else {
if(PSHOP_IMG_RESIZE_ENABLE == '1' && $resize==1)
$url = $mosConfig_live_site."/components/com_virtuemart/show_image_in_imgtag.php?filename=".urlencode($image)."&newxsize=".PSHOP_IMG_WIDTH."&newysize=".PSHOP_IMG_HEIGHT."&fileout=";
else
$url = IMAGEURL.$path_appendix."/".$image;
}
}
else {
$url = IMAGEURL.NO_IMAGE;
}
$html_height_width = "";
$height_greater = false;
if( file_exists(IMAGEPATH.$path_appendix."/".$image)) {
$arr = @getimagesize( IMAGEPATH.$path_appendix."/".$image );
$html_height_width = $arr[3];
$height_greater = $arr[0] < $arr[1];
if( (PSHOP_IMG_WIDTH < $arr[0] || PSHOP_IMG_HEIGHT < $arr[1]) && $resize != 0 ) {
if( $height_greater )
$html_height_width = " height=\"".PSHOP_IMG_HEIGHT."\"";
else
$html_height_width = " width=\"".PSHOP_IMG_WIDTH."\"";
}
}
if((PSHOP_IMG_RESIZE_ENABLE != '1') && ($resize==1) ) {
if( $height_greater )
$html_height_width = " height=\"".PSHOP_IMG_HEIGHT."\"";
else
$html_height_width = " width=\"".PSHOP_IMG_WIDTH."\"";
}
return "<img src=\"$url\" $html_height_width $args $border />";
}