<tr> <td class="smallText"><?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($reviews->fields['customers_name'])); ?> </td> <td class="smallText" align="left"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_long($reviews->fields['date_added'])); ?> </td> </tr> <tr> <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?> " align="left" valign="top" class="main"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews->fields['products_id'] . '&reviews_id=' . $reviews->fields['reviews_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($reviews->fields['products_id'], 'avatar'), $reviews->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?> </td> <td valign="top" class="main"><?php echo zen_break_string(nl2br(zen_output_string_protected(stripslashes(substr($reviews->fields['reviews_text'], 0, 100)))), 60, '-<br />') . (strlen($reviews->fields['reviews_text']) >= 100 ? '..' : '') . '<br /><br /><i>' . sprintf(TEXT_REVIEW_RATING, zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $reviews->fields['reviews_rating'] . '.png', sprintf(TEXT_OF_5_STARS, $reviews->fields['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews->fields['reviews_rating'])) . '</i>'; ?> </td> </tr> <?php $reviews->MoveNext(); } } else { ?> <tr> <td class="plainBox" colspan="2"><?php echo TEXT_NO_REVIEWS;
// | http://www.zen-cart.com/license/2_0.txt. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | license@zen-cart.com so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id$ // ?> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <?php $group_id = zen_get_configuration_key_value('PRODUCT_ALL_LIST_GROUP_ID'); if ($products_all_split->number_of_rows > 0) { $products_all = $gBitDb->Execute($products_all_split->sql_query); while (!$products_all->EOF) { if (PRODUCT_ALL_LIST_IMAGE != '0') { $display_products_image = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'products_id=' . $products_all->fields['products_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($products_all->fields, 'small'), $products_all->fields['products_name'], IMAGE_PRODUCT_ALL_LISTING_WIDTH, IMAGE_PRODUCT_ALL_LISTING_HEIGHT) . '</a>' . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_IMAGE, 3, 1)); } else { $display_products_image = ''; } if (PRODUCT_ALL_LIST_NAME != '0') { $display_products_name = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'products_id=' . $products_all->fields['products_id']) . '"><strong>' . $products_all->fields['products_name'] . '</strong></a>' . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_NAME, 3, 1)); } else { $display_products_name = ''; } if (PRODUCT_ALL_LIST_MODEL != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'model')) { $display_products_model = TEXT_PRODUCTS_MODEL . $products_all->fields['products_model'] . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_MODEL, 3, 1)); } else { $display_products_model = ''; } if (PRODUCT_ALL_LIST_WEIGHT != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'weight')) { $display_products_weight = TEXT_PRODUCTS_WEIGHT . $products_all->fields['products_weight'] . tra('lbs') . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_WEIGHT, 3, 1));
// |zen-cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2003 The zen-cart developers | // | | // | http://www.zen-cart.com/index.php | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | http://www.zen-cart.com/license/2_0.txt. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | license@zen-cart.com so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id$ // ?> <body onload="resize();"> <div class="header"> <h1><?php echo $gBitProduct->getTitle(); ?> </h1> </div> <?php echo zen_image(CommerceProduct::getImageUrlFromHash($gBitProduct->mProductsId, 'large'), $gBitProduct->getTitle()); ?> </body>
$products_image_large = $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extention; // to be built into a single variable string if (file_exists(DIR_WS_IMAGES . 'medium/' . $products_image_medium)) { ?> <script language="javascript" type="text/javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'products_id=' . $_GET['products_id']) . '\\\')">' . zen_image(DIR_WS_IMAGES . 'medium/' . $products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> '); //--></script> <?php } else { ?> <script language="javascript" type="text/javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'products_id=' . $_GET['products_id']) . '\\\')">' . zen_image(CommerceProduct::getImageUrlFromHash($gBitProduct->mProductsId, 'small')) . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> '); //--></script> <?php } ?> <noscript> <?php if (file_exists(DIR_WS_IMAGES . 'medium/' . $products_image_medium)) { if (file_exists(DIR_WS_IMAGES . 'large/' . $products_image_large)) { echo '<a href="' . zen_href_link(DIR_WS_IMAGES . 'large/' . $products_image_large) . '" target="_blank">' . zen_image(DIR_WS_IMAGES . 'medium/' . $products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>'; } else { echo '<a href="' . zen_href_link(DIR_WS_IMAGES . $products_image) . '" target="_blank">' . zen_image(DIR_WS_IMAGES . 'medium/' . $products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>'; } } else {
// | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | license@zen-cart.com so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id$ // ?> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <?php $group_id = zen_get_configuration_key_value('PRODUCT_NEW_LIST_GROUP_ID'); if ($products_new_split->number_of_rows > 0) { $offset = MAX_DISPLAY_PRODUCTS_NEW * (!empty($_REQUEST['page']) ? $_REQUEST['page'] - 1 : 0); $products_new = $gBitDb->query($products_new_split->sql_query, NULL, MAX_DISPLAY_PRODUCTS_NEW, $offset); while (!$products_new->EOF) { if (PRODUCT_NEW_LIST_IMAGE != '0') { $display_products_image = '<a href="' . zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'products_id=' . $products_new->fields['products_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($products_new->fields, 'avatar'), $products_new->fields['products_name']) . '</a>' . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_LIST_IMAGE, 3, 1)); } else { $display_products_image = ''; } if (PRODUCT_NEW_LIST_NAME != '0') { $display_products_name = '<a href="' . zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'products_id=' . $products_new->fields['products_id']) . '"><strong>' . $products_new->fields['products_name'] . '</strong></a>' . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_LIST_NAME, 3, 1)); } else { $display_products_name = ''; } if (PRODUCT_NEW_LIST_MODEL != '0' and zen_get_show_product_switch($products_new->fields['products_id'], 'model')) { $display_products_model = TEXT_PRODUCTS_MODEL . $products_new->fields['products_model'] . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_LIST_MODEL, 3, 1)); } else { $display_products_model = ''; } if (PRODUCT_NEW_LIST_WEIGHT != '0' and zen_get_show_product_switch($products_new->fields['products_id'], 'weight')) { $display_products_weight = '<br />' . TEXT_PRODUCTS_WEIGHT . $products_new->fields['products_weight'] . tra('lbs') . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_LIST_WEIGHT, 3, 1));
if ($products_image == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') { $products_image = PRODUCTS_IMAGE_NO_IMAGE; } $products_image_extention = substr($products_image, strrpos($products_image, '.')); $products_image_base = str_replace($products_image_extention, '', $products_image); $products_image_medium = $products_image_base . IMAGE_SUFFIX_MEDIUM . $products_image_extention; $products_image_large = $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extention; // check for a medium image else use small if (!file_exists(DIR_WS_IMAGES . 'medium/' . $products_image_medium)) { $products_image_medium = DIR_WS_IMAGES . $products_image; } else { $products_image_medium = DIR_WS_IMAGES . 'medium/' . $products_image_medium; } // check for a large image else use medium else use small if (!file_exists(DIR_WS_IMAGES . 'large/' . $products_image_large)) { if (!file_exists(DIR_WS_IMAGES . 'medium/' . $products_image_medium)) { $products_image_large = DIR_WS_IMAGES . $products_image; } else { $products_image_large = DIR_WS_IMAGES . 'medium/' . $products_image_medium; } } else { $products_image_large = DIR_WS_IMAGES . 'large/' . $products_image_large; } */ header('HTTP/1.1 404 Not Found'); exit; $products_image_medium = CommerceProduct::getImageUrlFromHash($_GET['pID'], 'medium'); $products_image_large = CommerceProduct::getImageUrlFromHash($_GET['pID'], 'large');
$lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']); break; case 'PRODUCT_LIST_QUANTITY': $lc_align = 'right'; $lc_text = ' ' . $listing->fields['products_quantity'] . ' '; break; case 'PRODUCT_LIST_WEIGHT': $lc_align = 'right'; $lc_text = ' ' . $listing->fields['products_weight'] . ' '; break; case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; if (isset($_GET['manufacturers_id'])) { $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'manufacturers_id=' . $_GET['manufacturers_id'] . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($listing->fields['products_id'], 'avatar'), $listing->fields['products_name']) . '</a>'; } else { $lc_text = ' <a href="' . CommerceProduct::getDisplayUrlFromId($listing->fields['products_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($listing->fields['products_id'], 'avatar'), $listing->fields['products_name']) . '</a> '; } break; } $list_box_contents[$rows][$col] = array('align' => $lc_align, 'params' => 'class="data"', 'text' => $lc_text); } $listing->MoveNext(); } $error_categories = false; } else { $list_box_contents = array(); $list_box_contents[0] = array('params' => 'class="odd"'); $list_box_contents[0][] = array('params' => 'class="data"', 'text' => TEXT_NO_PRODUCTS); $error_categories = true; } if ($how_many > 0 and $show_submit == 'true' and $listing_split->number_of_rows > 0 and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3)) {
?> </td> </tr></table></td> </tr> <?php } // split page ?> <tr> <?php $row = 0; $offset = MAX_DISPLAY_SPECIAL_PRODUCTS * (!empty($_REQUEST['page']) ? $_REQUEST['page'] - 1 : 0); $specials = $gBitDb->query($specials_split->sql_query, NULL, MAX_DISPLAY_SPECIAL_PRODUCTS, $offset); while (!$specials->EOF) { $row++; echo ' <td valign="bottom" align="center" width="33%" class="smallText"><a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'products_id=' . $specials->fields['products_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($specials->fields['products_id'], 'avatar'), $specials->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'products_id=' . $specials->fields['products_id']) . '">' . $specials->fields['products_name'] . '</a><br />' . CommerceProduct::getDisplayPriceFromHash($specials->fields['products_id']) . '</td>' . "\n"; if ($row / 3 == floor($row / 3)) { ?> </tr> <tr> <?php } $specials->MoveNext(); } ?> </tr> <?php if ($specials_split->number_of_rows > 0 && (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3')) { ?> <tr> <td colspan="3"><table width="100%"><tr>
function zen_get_products_image($product_id, $width = SMALL_IMAGE_WIDTH, $height = SMALL_IMAGE_HEIGHT) { global $gBitDb; return zen_image(CommerceProduct::getImageUrlFromHash($product_id), zen_get_products_name($product_id), $width, $height, 'hspace="5" vspace="5"'); }
$small_height = SMALL_IMAGE_HEIGHT; $medium_width = MEDIUM_IMAGE_WIDTH; $medium_height = MEDIUM_IMAGE_HEIGHT; $large_width = LARGE_IMAGE_WIDTH; $large_height = LARGE_IMAGE_HEIGHT; $k = max($oiheight / $small_height, $oiwidth / $small_width); //use smallest size $small_width = round($oiwidth / $k); $small_height = round($oiheight / $k); $k = max($oiheight / $medium_height, $oiwidth / $medium_width); //use smallest size $medium_width = round($oiwidth / $k); $medium_height = round($oiheight / $k); $large_width = $oiwidth; $large_height = $oiheight; $products_image = CommerceProduct::getImageUrlFromHash($products_id); $products_image_extention = substr($products_image, strrpos($products_image, '.')); $products_image_base = ereg_replace($products_image_extention, '', $products_image); $filename_medium = DIR_FS_CATALOG . DIR_WS_IMAGES . 'medium/' . $products_image_base . IMAGE_SUFFIX_MEDIUM . '.' . $fname[2]; $filename_large = DIR_FS_CATALOG . DIR_WS_IMAGES . 'large/' . $products_image_base . IMAGE_SUFFIX_LARGE . '.' . $fname[2]; // ImageMagick if (IMAGE_MANAGER_HANDLER == '1') { copy($src, $filename_large); copy($src, $filename_medium); exec(DIR_IMAGEMAGICK . "mogrify -geometry " . $large_width . " " . $filename_large); exec(DIR_IMAGEMAGICK . "mogrify -geometry " . $medium_width . " " . $filename_medium); exec(DIR_IMAGEMAGICK . "mogrify -geometry " . $small_width . " " . $filename_small); } } zen_redirect(zen_href_link_admin(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''))); }
$the_button = $lc_button; $products_link = '<a href="' . CommerceProduct::getDisplayUrlFromId($listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; $lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']); break; case 'PRODUCT_LIST_QUANTITY': $lc_align = 'right'; $lc_text = ' ' . $listing->fields['products_quantity'] . ' '; break; case 'PRODUCT_LIST_WEIGHT': $lc_align = 'right'; $lc_text = ' ' . $listing->fields['products_weight'] . ' '; break; case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; if (isset($_GET['manufacturers_id'])) { $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'manufacturers_id=' . $_GET['manufacturers_id'] . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($listing->fields['products_id'], 'avatar'), $listing->fields['products_name']) . '</a>'; } else { $typeClass = BitBase::getParameter($listing->fields, 'type_class', 'CommerceProduct'); if (!empty($listing->fields['type_class_file']) && file_exists(BIT_ROOT_PATH . $listing->fields['type_class_file'])) { require_once BIT_ROOT_PATH . $listing->fields['type_class_file']; } if ($thumbnail = $typeClass::getImageUrlFromHash($listing->fields['products_id'], 'avatar')) { $lc_text = '<a href="' . CommerceProduct::getDisplayUrlFromId($listing->fields['products_id']) . '">' . zen_image($thumbnail, $listing->fields['products_name']) . '</a>'; } } break; } $list_box_contents[$rows][$col] = array('align' => $lc_align, 'params' => 'class="data"', 'text' => $lc_text); } $listing->MoveNext(); }
function zen_display_banner($action, $identifier) { global $gBitDb; if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { $my_banner_filter = " and banners_on_ssl= " . "'1' "; } else { $my_banner_filter = ''; } if ($action == 'dynamic') { $new_banner_search = zen_build_banners_group($identifier); $banners_query = "SELECT count(*) as `bcount`\n FROM " . TABLE_BANNERS . "\n WHERE `status` = '1' " . $new_banner_search . $my_banner_filter; if ($bannerCount = $gBitDb->getOne($banners_query)) { $banner = $gBitDb->getRow("SELECT `banners_id`, `banners_title`, `banners_image`, `banners_html_text`, `banners_open_new_windows`\n FROM " . TABLE_BANNERS . "\n WHERE `status` = '1' " . $new_banner_search . $my_banner_filter . " order by " . $gBitDb->convertSortmode('random')); } else { return '<strong>ZEN ERROR! (zen_display_banner(' . $action . ', ' . $identifier . ') -> No banners with group \'' . $identifier . '\' found!</strong>'; } } elseif ($action == 'static') { if (is_object($identifier)) { $banner = $identifier->fields; } else { $banner_query = "select `banners_id`, `banners_title`, `banners_image`, `banners_html_text`, `banners_open_new_windows`\n from " . TABLE_BANNERS . "\n where `status` = '1'\n and `banners_id` = '" . (int) $identifier . "'" . $my_banner_filter; if ($banner = $gBitDb->getRow($banner_query)) { //return '<strong>ZEN ERROR! (zen_display_banner(' . $action . ', ' . $identifier . ') -> Banner with ID \'' . $identifier . '\' not found, or status inactive</strong>'; } } } else { return '<strong>ZEN ERROR! (zen_display_banner(' . $action . ', ' . $identifier . ') -> Unknown $action parameter value - it must be either \'dynamic\' or \'static\'</strong>'; } if (zen_not_null($banner['banners_html_text'])) { $banner_string = $banner['banners_html_text']; } else { if ($banner['banners_open_new_windows'] == '1') { $banner_string = '<a href="' . zen_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($banner['banners_image']), $banner['banners_title']) . '</a>'; } else { $banner_string = '<a href="' . zen_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($banner['banners_image']), $banner['banners_title']) . '</a>'; } } zen_update_banner_display_count($banner['banners_id']); return $banner_string; }