<?php if (basename(SCRIPT_FILENAME) == FILENAME_PRODUCT_INFO) { $products_id = (int) $HTTP_GET_VARS['products_id']; $other_images_query = tep_db_query("select products_images_image from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int) $products_id . "' and language_id = '" . (int) $languages_id . "' order by products_images_id"); if (tep_db_num_rows($other_images_query) > 0) { $box_info_query = tep_db_query("select blocks_name from " . TABLE_BLOCKS . " where blocks_filename = '" . tep_db_input(basename(__FILE__)) . "' and language_id = '" . (int) $languages_id . "'"); $box_info = tep_db_fetch_array($box_info_query); $author_info_query = tep_db_query("select authors_id from " . TABLE_PRODUCTS . " where products_id = '" . (int) $products_id . "'"); $author_info = tep_db_fetch_array($author_info_query); $block_authors_name = tep_get_authors_info($author_info['authors_id'], DEFAULT_LANGUAGE_ID); $block_product_name = (tep_not_null($block_authors_name) ? $block_authors_name . ': ' : '') . tep_get_products_info($products_id, DEFAULT_LANGUAGE_ID); $boxHeading = sprintf($box_info['blocks_name'], $block_product_name); $pieces = 0; $products_images = array(); $products_images_dir = DIR_WS_IMAGES . 'prints/' . substr(sprintf("%06d", $products_id), 0, -4) . '/' . sprintf("%06d", $products_id) . '/'; while ($other_images = tep_db_fetch_array($other_images_query)) { $pieces++; $image_title = str_replace("'", ''', '‘рагмент ' . $pieces); $products_images[] = array('image_small' => $products_images_dir . 'thumbs/' . $other_images['products_images_image'], 'image_link' => $products_images_dir . $other_images['products_images_image'], 'image_title' => $image_title); } $boxContent = tep_show_images_carousel($products_images, 'pic' . $product_info['products_id']); if (tep_not_null($boxContent)) { include DIR_WS_TEMPLATES_BOXES . 'box1.php'; } } }
<?php if ($session_started == true && $product_check > 0 && is_array($navigation->path)) { $navigation_path_array = array_reverse($navigation->path); $viewed_products = array(); reset($navigation_path_array); while (list($i, $navigation_path_row) = each($navigation_path_array)) { $products_id = $navigation_path_row['real_get']['products_id']; if (basename($navigation_path_row['real_page']) == FILENAME_PRODUCT_INFO && tep_not_null($products_id)) { if ($i == 0 && $products_id == $HTTP_GET_VARS['products_id'] || in_array($products_id, array_keys($viewed_products))) { } else { $product_author_info_query = tep_db_query("select authors_id from " . TABLE_PRODUCTS . " where products_id = '" . (int) $products_id . "'"); $product_author_info = tep_db_fetch_array($product_author_info_query); $products_authors_name = tep_get_authors_info($product_author_info['authors_id'], DEFAULT_LANGUAGE_ID); $products_name = tep_get_products_info($products_id, DEFAULT_LANGUAGE_ID); $products_full_name = (tep_not_null($products_authors_name) ? $products_authors_name . ': ' : '') . $products_name; $viewed_products[$products_id] = array('name' => $products_name, 'full_name' => $products_full_name); } } } $navigation_path_string = ''; if (sizeof($viewed_products) > 2) { // asort($viewed_products); reset($viewed_products); $i = 0; while (list($products_id, $products_info) = each($viewed_products)) { if ($i == 0 && $products_id == $HTTP_GET_VARS['products_id']) { } else { $navigation_path_string .= '<div class="li' . ($i == 0 ? '_first' : '') . '"><div class="level_0"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_id) . '"' . ($HTTP_GET_VARS['products_id'] == $products_id ? ' class="active"' : '') . ' title="' . $products_info['full_name'] . '">' . $products_info['name'] . '</a></div></div>' . "\n"; $i++; }
<?php if (basename(SCRIPT_FILENAME) == FILENAME_PRODUCT_INFO) { $limit = 16; $products_id = (int) $HTTP_GET_VARS['products_id']; $product_additional_info_query = tep_db_query("select authors_id from " . TABLE_PRODUCTS . " where products_id = '" . (int) $products_id . "'"); $product_additional_info = tep_db_fetch_array($product_additional_info_query); if ($product_additional_info['authors_id'] > 0) { $author_products_array = array(); $author_products_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where authors_id = '" . (int) $product_additional_info['authors_id'] . "' and products_id <> '" . (int) $products_id . "' and products_status = '1' order by rand() limit {$limit}"); if (tep_db_num_rows($author_products_query) > 0) { while ($author_products = tep_db_fetch_array($author_products_query)) { $author_products_array[] = $author_products['products_id']; } $boxContent = tep_show_products_carousel($author_products_array, 'author_carousel'); $box_info_query = tep_db_query("select blocks_name from " . TABLE_BLOCKS . " where blocks_filename = '" . tep_db_input(basename(__FILE__)) . "' and language_id = '" . (int) $languages_id . "'"); $box_info = tep_db_fetch_array($box_info_query); $boxHeading = '<a href="' . tep_href_link(FILENAME_AUTHORS, 'authors_id=' . $product_additional_info['authors_id']) . '">' . sprintf($box_info['blocks_name'], tep_get_authors_info($product_additional_info['authors_id'], DEFAULT_LANGUAGE_ID)) . '</a>'; include DIR_WS_TEMPLATES_BOXES . 'box1.php'; } } }