Oh sorry! Thank you.
Hmm well that's still broken:
This is the whole file:
Code:
<?php
/**
* Side Box Template
*
* @package templateSystem
* @copyright Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_best_sellers.php 2982 2006-02-07 07:56:41Z birdbrain $
*/
$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
$content .= '<div class="wrapper">' . "\n" . '<ol>' . "\n";
for ($i=1; $i<=sizeof($bestsellers_list); $i++) {
$content .= '<li><a href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . zen_trunc_string($bestsellers_list[$i]['name'], BEST_SELLERS_TRUNCATE, BEST_SELLERS_TRUNCATE_MORE) . '</a></li>' . "\n";
}
$content .= '</ol>' . "\n";
$content .= '</div>' . "\n";
$content .= '</div>';
?>
if (isset($current_category_id) && ($current_category_id > 0)) {
$best_sellers_query = "select distinct p.products_id, pd.products_name, p.products_ordered
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, "
. TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c
where (p.products_status = '1'
and p.products_ordered > 0
and p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p.products_id = p2c.products_id
and p2c.categories_id = c.categories_id
and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id))
AND p.products_id NOT IN (SELECT products_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE categories_id IN (34, 108, 58, 55))
order by p.products_ordered desc, pd.products_name
limit " . MAX_DISPLAY_BESTSELLERS;
$best_sellers = $db->Execute($best_sellers_query);
} else {
$best_sellers_query = "select distinct p.products_id, pd.products_name, p.products_ordered
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where (p.products_status = '1'
and p.products_ordered > 0
and p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "')
AND p.products_id NOT IN (SELECT products_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE categories_id IN (34, 108, 58, 55))
order by p.products_ordered desc, pd.products_name
limit " . MAX_DISPLAY_BESTSELLERS;
$best_sellers = $db->Execute($best_sellers_query);
}
Bookmarks