[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/includes/boxes/ -> best_sellers.php (source)

   1  <?php
   2  /*

   3  $Id: best_sellers.php 3 2006-05-27 04:59:07Z user $

   4  

   5    osCMax Power E-Commerce

   6    http://oscdox.com

   7  

   8    Copyright 2006 osCMax

   9  

  10    Released under the GNU General Public License

  11  */
  12  
  13  // Most of this file is changed or moved to BTS - Basic Template System - format.

  14  //  if (isset($HTTP_GET_VARS['products_id'])) {

  15    if (isset($current_category_id) && ($current_category_id > 0)) {
  16      $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);
  17    } else {
  18      $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);
  19    }
  20  
  21    if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) {
  22  ?>
  23  <!-- best_sellers //-->
  24  <?php
  25    $boxHeading = BOX_HEADING_BESTSELLERS;
  26    $corner_left = 'square';
  27    $corner_right = 'square';
  28    $box_base_name = 'best_sellers'; // for easy unique box template setup (added BTSv1.2)

  29    $box_id = $box_base_name . 'Box';  // for CSS styling paulm (editted BTSv1.2)

  30  
  31    $rows = 0;
  32    $boxContent = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
  33    while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
  34      $rows++;
  35      $boxContent .= '<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>';
  36    }
  37    $boxContent .= '</table>';
  38  
  39  
  40  include (bts_select('boxes', $box_base_name)); // BTS 1.5

  41  
  42    }
  43  //}

  44  ?>
  45  <!-- best_sellers eof //-->


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7