Ребятки, я победил!
Проблема действительно с function image_tag.
Как сообщают
http://forum.virtuemart.net/index.php?topic=59990.0В /administrator/components/com_virtuemart/classes/ps_product.php неправильная логика:
function image_tag($image, $args="", $resize=1, $path_appendix='product', $thumb_width=0, $thumb_height=0 ) {
global $mosConfig_live_site, $mosConfig_absolute_path;
require_once( CLASSPATH . 'imageTools.class.php');
$border="";
if( strpos( $args, "border=" )===false ) {
$border = 'border="0"';
}
$height = $width = '';
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=";
if( !strpos( $args, "height=" )) {
$arr = @getimagesize( vmImageTools::getresizedfilename( $image, $path_appendix, '', $thumb_width, $thumb_height ) );
$width = $arr[0]; $height = $arr[1];
}
}
else {
$url = IMAGEURL.$path_appendix.'/'.$image;
if( file_exists($image)) {
$url = str_replace( $mosConfig_absolute_path, $mosConfig_live_site, $image );
} elseif( file_exists( IMAGEPATH . $path_appendix . '/' . $image )) {
$url = IMAGEURL . $path_appendix . '/' . $image ;
}
if( !strpos( $args, "height=" ) ) {
$arr = getimagesize( str_replace( IMAGEURL, IMAGEPATH, $url ) );
$width = $arr[0]; $height = $arr[1];
}
if( $resize ) {
if( $height < $width ) {
$width = round($width / ($height / PSHOP_IMG_HEIGHT));
$height = PSHOP_IMG_HEIGHT;
} else {
$height = round($height / ($width / PSHOP_IMG_WIDTH ));
$width = PSHOP_IMG_WIDTH;
}
}
}
$url = str_replace( basename( $url ), $GLOBALS['VM_LANG']->convert(basename($url)), $url );
}
}
else {
$url = VM_THEMEURL.'images/'.NO_IMAGE;
}
return vmCommonHTML::imageTag( $url, '', '', $height, $width, '', '', $args.' '.$border );
}
А должно быть:
function image_tag($image, $args="", $resize=1, $path_appendix='product', $thumb_width=0, $thumb_height=0 ) {
global $mosConfig_live_site, $mosConfig_absolute_path;
require_once( CLASSPATH . 'imageTools.class.php');
$border="";
if( strpos( $args, "border=" )===false ) {
$border = 'border="0"';
}
$height = $width = '';
if ($image != "") {
// URL
if( substr( $image, 0, 4) == "http" ) {
$url = $image;
}
// local image file
else {
if(PSHOP_IMG_RESIZE_ENABLE == '1' && $resize==1) {
if( $resize ) {
if( $height < $width ) {
$width = round($width / ($height / PSHOP_IMG_HEIGHT));
$height = PSHOP_IMG_HEIGHT;
} else {
$height = round($height / ($width / PSHOP_IMG_WIDTH ));
$width = PSHOP_IMG_WIDTH;
}
}
$url = $mosConfig_live_site."/components/com_virtuemart/show_image_in_imgtag.php?filename=".urlencode($image)."&newxsize=".PSHOP_IMG_WIDTH."&newysize=".PSHOP_IMG_HEIGHT."&fileout=";
if( !strpos( $args, "height=" )) {
$arr = @getimagesize( vmImageTools::getresizedfilename( $image, $path_appendix, '', $thumb_width, $thumb_height ) );
$width = $arr[0]; $height = $arr[1];
}
}
else {
$url = IMAGEURL.$path_appendix.'/'.$image;
if( file_exists($image)) {
$url = str_replace( $mosConfig_absolute_path, $mosConfig_live_site, $image );
} elseif( file_exists( IMAGEPATH . $path_appendix . '/' . $image )) {
$url = IMAGEURL . $path_appendix . '/' . $image ;
}
if( !strpos( $args, "height=" ) ) {
$arr = getimagesize( str_replace( IMAGEURL, IMAGEPATH, $url ) );
$width = $arr[0]; $height = $arr[1];
}
}
$url = str_replace( basename( $url ), $GLOBALS['VM_LANG']->convert(basename($url)), $url );
}
}
else {
$url = VM_THEMEURL.'images/'.NO_IMAGE;
}
return vmCommonHTML::imageTag( $url, '', '', $height, $width, '', '', $args.' '.$border );
}
Кстати, я заменил у себя данный блок но ничего толкового не произошло.
Пришлось заменять весь файл ps_product.php из предыдущей версии. И теперь все работает как надо.