Как отредактировать вывод изображения в flypage

Тема в разделе "VirtueMart", создана пользователем Alimp, 08.12.2010.

  1. Offline

    Alimp Недавно здесь

    Регистрация:
    01.12.2010
    Сообщения:
    1
    Симпатии:
    0
    Пол:
    Мужской
    Подскажите, как сделать, чтобы мини изображения были снизу. Заранее спасибо :)
    Код (PHP):
    1. <?php
    2. /**
    3. * @Enterprise: S&S Media Solutions
    4. * @author: Yannick Spang
    5. * @creation date: April 2009
    6. * @url: http://www.joomla-virtuemart-designs.com
    7. * @copyright: Copyright (C) 2008 - 2009 S&S Media Solutions
    8. * @license: Commercial, see LICENSE.php
    9. * @product: Flypage Admirable - Virtuemart Theme
    10. * @version: 1.0
    11. */
    12.  
    13. if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
    14. mm_showMyFileName(__FILE__);
    15. global $db;
    16. $image_id = intval(vmGet($_REQUEST, "image_id", "product"));
    17.  
    18. if( !empty($product_id) ) {
    19.  
    20.   require_once( CLASSPATH . "ps_product.php" );
    21.   $ps_product =& new ps_product();
    22.  
    23. // Get the default full and thumb image
    24.   $db->query( "SELECT product_name,product_full_image,product_thumb_image FROM #__{vm}_product WHERE product_id='$product_id'");
    25.   $db->next_record();
    26.   $alt = $db->f("product_name");
    27.   $height = PSHOP_IMG_HEIGHT;
    28.   $width = PSHOP_IMG_WIDTH;
    29.   $href = 'index.php?page=shop.product_details&amp;flypage='.$flypage.'&amp;product_id='.$product_id.'&amp;category_id='.$category_id.'&amp;option=com_virtuemart&amp;Itemid='.$Itemid;
    30.   $title = $db->f("product_name");
    31.   echo "<a href=\"$href\" target=\"_self\" title=\"$title\">\n";
    32.   $ps_product->show_image( $db->f("product_thumb_image"), "alt=\"$alt\"");
    33.   echo "</a>\n";
    34.   $dbi = new ps_DB();
    35.  
    36. // Let's have a look wether the product has more images.
    37.   $dbi->query( "SELECT * FROM #__{vm}_product_files WHERE file_product_id='$product_id' AND file_is_image='1'" );
    38.   $images = $dbi->record;
    39.   $i = 0;
    40.   foreach( $images as $image ) {
    41.     $info = pathinfo( $image->file_name );
    42.    
    43.     $base_filename = basename($image->file_name, ".".$info["extension"])."_".$image->file_image_thumb_height."x".$image->file_image_thumb_width.".".$info["extension"];
    44.     $thumb = $mosConfig_absolute_path.'/'.$info["dirname"] ."/resized/". $base_filename;
    45.     $thumburl = str_replace( $mosConfig_absolute_path, $mosConfig_live_site, $thumb );
    46.    
    47.     $alt = $image->file_title;
    48.     $height = empty($image->file_image_thumb_height) ? PSHOP_IMG_HEIGHT : $image->file_image_thumb_height;
    49.     $width = empty($image->file_image_thumb_width) ? PSHOP_IMG_WIDTH : $image->file_image_thumb_width;
    50.    
    51.     $href = 'index.php?page=shop.product_details&amp;flypage='.$flypage.'&amp;product_id='.$product_id.'&amp;category_id='.$category_id.'&amp;option=com_virtuemart&amp;Itemid='.$Itemid.'&amp;image_id='.$image->file_id;
    52.     $title = $image->file_title;
    53.     echo "<a href=\"$href\" target=\"_self\" title=\"$title\"><img src=\"$thumburl\" alt=\"$alt\"  width=\"$width\" /></a>\n";
    54.     // Break Row when needed
    55.     //if( $i++ >= 4 ) { $i=0; echo "<br/><br/>"; }
    56.   }
    57.   echo "<br/>\n";
    58.  
    59.  
    60.   if( $image_id == "product" ) {
    61.     echo "<div id=\"ssmed_zoom_image\">";
    62.     $ps_product->show_image($db->f("product_full_image"), "alt=\"$alt\" ", 0);
    63.     echo "</div>";
    64.   }
    65.   else {
    66.     if( !empty($image_id) ) {
    67.       // Get that image!
    68.       $dbi->query( "SELECT * FROM #__{vm}_product_files WHERE file_product_id='$product_id' AND file_is_image='1' AND file_id='$image_id'" );
    69.     }
    70.     else {
    71.       // Get the first image
    72.       $dbi->query( "SELECT * FROM #__{vm}_product_files WHERE file_product_id='$product_id' AND file_is_image='1'" );
    73.     }
    74.     $show_img = $dbi->record[0];
    75.     if( $show_img ) {
    76.         $filename = $mosConfig_absolute_path.str_replace( $mosConfig_absolute_path, '', $show_img->file_name );
    77.         $src = str_replace( $mosConfig_absolute_path, $mosConfig_live_site, $filename );
    78.         if( strstr( $src, $mosConfig_live_site.$show_img->file_name)) {
    79.             $src = str_replace( $mosConfig_live_site.$show_img->file_name, $mosConfig_live_site."/".$show_img->file_name, $src );
    80.         }
    81.         $alt = $show_img->file_title;
    82.         $height = $show_img->file_image_height;
    83.         $width = $show_img->file_image_width;
    84.         echo "<div id=\"ssmed_zoom_image\"><img class=\"zoomed_image\"src=\"$src\" alt=\"$alt\" /></div>";
    85.     }
    86.     else {
    87.       echo $VM_LANG->_('PHPSHOP_IMAGE_NOT_FOUND');
    88.     }
    89.   }
    90. }
    91. ?>
     

    Вложения:

    • virtuemart.jpg
      virtuemart.jpg
      Размер файла:
      75.6 КБ
      Просмотров:
      9
    Последнее редактирование: 08.12.2010
  2.  

Поделиться этой страницей

Загрузка...