コード例 #1
0
ファイル: image.php プロジェクト: aldegtyarev/stelsvelo
    public static function op_show_image(&$image, $extra, $width, $height, $type)
    {
        $showimg = VmConfig::get('oncheckout_show_images', true);
        if (empty($showimg)) {
            return ' ';
        }
        if (empty($image)) {
            if (!empty($width)) {
                $w = 'width: ' . $width . ';';
            } else {
                $w = '';
            }
            if (!empty($height)) {
                $h = 'height: ' . $height . ';';
            } else {
                $h = '';
            }
            return '<div style="' . $w . ' ' . $h . ' ">&nbsp;</div>';
        }
        $class = '';
        $alt = '';
        $img = OPCimage::op_image_info_array($image, 'class="' . $class . '" border="0" title="' . $alt . '" alt="' . $alt . '"', 1, $type, $width, $height);
        if (!empty($img)) {
            $real_height = $img['height'];
            $real_width = $img['width'];
        } else {
            $real_height = 0;
            $real_width = 0;
            $href = '';
        }
        $width = (int) $width;
        $height = (int) $height;
        $real_width = (int) $real_width;
        $real_height = (int) $real_height;
        if (empty($width)) {
            $width = $real_width;
        }
        if (empty($height)) {
            $height = $real_height;
        }
        $w1 = floor(abs($real_width - $width) / 2);
        $w2 = $width - floor(abs($real_width - $width) / 2);
        $h1 = floor(abs($real_height - $height) / 2);
        $h2 = $height - floor(abs($real_height - $height) / 2);
        $w3 = $width - $w1;
        $ret = '<div style="height: ' . $height . 'px; width: ' . $width . 'px; ">
           <div style="float: left; width: ' . $w1 . 'px; height: 100%;"></div>
		   <div style="float: left; width: ' . $w3 . 'px; height: ' . $h1 . 'px;"></div>
           <div style="float: left; width: ' . $w3 . 'px; height: ' . $h2 . 'px;">';
        if (!empty($img)) {
            if (!empty($href)) {
                $ret .= '<a href="' . $href . '" title="' . $alt . '">';
            }
            $ret .= '<img src="' . $img['iurl'] . '" width="' . $img['width'] . '" height="' . $img['height'] . '" />';
            if (!empty($href)) {
                $ret .= '</a>';
            }
        } else {
            $ret .= "&nbsp;";
        }
        $ret .= '
           </div>
           </div>';
        return $ret;
    }
コード例 #2
0
 function getImage($catId)
 {
     $db = JFactory::getDBO();
     $q = "select m.file_title,m.file_url\n\t\t\tfrom `#__virtuemart_medias` as m \n\t\t\tINNER JOIN #__virtuemart_category_medias as cat \n\t\t\tON m.virtuemart_media_id = cat.virtuemart_media_id \n\t\t\tWHERE cat.virtuemart_category_id = '" . $db->getEscaped($catId) . "'limit 1";
     $db->setQuery($q);
     $arr = $db->loadAssocList();
     $image = '';
     if ($arr[0]['file_url']) {
         $path = DS . "images" . DS . "com_opc_util_menu" . DS . "19_19";
         $abspath = JPATH_SITE . $path;
         jimport('joomla.filesystem.file');
         if (!JFolder::exists($abspath)) {
             JFolder::create($abspath);
         }
         $filename = JFile::makeSafe($arr[0]['file_title']);
         $filepath = $abspath . DS . $filename;
         $origFile = JPATH_ROOT . DS . $arr[0]['file_url'];
         list($width, $height, $type, $attr) = getimagesize($origFile);
         // resize image and copy to $filepath
         OPCimage::resizeImg($origFile, $filepath, 19, 19, $width, $height);
         $image = $path . DS . $filename;
     }
     return $image;
 }
コード例 #3
0
ファイル: loader.php プロジェクト: aldegtyarev/stelsvelo
 public function op_show_image(&$image, $extra, $width, $height, $type)
 {
     require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'image.php';
     return OPCimage::op_show_image($image, $extra, $width, $height, $type);
 }
コード例 #4
0
    ?>
][product_quantity]" value="<?php 
    echo $item->product_quantity;
    ?>
"/>
				</td>
				<td>
					<span class='ordereditI'><?php 
    echo $item->order_item_name;
    ?>
</span>
					<?php 
    require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'image.php';
    $create = true;
    $media = OPCimage::getImageUrl($item->virtuemart_product_id, $create, 40, 40);
    OPCimage::op_show_image($item->product_full_image, '', 40, 40, 'product');
    ?>
					<input class='orderedit' type="text"  name="item_id[<?php 
    echo $item->virtuemart_order_item_id;
    ?>
][order_item_name]" value="<?php 
    echo $item->order_item_name;
    ?>
"/><?php 
    //echo $item->order_item_name;
    if (!empty($item->product_attribute)) {
        if (!class_exists('VirtueMartModelCustomfields')) {
            require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'customfields.php';
        }
        $product_attribute = VirtueMartModelCustomfields::CustomsFieldOrderDisplay($item, 'BE');
        echo '<div>' . $product_attribute . '</div>';