  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: category_tree.php 345 2005-12-10 10:58:35Z hpdl $ |
| |
| 3 | + | $Id: category_tree.php 377 2006-01-09 14:47:49Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
35 | 35 | | $category_product_count_end_string = ')'; |
| |
36 | 36 | | |
| |
37 | 37 | | function osC_CategoryTree($load_from_database = true) { |
  |
38 | | - | global $osC_Database, $osC_Cache; |
| |
| 38 | + | global $osC_Database, $osC_Cache, $osC_Language; |
|
39 | 39 | | |
| |
40 | 40 | | if (SERVICES_CATEGORY_PATH_CALCULATE_PRODUCT_COUNT == '1') { |
| |
41 | 41 | | $this->show_category_product_count = true; |
| |
42 | 42 | | } |
| |
43 | 43 | | |
| |
44 | 44 | | if ($load_from_database === true) { |
  |
45 | | - | if ($osC_Cache->read('category_tree-' . $_SESSION['language'], 720)) { |
| |
| 45 | + | if ($osC_Cache->read('category_tree-' . $osC_Language->getCode(), 720)) { |
|
46 | 46 | | $this->data = $osC_Cache->getCache(); |
| |
47 | 47 | | } else { |
| |
48 | 48 | | $Qcategories = $osC_Database->query('select c.categories_id, c.parent_id, c.categories_image, cd.categories_name from :table_categories c, :table_categories_description cd where c.categories_id = cd.categories_id and cd.language_id = :language_id order by c.parent_id, c.sort_order, cd.categories_name'); |
| |
49 | 49 | | $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES); |
| |
50 | 50 | | $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION); |
  |
51 | | - | $Qcategories->bindInt(':language_id', $_SESSION['languages_id']); |
| |
| 51 | + | $Qcategories->bindInt(':language_id', $osC_Language->getID()); |
  |
52 | 52 | | $Qcategories->execute(); |
| |
53 | 53 | | |
| |
54 | 54 | | $this->data = array(); |