Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

199
 
299
 
299
 
category_tree.php
_> 11 <?php
  22 /*
<> 3 -  $Id: category_tree.php 199 2005-09-22 15:56:13Z hpdl $
   3+  $Id: category_tree.php 299 2005-11-30 20:51:03Z hpdl $
44 
  55   osCommerce, Open Source E-Commerce Solutions
  66   http://www.oscommerce.com
     
 !
4545         if ($osC_Cache->read('category_tree-' . $_SESSION['language'], 720)) {
  4646           $this->data = $osC_Cache->getCache();
  4747         } else {
<> 48 -          $Qcategories = $osC_Database->query('select c.categories_id, cd.categories_name, c.parent_id 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 -          $Qcategories->bindRaw(':table_categories', TABLE_CATEGORIES);
  50 -          $Qcategories->bindRaw(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
   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+          $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);
   50+          $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
5151           $Qcategories->bindInt(':language_id', $_SESSION['languages_id']);
  5252           $Qcategories->execute();
  5353 
  5454           $this->data = array();
  5555 
  5656           while ($Qcategories->next()) {
<> 57 -            $this->data[$Qcategories->valueInt('parent_id')][$Qcategories->valueInt('categories_id')] = array('name' => $Qcategories->value('categories_name'), 'count' => 0);
   57+            $this->data[$Qcategories->valueInt('parent_id')][$Qcategories->valueInt('categories_id')] = array('name' => $Qcategories->value('categories_name'), 'image' => $Qcategories->value('categories_image'), 'count' => 0);
5858           }
  5959 
  6060           $Qcategories->freeResult();
     
 !
7878       }
  7979     }
  8080 
<>  81+    function reset() {
   82+      $this->root_category_id = 0;
   83+      $this->max_level = 0;
   84+      $this->root_start_string = '';
   85+      $this->root_end_string = '';
   86+      $this->parent_start_string = '';
   87+      $this->parent_end_string = '';
   88+      $this->parent_group_start_string = '<ul>';
   89+      $this->parent_group_end_string = '</ul>';
   90+      $this->child_start_string = '<li>';
   91+      $this->child_end_string = '</li>';
   92+      $this->breadcrumb_separator = '_';
   93+      $this->breadcrumb_usage = true;
   94+      $this->spacer_string = '';
   95+      $this->spacer_multiplier = 1;
   96+      $this->follow_cpath = false;
   97+      $this->cpath_array = array();
   98+      $this->cpath_start_string = '';
   99+      $this->cpath_end_string = '';
   100+      $this->show_category_product_count = (SHOW_COUNTS == 'true') ? true : false;
   101+      $this->category_product_count_start_string = '&nbsp;(';
   102+      $this->category_product_count_end_string = ')';
   103+    }
   104+
81105     function buildBranch($parent_id, $level = 0) {
  82106       $result = $this->parent_group_start_string;
  83107 
     
 !
203227       return $this->buildBranchArray((empty($parent_id) ? $this->root_category_id : $parent_id));
  204228     }
  205229 
<>  230+    function exists($id) {
   231+      foreach ($this->data as $parent => $categories) {
   232+        foreach ($categories as $category_id => $info) {
   233+          if ($id == $category_id) {
   234+            return true;
   235+          }
   236+        }
   237+      }
   238+
   239+      return false;
   240+    }
   241+
   242+    function getData($id) {
   243+      foreach ($this->data as $parent => $categories) {
   244+        foreach ($categories as $category_id => $info) {
   245+          if ($id == $category_id) {
   246+            return array('id' => $id,
   247+                         'name' => $info['name'],
   248+                         'parent_id' => $parent,
   249+                         'image' => $info['image'],
   250+                         'count' => $info['count']
   251+                        );
   252+          }
   253+        }
   254+      }
   255+
   256+      return false;
   257+    }
   258+
<_ 206259     function calculateCategoryProductCount() {
  207260       foreach ($this->data as $parent => $categories) {
  208261         foreach ($categories as $id => $info) {