function b_best_sellers() { global $current_catgeroy_id, $languages_id, $xoopsDB, $xoopsConfig; $block = array(); /*if(!defined("XOSC_BLOCK") && !defined("XOSC_CONFIG")) { define("XOSC_BLOCK",1); require_once(XOOPS_ROOT_PATH."/modules/osC/includes/application_top.php"); } */ // Config part require_once XOOPS_ROOT_PATH . "/modules/osC/includes/configure.php"; require_once XOOPS_ROOT_PATH . "/modules/osC/includes/database_tables.php"; require_once XOOPS_ROOT_PATH . "/modules/osC/includes/filenames.php"; require_once XOOPS_ROOT_PATH . "/modules/osC/includes/functions/database.php"; require_once XOOPS_ROOT_PATH . "/modules/osC/includes/functions/general.php"; require_once XOOPS_ROOT_PATH . "/modules/osC/includes/functions/html_output.php"; require_once XOOPS_ROOT_PATH . "/modules/osC/includes/classes/boxes.php"; if (!defined('XBLOCK_CONFIG')) { $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION); while ($configuration = tep_db_fetch_array($configuration_query)) { define($configuration['cfgKey'], $configuration['cfgValue']); } define('XBLOCK_CONFIG', "1"); } if (!isset($_SESSION['languages_id'])) { $lang_query = "select languages_id from " . TABLE_LANGUAGES . " where directory ='" . $xoopsConfig['language'] . "'"; $lang = tep_db_query($lang_query); $lang_id = tep_db_fetch_array($lang); $languages_id = $lang_id['languages_id']; } else { $languages_id = $_SESSION['languages_id']; } // box part if (isset($current_category_id) && $current_category_id > 0) { $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name 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) $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) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS); } else { $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name 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) $languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS); } if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) { // $info_box_contents = array(); // $info_box_contents[] = array('text' => BOX_HEADING_BESTSELLERS); // new infoBoxHeading($info_box_contents, false, false); $rows = 0; $bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">'; while ($best_sellers = tep_db_fetch_array($best_sellers_query)) { $rows++; $bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></td></tr>'; } $bestsellers_list .= '</table>'; $info_box_contents = array(); $info_box_contents[] = array('text' => $bestsellers_list); $block = new infoBox($info_box_contents); /// $block['content']=$tblock->content; } return $block->content; }
*/ if (isset($current_category_id) && $current_category_id > 0) { $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name 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) $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) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS); } else { $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name 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) $languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS); } if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) { ?> <!-- best_sellers //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_BESTSELLERS); new infoBoxHeading($info_box_contents, false, false); $rows = 0; $bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">'; while ($best_sellers = tep_db_fetch_array($best_sellers_query)) { $rows++; $bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a class="remote" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></td></tr>'; } $bestsellers_list .= '</table>'; $info_box_contents = array(); $info_box_contents[] = array('text' => $bestsellers_list); new infoBox($info_box_contents); ?> </td> </tr> <!-- best_sellers_eof //--> <?php }
CRE Loaded, Open Source E-Commerce Solutions http://www.creloaded.com Copyright (c) 2008 CRE Loaded Copyright (c) 2003 osCommerce Released under the GNU General Public License */ $best = new box_best_sellers_scroll(); if (count($best->rows) >= MIN_DISPLAY_BESTSELLERS) { ?> <!-- best_sellers_scroll //--> <div class="well"> <div class="box-header small-margin-bottom small-margin-left"><?php echo BOX_HEADING_BESTSELLERS_SCROLL; ?> </div> <?php $rows = 0; $bestsellers_list = '<div style="text-align: center;">'; foreach ($best->rows as $best_sellers) { $rows++; $bestsellers_list .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $best_sellers['products_image'], $best_sellers['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>' . tep_row_number_format($rows) . ' . <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a><br><br>' . "\n\n"; } $bestsellers_list .= '</div>'; echo '<MARQUEE behavior= "scroll" align="center" direction="up" height="100" scrollamount="2" scrolldelay="70" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>' . $bestsellers_list . '</MARQUEE>'; ?> </div> <!-- best_sellers_scroll_eof //--> <?php }
$Qbestsellers->bindRaw(':table_products_description', TABLE_PRODUCTS_DESCRIPTION); $Qbestsellers->bindInt(':language_id', $osC_Session->value('languages_id')); $Qbestsellers->bindInt(':max_display_bestsellers', MAX_DISPLAY_BESTSELLERS); $Qbestsellers->execute(); } if ($Qbestsellers->numberOfRows() >= MIN_DISPLAY_BESTSELLERS) { ?> <!-- best_sellers //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_BESTSELLERS); new infoBoxHeading($info_box_contents, false, false); $rows = 0; $bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">'; while ($Qbestsellers->next()) { $rows++; $bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $Qbestsellers->valueInt('products_id')) . '">' . $Qbestsellers->value('products_name') . '</a></td></tr>'; } $bestsellers_list .= '</table>'; $info_box_contents = array(); $info_box_contents[] = array('text' => $bestsellers_list); new infoBox($info_box_contents); $Qbestsellers->freeResult(); ?> </td> </tr> <!-- best_sellers_eof //--> <?php }
$best = new box_best_sellers(); if (count($best->rows) >= MIN_DISPLAY_BESTSELLERS) { ?> <!-- best_sellers //--> <div class="well" > <div class="box-header small-margin-bottom small-margin-left"><?php echo BOX_HEADING_BESTSELLERS; ?> </div> <?php $rows = 0; foreach ($best->rows as $best_sellers) { $rows++; $bestsellers_list .= '<p>' . tep_row_number_format($rows) . ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></p>'; } echo '<div style="margin-left:5px">' . $bestsellers_list . '</div>'; ?> <script> $('.box-product-categories-ul-top').addClass('list-unstyled list-indent-large'); $('.box-product-categories-ul').addClass('list-unstyled list-indent-large'); </script> </div> <!-- best_sellers eof//-->
$best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "' and find_in_set('" . $customer_group_id . "', p.products_hide_from_groups) = '0' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS); } // EOF Hide products and categories from groups if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) { ?> <!-- best_sellers //--> <?php $boxHeading = BOX_HEADING_BESTSELLERS; $corner_top_left = 'rounded'; $corner_top_right = 'rounded'; $corner_bottom_left = 'rounded'; $corner_bottom_right = 'rounded'; $boxContent_attributes = ''; $boxLink = ''; $box_base_name = 'best_sellers'; // for easy unique box template setup (added BTSv1.2) $box_id = $box_base_name . 'Box'; // for CSS styling paulm (editted BTSv1.2) $rows = 0; $boxContent = '<table border="0" width="100%" cellspacing="0" cellpadding="1">'; while ($best_sellers = tep_db_fetch_array($best_sellers_query)) { $rows++; $boxContent .= '<tr><td class="boxText" valign="top">' . tep_row_number_format($rows) . '.</td><td class="boxText"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></td></tr>'; } $boxContent .= '</table>'; include bts_select('boxes', $box_base_name); // BTS 1.5 } //} ?> <!-- best_sellers eof //-->