function zen_image($src, $alt = '', $width = '', $height = '', $parameters = '') { global $template_dir; // soft clean the alt tag $alt = zen_clean_html($alt); // use old method on template images if (strstr($src, 'includes/templates') or strstr($src, 'includes/languages') or PROPORTIONAL_IMAGES_STATUS == '0') { return zen_image_OLD($src, $alt, $width, $height, $parameters); } //auto replace with defined missing image if ($src == DIR_WS_IMAGES and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') { $src = DIR_WS_IMAGES . PRODUCTS_IMAGE_NO_IMAGE; } if ((empty($src) || $src == DIR_WS_IMAGES) && IMAGE_REQUIRED == 'false') { return false; } // if not in current template switch to template_default if (!file_exists($src)) { $src = str_replace(DIR_WS_TEMPLATES . $template_dir, DIR_WS_TEMPLATES . 'template_default', $src); } // hook for handle_image() function such as Image Handler etc if (function_exists('handle_image')) { $newimg = handle_image($src, $alt, $width, $height, $parameters); list($src, $alt, $width, $height, $parameters) = $newimg; } // Convert width/height to int for proper validation. // intval() used to support compatibility with plugins like image-handler $width = empty($width) ? $width : intval($width); $height = empty($height) ? $height : intval($height); // alt is added to the img tag even if it is null to prevent browsers from outputting // the image filename as default $image = '<img src="' . zen_output_string($src) . '" alt="' . zen_output_string($alt) . '"'; if (zen_not_null($alt)) { $image .= ' title=" ' . zen_output_string($alt) . ' "'; } if (CONFIG_CALCULATE_IMAGE_SIZE == 'true' && (empty($width) || empty($height))) { if ($image_size = @getimagesize($src)) { if (empty($width) && zen_not_null($height)) { $ratio = $height / $image_size[1]; $width = $image_size[0] * $ratio; } elseif (zen_not_null($width) && empty($height)) { $ratio = $width / $image_size[0]; $height = $image_size[1] * $ratio; } elseif (empty($width) && empty($height)) { $width = $image_size[0]; $height = $image_size[1]; } } elseif (IMAGE_REQUIRED == 'false') { return false; } } if (zen_not_null($width) && zen_not_null($height) and file_exists($src)) { // $image .= ' width="' . zen_output_string($width) . '" height="' . zen_output_string($height) . '"'; // proportional images $image_size = @getimagesize($src); // fix division by zero error $ratio = $image_size[0] != 0 ? $width / $image_size[0] : 1; if ($image_size[1] * $ratio > $height) { $ratio = $height / $image_size[1]; $width = $image_size[0] * $ratio; } else { $height = $image_size[1] * $ratio; } // only use proportional image when image is larger than proportional size if ($image_size[0] < $width and $image_size[1] < $height) { $image .= ' width="' . $image_size[0] . '" height="' . intval($image_size[1]) . '"'; } else { $image .= ' width="' . round($width) . '" height="' . round($height) . '"'; } } else { // override on missing image to allow for proportional and required/not required if (IMAGE_REQUIRED == 'false') { return false; } else { $image .= ' width="' . intval(SMALL_IMAGE_WIDTH) . '" height="' . intval(SMALL_IMAGE_HEIGHT) . '"'; } } // inject rollover class if one is defined. NOTE: This could end up with 2 "class" elements if $parameters contains "class" already. if (defined('IMAGE_ROLLOVER_CLASS') && IMAGE_ROLLOVER_CLASS != '') { $parameters .= (zen_not_null($parameters) ? ' ' : '') . 'class="rollover"'; } // add $parameters to the tag output if (zen_not_null($parameters)) { $image .= ' ' . $parameters; } $image .= ' />'; return $image; }
function zen_image($src, $alt = '', $width = '', $height = '', $parameters = '') { global $template_dir; // soft clean the alt tag $alt = zen_clean_html($alt); // use old method on template images if (strstr($src, 'includes/templates') or strstr($src, 'includes/languages') or PROPORTIONAL_IMAGES_STATUS == '0') { return zen_image_OLD($src, $alt, $width, $height, $parameters); } //auto replace with defined missing image if ($src == DIR_WS_IMAGES and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') { $src = DIR_WS_IMAGES . PRODUCTS_IMAGE_NO_IMAGE; } if ((empty($src) || $src == DIR_WS_IMAGES) && IMAGE_REQUIRED == 'false') { return false; } // if not in current template switch to template_default if (!file_exists($src)) { $src = str_replace(DIR_WS_TEMPLATES . $template_dir, DIR_WS_TEMPLATES . 'template_default', $src); } // alt is added to the img tag even if it is null to prevent browsers from outputting // the image filename as default $image = '<img src="' . zen_output_string($src) . '" alt="' . zen_output_string($alt) . '"'; if (zen_not_null($alt)) { $image .= ' title=" ' . zen_output_string($alt) . ' "'; } $srcPath = BIT_ROOT_PATH . $src; if (CONFIG_CALCULATE_IMAGE_SIZE == 'true' && (empty($width) || empty($height))) { if ($image_size = @getimagesize($srcPath)) { if (empty($width) && zen_not_null($height)) { $ratio = $height / $image_size[1]; $width = $image_size[0] * $ratio; } elseif (zen_not_null($width) && empty($height)) { $ratio = $width / $image_size[0]; $height = $image_size[1] * $ratio; } elseif (empty($width) && empty($height)) { $width = $image_size[0]; $height = $image_size[1]; } } elseif (IMAGE_REQUIRED == 'false') { return false; } } if (zen_not_null($width) && zen_not_null($height) and file_exists($srcPath)) { // $image .= ' width="' . zen_output_string($width) . '" height="' . zen_output_string($height) . '"'; // proportional images $image_size = @getimagesize($srcPath); // fix division by zero error $ratio = $image_size[0] != 0 ? $width / $image_size[0] : 1; if ($image_size[1] * $ratio > $height) { $ratio = $height / $image_size[1]; $width = $image_size[0] * $ratio; } else { $height = $image_size[1] * $ratio; } $image .= ' width="' . $width . '" height="' . $height . '"'; } else { // override on missing image to allow for proportional and required/not required if (IMAGE_REQUIRED == 'false') { return false; } else { // $image .= ' width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '"'; } } if (zen_not_null($parameters)) { $image .= ' ' . $parameters; } $image .= ' />'; return $image; }
} else { $discount = 0; } if ($list_box_contents[$row]['products_quantity'] == 0) { ?> <span class="sold_out_b"></span> <?php } elseif (!empty($specials_price)) { ?> <span class="sold_discount_gallery"><div class="sold_discount_font"><?php echo $discount; ?> </div></span> <?php } echo $list_box_contents[$row]['product_is_sale_item'] . '<a href="' . zen_href_link(zen_get_info_page($list_box_contents[$row]['products_id']), 'cPath=' . zen_get_generated_category_path_rev($_GET['cPath']) . '&products_id=' . $list_box_contents[$row]['products_id']) . '" class="ih" >' . zen_image_OLD(DIR_WS_IMAGES . substr_replace($list_box_contents[$row]['products_image'], 'l/', 0, 2), $list_box_contents[$row]['products_name'], 228, 228, 'class=""') . '</a>'; ?> </li> <p> <?php echo '<a href="' . zen_href_link(zen_get_info_page($list_box_contents[$row]['products_id']), 'cPath=' . zen_get_generated_category_path_rev($_GET['cPath']) . '&products_id=' . $list_box_contents[$row]['products_id']) . '" >' . $list_box_contents_name[$row] . '</a><br/><br/>'; if ($list_box_contents[$row]['product_is_wholesale']) { echo '<span class="sale_item_b"></span>'; } echo $list_box_contents[$row]['product_is_free']; echo $list_box_contents[$row]['product_is_always_free_shipping']; ?> </p> <div class="black line_120 margin_t"> <strong>Our Price: </strong> <?php
$row = 0; $col = 0; $list_box_contents = array(); $title = ''; // show only when 1 or more and equal to or greater than minimum set in admin if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED && $num_products_ordered > 0) { while (!$also_purchased_products->EOF) { //caizhouqing update by bof $rs = $db->Execute("select specials_new_products_price,products_id from specials where products_id=" . $also_purchased_products->fields['products_id']); $products_id = $rs->fields['products_id']; if ($products_id == $also_purchased_products->fields['products_id']) { $specials_price = $rs->fields['specials_new_products_price']; } else { $specials_price = zen_get_products_base_price($also_purchased_products->fields['products_id']); } //caizhouqing update by eof pro_show_right $also_purchased_products->fields['products_name'] = zen_get_products_name($also_purchased_products->fields['products_id']); $list_box_contents[$row][$col] = array('params' => 'class="top_selling"', 'text' => (($also_purchased_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<li><a href="' . zen_href_link(zen_get_info_page($also_purchased_products->fields['products_id']), 'products_id=' . $also_purchased_products->fields['products_id']) . '">' . zen_image_OLD(DIR_WS_IMAGES . $also_purchased_products->fields['products_image'], $also_purchased_products->fields['products_name'], '42', '42', ' class="fl"') . '</a>') . '<span><a href="' . zen_href_link(zen_get_info_page($also_purchased_products->fields['products_id']), 'products_id=' . $also_purchased_products->fields['products_id']) . '">' . substr($also_purchased_products->fields['products_name'], 0, 16) . '...' . '</a><br/><strong class="red">' . $currencies->display_price($specials_price, zen_get_tax_rate($products_tax_class_id)) . '</strong></span></li>'); $col++; if ($col > SHOW_PRODUCT_INFO_COLUMNS_ALSO_PURCHASED_PRODUCTS - 1) { $col = 0; $row++; } $also_purchased_products->MoveNext(); } } if ($also_purchased_products->RecordCount() > 0 && $also_purchased_products->RecordCount() >= MIN_DISPLAY_ALSO_PURCHASED) { $title = '<h4 class="line_120 margin_t">' . TEXT_ALSO_PURCHASED_PRODUCTS . '</h4>'; $zc_show_also_purchased = true; } }
<link rel="stylesheet" type="text/css" href="includes/templates/chanelwatches/css/pic_vImageBox.css"> <script type="text/javascript" src="includes/templates/chanelwatches/jscript/pic_vJquery.js"></script> <script type="text/javascript" src="includes/templates/chanelwatches/jscript/pic_vJqueryImages.js"></script> <div id="product_flash" style="width: 335px;" class="fl margin_t g_t_c"> <ul> <li> <?php if (!is_array($products_image_medium)) { $products_image_large = array($products_image_large); $products_image_medium = array($products_image_medium); $products_image_small = array($products_image_small); } //print_r($products_image_small); if (is_array($products_image_medium)) { echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . $products_image_large[0] . '" class="ih" id="product_flash_show" target="_blank">' . zen_image_OLD($products_image_medium[0], addslashes($products_name), '280', '280', 'id="product_flash_show_i" class="relative"') . '</a>'; } ?> <?php //check whether jqzoom if (MEDIUM_IMAGE_JQZOOM == 'yes') { ?> <link rel="stylesheet" type="text/css" href="includes/templates/chanelwatches/jscript/jqzoom_ev1.0.1/css/jqzoom.css" /> <script type="text/javascript" src="includes/templates/chanelwatches/jscript/jqzoom_ev1.0.1/js/jqzoom.pack.1.0.1.js"></script> <script type="text/javascript"> $('#product_flash_show').jqzoom(); </script> <?php } ?> </li>
?> " imgSize="280" big="<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_large[$i]; ?> "/></li> <?php } ?> </ul> <script type="text/javascript" src="includes/modules/pages/product_info/jscript_productZoom.js"></script> <script type="text/javascript"> initBtn('smallImgBtns','ZoomBox'); </script> </div> </body> <?php } else { ?> <body id="popupImage" class="centeredContent" onLoad="resize();"> <a href="javascript:window.close()" target="_self"> <?php echo zen_image_OLD($products_image_large, addslashes($products_name) . ' ' . TEXT_CLOSE_WINDOW); ?> </a> </body> <?php } ?>
<li id="li<?php echo $i; ?> " style="display:block;"> <span id="discount<?php echo $i; ?> "></span> <a class="ih" id="cell_link<?php echo $i; ?> " href="<?php echo zen_href_link(zen_get_info_page($flash_page_items[$i]['products_id']), 'products_id=' . $flash_page_items[$i]['products_id']); ?> "><?php echo zen_image_OLD(DIR_WS_IMAGES . $flash_page_items[$i]['products_image'], SEO_COMMON_KEYWORDS . ' ' . $flash_page_items[$i]['products_name'], 79, 79, 'id="cell_img' . $i . '" class="' . ($flash_page_items[$i]['products_id'] == $_GET['products_id'] ? 'imgborder' : '') . '"'); ?> </a><p><strong id="cell_price<?php echo $i; ?> " class="red"><?php if (!empty($flash_page_items[$i]['specials_price'])) { //caizhouqing by bof $products_price = $products_price * ($flash_page_items[$i]['specials_price'] / $products_price); echo $list_box_contents[$row]['products_price'] == 0 ? $currencies->display_price($products_price, zen_get_tax_rate($products_tax_class_id)) : $currencies->display_price($products_price, zen_get_tax_rate($products_tax_class_id)); } else { //caizhouqing by eof echo $currencies->display_price(zen_get_products_base_price($flash_page_items[$i]['products_id']) == 0 ? zen_get_products_sample_price($flash_page_items[$i]['products_id']) : zen_get_products_base_price($flash_page_items[$i]['products_id']), zen_get_tax_rate($product_check->fields['products_tax_class_id'])); } ?> </strong></p>
<!-- BOF Recently Sold items caizhouqing update pro_show_right--> <?php $recently_sold_query = "SELECT distinct o.`products_id`, o.`products_name` ,p.`products_image`\n FROM orders_products o, orders o1, products p\n WHERE o1.orders_id=o.orders_id \n AND p.products_id=o.products_id \n AND p.`products_status`=1 \n ORDER BY o1.`date_purchased` DESC LIMIT 30"; $recently_sold = $db->Execute($recently_sold_query); if ($recently_sold->RecordCount() > 0) { echo '<div class="allborder"><h3 class="pad_10px">Recently Sold items</h3>'; echo zen_image($template->get_template_dir('go_up.gif', DIR_WS_TEMPLATE, $current_page_base, 'images') . '/' . 'go_up.gif', '', '', '', ' id="goup" class="hand"'); echo '<div id="recently_sold_items" style="overflow: hidden; height: 500px;">'; echo '<ul id="recently_sold_items_a" class="top_selling pad_10px pad_t" >'; while (!$recently_sold->EOF) { echo '<li class="clear"><a href="' . zen_href_link(zen_get_info_page($recently_sold->fields['products_id']), 'products_id=' . $recently_sold->fields['products_id']) . '">' . zen_image_OLD(DIR_WS_IMAGES . $recently_sold->fields['products_image'], $recently_sold->fields['products_name'], 42, 42, ' class="fl"') . '</a>'; echo '<span><a href="' . zen_href_link(zen_get_info_page($recently_sold->fields['products_id']), 'products_id=' . $recently_sold->fields['products_id']) . '">' . substr($recently_sold->fields['products_name'], 0, 20) . '...' . '</a><br/><strong class="red">'; //caizhouqing update by bof $rs = $db->Execute("select specials_new_products_price,products_id from specials where products_id=" . $recently_sold->fields['products_id'] . " and status=1"); //liuyi update specials price $specials_price = $rs->fields['specials_new_products_price']; $products_id = $rs->fields['products_id']; if ($products_id == $recently_sold->fields['products_id']) { echo $currencies->display_price($specials_price, zen_get_tax_rate($products_tax_class_id)); } else { echo $currencies->display_price(zen_get_products_base_price($recently_sold->fields['products_id']), zen_get_tax_rate($products_tax_class_id)); } echo '</strong></span></li>'; $recently_sold->MoveNext(); } //caizhouqing update by eof echo '</ul>'; echo '<ul id="recently_sold_items_b" class="top_selling pad_10px pad_t" ></ul></div>'; echo zen_image($template->get_template_dir('go_down.gif', DIR_WS_TEMPLATE, $current_page_base, 'images') . '/' . 'go_down.gif', '', '', '', ' id="godown" class="hand"'); echo '</div>'; ?>
echo BASE_COMMON_TEXT_TOPSELLINGIN . zen_get_categories_name($current_category_id); ?> </h2> <ul class="top_selling"> <?php while (!$topSelling->EOF) { ?> <li> <a title="<?php echo $topSelling->fields['products_name']; ?> " href="<?php echo zen_href_link(zen_get_info_page($topSelling->fields['products_id']), 'products_id=' . $topSelling->fields['products_id']); ?> "><?php echo zen_image_OLD(DIR_WS_IMAGES . $topSelling->fields['products_image'], $topSelling->fields['products_name'], 42, 42, 'class="fl"'); ?> </a> <span><a title="<?php echo $topSelling->fields['products_name']; ?> " href="<?php echo zen_href_link(zen_get_info_page($topSelling->fields['products_id']), 'products_id=' . $topSelling->fields['products_id']); ?> "><?php echo substr($topSelling->fields['products_name'], 0, 16) . (strlen($topSelling->fields['products_name']) > 16 ? '...' : ''); ?> </a><br/> <strong class="red"><?php echo $currencies->display_price(zen_get_products_base_price($topSelling->fields['products_id']) == 0 ? zen_get_products_sample_price($topSelling->fields['products_id']) : zen_get_products_base_price($topSelling->fields['products_id']), zen_get_tax_rate($topSelling->fields['products_id'])); ?>
$list_box_contents = array(); $title = ''; $num_products_count = $featured_products_query == '' ? 0 : $featured_products->RecordCount(); // show only when 1 or more if ($num_products_count > 0) { if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS == 0) { $col_width = floor(100 / $num_products_count); } else { $col_width = floor(100 / SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS); } while (!$featured_products->EOF) { $products_price = zen_get_products_display_final_price($featured_products->fields['products_id']); if (!isset($productsInCategory[$featured_products->fields['products_id']])) { $productsInCategory[$featured_products->fields['products_id']] = zen_get_generated_category_path_rev($featured_products->fields['master_categories_id']); } $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsFeatured centeredContent back"' . ' ', 'text' => (($featured_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . $productsInCategory[$featured_products->fields['products_id']] . '&products_id=' . $featured_products->fields['products_id']) . '" class="ih" >' . zen_image_OLD(DIR_WS_IMAGES . $featured_products->fields['products_image'], $featured_products->fields['products_name'], 86, 86) . '</a>') . '<br /><p class="b red g_t_c">' . $products_price . '</p>'); // /* <a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . $productsInCategory[$featured_products->fields['products_id']] . '&products_id=' . $featured_products->fields['products_id']) . '">' . $featured_products->fields['products_name'] . '</a> */ // $col++; if ($col > SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS - 1) { $col = 0; $row++; } $featured_products->MoveNextRandom(); } if ($featured_products->RecordCount() > 0) { if (isset($new_products_category_id) && $new_products_category_id != 0) { $category_title = zen_get_categories_name((int) $new_products_category_id);