alexwebmasster
Постоялец
- Регистрация
- 11 Июл 2010
- Сообщения
- 143
- Реакции
- 3
- Автор темы
- #1
Данный модуль, выводит кучу лишних нулей после разделителя,
подскажите как побороть эту проблему и еще перенести знак доллара , чтобы он выводился после цены.
Я понимаю что вопрос элементарный для человека понимающего ПХП, но моих знаний хватило только перевести ссылку подробнее. И если не трудно, расскажите логику обнаружения куска кода, отвечающего за вывод такого кол-ва нулей. Просто понять хочу и научиться. Заранее благодарен.
подскажите как побороть эту проблему и еще перенести знак доллара , чтобы он выводился после цены.
HTML:
<?php
/*----------------------------------------------------------------------
#Youjoomla Virtuemart Showcase Module for Joomla 1.5 Version 1.0
# ----------------------------------------------------------------------
# Copyright (C) 2007 You Joomla. All Rights Reserved.
# Designed by: Youjoomla.com
# Commercial
# Website: http://www.youjoomla.com// Copyright (c) 2006 - 2008 Youjoomla LLC
# This code cannot be redistributed without permission from Youjoomla - http://www.youjoomla.com.
# More info at http://www.youjoomla.com
# Developer: Dragan Todorovic
------------------------------------------------------------------------*/
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
$nr_products = $params->get( 'nr_products', '6' );
$vmchars = $params->get( 'vmchars', '50' );
$currency = $params->get( 'currency', '$' );
$image_height = $params->get( 'image_height', '75px' );
$image_width = $params->get( 'image_width', '75px' );
$image_align = $params->get( 'image_align', 'left' );
$ordering = $params->get('ordering',3);
$show_addcart = $params->get( 'show_addcart', '1' );
$show_price = $params->get( 'show_price', '1' );
$slide_width = $params->get( 'slide_width', '750px' );
$slide_height = $params->get( 'slide_height', '160px' );
$max_show = $params->get( 'max_show', '4' );
$bann_itemid = $params->get( 'bann_itemid', '' );
$bann_catsid = $params->get( 'bann_catsid', '' );
$vms_durration = $params->get( 'vms_durration', '500' );
$vms_autoslide = $params->get( 'vms_autoslide', '3000' );
// DO NOT EDIT BELOW THIS LINE --------------------------------------
if($ordering == 1){
$order = '#__vm_product.product_id DESC';
}elseif($ordering == 2){
$order = '#__vm_product.product_id ASC';
}elseif ($ordering == 3){
$order = 'RAND()';
}
JHTML::_("behavior.mootools");
$document =& JFactory::getDocument();
$document->addStyleSheet(JURI :: base().'modules/mod_yj_vm_showcase/css/style.css');
$document->addScript(JURI :: base().'modules/mod_yj_vm_showcase/lib/Showcase.js');
// Load the virtuemart main parse code
if( file_exists(dirname(__FILE__).'/../../components/com_virtuemart/virtuemart_parser.php' )) {
require_once( dirname(__FILE__).'/../../components/com_virtuemart/virtuemart_parser.php' );
} else {
require_once( dirname(__FILE__).'/../components/com_virtuemart/virtuemart_parser.php' );
}
require_once( CLASSPATH . 'ps_product.php');
$ps_product = new ps_product;
$db =& new ps_DB;
global $VM_LANG, $vm_mainframe;
global $database;
if($bann_itemid != '') $restrict_product = "AND #__vm_product.product_id NOT IN (".$bann_itemid.")";
if($bann_catsid != '') $restrict_category = "AND category_id NOT IN (".$bann_catsid.")";
$sql = "SELECT #__vm_product.product_id,category_id,product_thumb_image,product_name,product_price,product_desc FROM #__vm_product"
."\n INNER JOIN #__vm_product_price ON #__vm_product.product_id = #__vm_product_price.product_id"
."\n INNER JOIN #__vm_product_category_xref ON #__vm_product.product_id = #__vm_product_category_xref.product_id"
."\n WHERE product_publish = 'Y' ".$restrict_category." ".$restrict_product." ORDER BY ".$order." LIMIT ".$nr_products ."";
$database->setQuery( $sql );
$load_prices = $database->loadObjectList();
$sql2 = "SELECT id FROM #__menu WHERE link ='index.php?option=com_virtuemart' ";
$database->setQuery( $sql2 );
$load_itemid = $database->loadObjectList();
foreach ( $load_itemid as $vmitemid ) {
$WMItemid = $vmitemid->id;
}
?>
<script language="javascript" type="text/javascript">
window.addEvent('load', function(){
new Showcase({
container : 'overall_container',
items :'.yjwm_scproduct',
itemWidth : <?php echo $slide_width / $max_show ?>,
visibleItems: <?php echo $max_show ?>,
effectDuration : <?php echo $vms_durration ?>,
autoSlide : <?php echo $vms_autoslide ?>,
mouseEventSlide: 1000,
navigation: {
'forward':'linkForward',
'back':'linkBackward'
}
});
})
</script>
<!-- http://www.Youjoomla.com Youjoomla Virtuemart Showcase Module for Joomla 1.5 starts here -->
<div id="overall_container" style="height:<?php echo $slide_height ?>;width:<?php echo $slide_width + 124 ?>px;">
<div class="right_nav_link" style="height:<?php echo $slide_height ?>;"><a class="linkForward" id="linkForward" style="height:<?php echo $slide_height ?>;"></a></div>
<div class="yjwm_showcase_holder" style="width:<?php echo $slide_width ?>; height:<?php echo $slide_height ?>;">
<?php
foreach ( $load_prices as $produkti ) {
$productlink = "index.php?page=shop.product_details&flypage=".$ps_product->get_flypage($db->f("product_id"))."&product_id=".$produkti->product_id."&category_id=".$produkti->category_id."&option=com_virtuemart&Itemid=".$WMItemid;
$productintro = substr(strip_tags($produkti->product_desc),0,$vmchars);
$ptitle = $produkti->product_name;
$pimage = 'components/com_virtuemart/shop_image/product/'.$produkti->product_thumb_image.'';
$pimageatt = ' height="'.$image_height.'" width= "'.$image_width.'" alt="'.$ptitle.'" title="'.$ptitle.'" ';
$pprice = $currency.$produkti->product_price;
?>
<div class="yjwm_scproduct" style="height:<?php echo $slide_height ?>; width:<?php echo $slide_width / $max_show ?>px;">
<div class="yjwm_sc_in" style="height:<?php echo $slide_height - 2 ?>px; width:<?php echo $slide_width / $max_show -5 ?>px;">
<h3><a href="<?php echo JRoute::_($productlink) ?>"><?php echo $ptitle ?></a></h3>
<p style="height:<?php echo $slide_height - 90 ?>px;"> <a href="<?php echo JRoute::_($productlink) ?>">
<img src="<?php echo $pimage ?>" <?php echo $pimageatt ?> align="<?php echo $image_align ?>" /></a><?php echo $productintro ?></p>
<?php if ($show_price == 1 || $show_addcart == 1){ ?>
<div class="yjvmsc_price_cart">
<?php if ($show_price == 1){ ?>
<div class="price"><?php echo $pprice?></div> <?php } ?>
<div class="yjwmsc_moreinfo"><a href="<?php echo JRoute::_($productlink) ?>">подробнее</a></div>
<?php if ($show_addcart == 1){ ?>
<div class="yjvmsc_products_cart">
<form action="index.php?option=com_virtuemart&Itemid=<?php echo $WMItemid ?>" method="post">
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="page" value="shop.cart" />
<input type="hidden" name="Itemid" value="<?php echo $WMItemid ?>" />
<input type="hidden" name="func" value="cartAdd" />
<input type="hidden" name="prod_id" value="<?php echo $produkti->product_id ?>" />
<input type="hidden" name="product_id" value="<?php echo $produkti->product_id ?>" />
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="set_price[]" value="" />
<input type="hidden" name="adjust_price[]" value="" />
<input type="hidden" name="master_product[]" value="" />
<input type="submit" class="yjvmsc_addtocart_button" value="Add to Cart" title="Add to Cart" />
</form>
</div>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
</div>
<div class="left_nav_link" style="height:<?php echo $slide_height ?>;" > <a class="linkBackward" id="linkBackward" style="height:<?php echo $slide_height ?>;" ></a></div>
</div>
<!-- http://www.Youjoomla.com Youjoomla Virtuemart Showcase Module for Joomla 1.5 ends here -->