Где в "Joomla+VirtueMart" прописать стиль к Фото в "Подробнее >>>"?

32
На сайте с 07.02.2011
Offline
76
1657

Подскажите, пожалуйста, где добавить стиль к фото или если ошибаюсь, то какой тогда файл выводит фото, которое показывается в "Подробнее о товаре>>>"

Пример "Подробнее о товаре>>>":http://rghost.ru/19268631

Нужно добавить к фото стиль class="reflect" от скрипта Reflection.js зеркальное отражение.

Разыскал и сделал зеркальность, только если нет фото к noimage.gif

\www\components\com_virtuemart\themes\default\theme.php


$product_image = "<img src=\"".VM_THEMEURL.'images/'.NO_IMAGE."\" class=\"reflect\" alt=\"".$product['product_name']."\" border=\"0\" />";

а к самому фото что-то не найду.

файл theme.php

<?php

if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
global $mainframe;

// include the stylesheet for this template

if( vmIsJoomla('1.0') && mosGetParam($_REQUEST,'option') != VM_COMPONENT_NAME) {
// This can only be a call from a module or mambot
// In Joomla 1.0 it is not possible to add a JS or CSS into the HEAD from a module or content mambot,
// using addcustomheadtag, that's why we just print the tags here
echo vmCommonHTML::scriptTag(VM_THEMEURL.'theme.js');
echo vmCommonHTML::linkTag(VM_THEMEURL.'theme.css');
} else {
$vm_mainframe->addStyleSheet( VM_THEMEURL.'theme.css' );
$vm_mainframe->addScript( VM_THEMEURL.'theme.js' );
}
class vmTheme extends vmTemplate {

function vmTheme() {
parent::vmTemplate();
vmCommonHTML::loadMooTools();
}

function vmBuildFullImageLink( $product ) {
global $VM_LANG;

$product_image = '';

$img_attributes= 'alt="'.$product['product_name'].'"';

/* Wrap the Image into an URL when applicable */
if ( @$product["product_url"] ) {
$product_image = "<a href=\"". $product["product_url"]."\" title=\"".$product['product_name']."\" target=\"_blank\">";
$product_image .= ps_product::image_tag($product['product_thumb_image'], $img_attributes, 0);
$product_image .= "</a>";
}
/* Show the Thumbnail with a Link to the full IMAGE */
else {
if( empty($product['product_full_image'] ) ) {
$product_image = "<img src=\"".VM_THEMEURL.'images/'.NO_IMAGE."\" class=\"reflect\" alt=\"".$product['product_name']."\" border=\"0\" />";
}
else {
// file_exists doesn't work on remote files,
// so returns false on remote files
// This should fix the "Long Page generation bug"
if( file_exists( IMAGEPATH.'product/'.$product['product_full_image'] )) {

/* Get image width and height */
if( $image_info = @getimagesize(IMAGEPATH.'product/'.$product['product_full_image'] ) ) {
$width = $image_info[0] + 20;
$height = $image_info[1] + 20;
}
}
else {
$width = 640;
$height= 480;
}
if( stristr( $product['product_full_image'], "http" ) ) {
$imageurl = $product['product_full_image'];
}
else {
$imageurl = IMAGEURL.'product/'.rawurlencode( $VM_LANG->convert($product['product_full_image']));
}
/* Build the "See Bigger Image" Link */
if( @$_REQUEST['output'] != "pdf" && $this->get_cfg('useLightBoxImages', 1 ) ) {
$link = $imageurl;
$text = ps_product::image_tag($product['product_thumb_image'], $img_attributes, 0)."<br /><br />".$VM_LANG->_('PHPSHOP_FLYPAGE_ENLARGE_IMAGE');

$product_image = vmCommonHTML::getLightboxImageLink( $link, $text, $product['product_name'], 'product'.$product['product_id'] );
}
elseif( @$_REQUEST['output'] != "pdf" ) {
$link = $imageurl;
$text = ps_product::image_tag($product['product_thumb_image'], $img_attributes, 0)."<br /><br />".$VM_LANG->_('PHPSHOP_FLYPAGE_ENLARGE_IMAGE');
// vmPopupLink can be found in: htmlTools.class.php
$product_image = vmPopupLink( $link, $text, $width, $height );
}
else {
$product_image = "<a href=\"$imageurl\" target=\"_blank\">"
. ps_product::image_tag($product['product_thumb_image'], $img_attributes, 0)
. "</a>";
}
}
}
return $product_image;
}

/**
* Builds a list of all additional images
*
* @param int $product_id
* @param array $images
* @return string
*/
function vmlistAdditionalImages( $product_id, $images, $title='', $limit=1000 ) {
global $sess;
$html = '';
$i = 0;
foreach( $images as $image ) {
$thumbtag = ps_product::image_tag( $image->file_name, 'class="browseProductImage"', 1, 'product', $image->file_image_thumb_width, $image->file_image_thumb_height );
$fulladdress = $sess->url( 'index2.php?page=shop.view_images&amp;image_id='.$image->file_id.'&amp;product_id='.$product_id.'&amp;pop=1' );

if( $this->get_cfg('useLightBoxImages', 1 )) {
$html .= vmCommonHTML::getLightboxImageLink( $image->file_url, $thumbtag, $title ? $title : stripslashes(htmlentities($image->file_title,ENT_QUOTES)), 'product'.$product_id );
}
else {
$html .= vmPopupLink( $fulladdress, $thumbtag, 640, 550 );
}
$html .= ' ';
if( ++$i > $limit ) break;
}
return $html;
}
/**
* Builds the "more images" link
*
* @param array $images
*/
function vmMoreImagesLink( $images ) {
global $mosConfig_live_site, $VM_LANG, $sess;
/* Build the JavaScript Link */
$url = $sess->url( "index2.php?page=shop.view_images&amp;flypage=".@$_REQUEST['flypage']."&amp;product_id=".@$_REQUEST['product_id']."&amp;category_id=".@$_REQUEST['category_id']."&amp;pop=1" );
$text = $VM_LANG->_('PHPSHOP_MORE_IMAGES').'('.count($images).')';
$image = vmCommonHTML::imageTag( VM_THEMEURL.'images/more_images.png', $text, '', '16', '16' );

return vmPopupLink( $url, $image.'<br />'.$text, 640, 550, '_blank', '', 'screenX=100,screenY=100' );
}


// Your code here please...

}
?>
32
На сайте с 07.02.2011
Offline
76
#1

Актуально.

32
На сайте с 07.02.2011
Offline
76
#2

в роде бы код, который выводит фото, нашел, но не могу правильно прописать стиль, т.к. толком не знаю php. Выводится пустая страница или без фото. Подскажите, пожалуйста, как правильно указать стиль class="reflect" в коде:

$text = ps_product::image_tag($product['product_thumb_image'], $img_attributes, 0)."<br /><br />".$VM_LANG->_('PHPSHOP_FLYPAGE_ENLARGE_IMAGE');
SEOmagic
На сайте с 21.11.2005
Offline
136
#3

Немного странный код нужного фрагмента, что за ***91 и ***93 ?

А так, меняем

$img_attributes= 'alt="'.$product['product_name'].'"';

на

$img_attributes= 'class="reflect" alt="'.$product['product_name'].'"';
32
На сайте с 07.02.2011
Offline
76
#4

SEOmagic Спасибо огромное!!!

SEOmagic:
Немного странный код нужного фрагмента, что за ***91 и ***93 ?

даже и не знаю, что это, может ранее какой хак внедрял.

Сейчас код получается такой:

<?php

if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
global $mainframe;

// include the stylesheet for this template

if( vmIsJoomla('1.0') && mosGetParam($_REQUEST,'option') != VM_COMPONENT_NAME) {
// This can only be a call from a module or mambot
// In Joomla 1.0 it is not possible to add a JS or CSS into the HEAD from a module or content mambot,
// using addcustomheadtag, that's why we just print the tags here
echo vmCommonHTML::scriptTag(VM_THEMEURL.'theme.js');
echo vmCommonHTML::linkTag(VM_THEMEURL.'theme.css');
} else {
$vm_mainframe->addStyleSheet( VM_THEMEURL.'theme.css' );
$vm_mainframe->addScript( VM_THEMEURL.'theme.js' );
}
class vmTheme extends vmTemplate {

function vmTheme() {
parent::vmTemplate();
vmCommonHTML::loadMooTools();
}

function vmBuildFullImageLink( $product ) {
global $VM_LANG;

$product_image = '';

$img_attributes= 'class="reflect" alt="'.$product['product_name'].'"';

/* Wrap the Image into an URL when applicable */
if ( @$product["product_url"] ) {
$product_image = "<a href=\"". $product["product_url"]."\" title=\"".$product['product_name']."\" target=\"_blank\">";
$product_image .= ps_product::image_tag($product['product_thumb_image'], $img_attributes, 0);
$product_image .= "</a>";
}
/* Show the Thumbnail with a Link to the full IMAGE */
else {
if( empty($product['product_full_image'] ) ) {
$product_image = "<img src=\"".VM_THEMEURL.'images/'.NO_IMAGE."\" class=\"reflect\" alt=\"".$product['product_name']."\" border=\"0\" />";
}
else {
// file_exists doesn't work on remote files,
// so returns false on remote files
// This should fix the "Long Page generation bug"
if( file_exists( IMAGEPATH.'product/'.$product['product_full_image'] )) {

/* Get image width and height */
if( $image_info = @getimagesize(IMAGEPATH.'product/'.$product['product_full_image'] ) ) {
$width = $image_info[0] + 20;
$height = $image_info[1] + 20;
}
}
else {
$width = 640;
$height= 480;
}
if( stristr( $product['product_full_image'], "http" ) ) {
$imageurl = $product['product_full_image'];
}
else {
$imageurl = IMAGEURL.'product/'.rawurlencode( $VM_LANG->convert($product['product_full_image']));
}
/* Build the "See Bigger Image" Link */
if( @$_REQUEST['output'] != "pdf" && $this->get_cfg('useLightBoxImages', 1 ) ) {
$link = $imageurl;
$text = ps_product::image_tag($product['product_thumb_image'], $img_attributes, 0)."<br /><br />".$VM_LANG->_('PHPSHOP_FLYPAGE_ENLARGE_IMAGE');

$product_image = vmCommonHTML::getLightboxImageLink( $link, $text, $product['product_name'], 'product'.$product['product_id'] );
}
elseif( @$_REQUEST['output'] != "pdf" ) {
$link = $imageurl;
$text = ps_product::image_tag($product['product_thumb_image'], $img_attributes, 0)."<br /><br />".$VM_LANG->_('PHPSHOP_FLYPAGE_ENLARGE_IMAGE');
// vmPopupLink can be found in: htmlTools.class.php
$product_image = vmPopupLink( $link, $text, $width, $height );
}
else {
$product_image = "<a href=\"$imageurl\" target=\"_blank\">"
. ps_product::image_tag($product['product_thumb_image'], $img_attributes, 0)
. "</a>";
}
}
}
return $product_image;
}

/**
* Builds a list of all additional images
*
* @param int $product_id
* @param array $images
* @return string
*/
function vmlistAdditionalImages( $product_id, $images, $title='', $limit=1000 ) {
global $sess;
$html = '';
$i = 0;
foreach( $images as $image ) {
$thumbtag = ps_product::image_tag( $image->file_name, 'style="margin:5px;"', 1, 'product', $image->file_image_thumb_width, $image->file_image_thumb_height );
$fulladdress = $sess->url( 'index2.php?page=shop.view_images&amp;image_id='.$image->file_id.'&amp;product_id='.$product_id.'&amp;pop=1' );

if( $this->get_cfg('useLightBoxImages', 1 )) {
$html .= vmCommonHTML::getLightboxImageLink( $image->file_url, $thumbtag, $title ? $title : stripslashes(htmlentities($image->file_title,ENT_QUOTES)), 'product'.$product_id );
}
else {
$html .= vmPopupLink( $fulladdress, $thumbtag, 640, 550 );
}
$html .= ' ';
if( ++$i > $limit ) break;
}
return $html;
}
/**
* Builds the "more images" link
*
* @param array $images
*/
function vmMoreImagesLink( $images ) {
global $mosConfig_live_site, $VM_LANG, $sess;
/* Build the JavaScript Link */
$url = $sess->url( "index2.php?page=shop.view_images&amp;flypage=".@$_REQUEST['flypage']."&amp;product_id=".@$_REQUEST['product_id']."&amp;category_id=".@$_REQUEST['category_id']."&amp;pop=1" );
$text = $VM_LANG->_('PHPSHOP_MORE_IMAGES').'('.count($images).')';
$image = vmCommonHTML::imageTag( VM_THEMEURL.'images/more_images.png', $text, '', '16', '16' );

return vmPopupLink( $url, $image.'<br />'.$text, 640, 550, '_blank', '', 'screenX=100,screenY=100' );
}


// Your code here please...

}
?>

Еще раз огромное спасибо!!!

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий