private function build_categories_string($counter)
 {
     global $cPath_array, $column_location;
     // end background variables
     $this->categories_string .= '<ul class="box-information_pages-ul list-unstyled list-indent-large">';
     $style_padding = "0";
     for ($i = 0; $i < $this->tree[$counter]['level']; $i++) {
         //$this->categories_string .= "&nbsp; &nbsp;";
         $style_padding += 10;
     }
     $css_indent = '';
     if ($style_padding > 0) {
         $css_indent = ' style="padding-left:' . $style_padding . 'px"';
     }
     $this->categories_string .= '<li' . $css_indent . '>';
     $this->categories_string .= '<a href="';
     if ($this->tree[$counter]['parent'] == 0) {
         $cPath_new = 'cPath=' . $counter;
     } else {
         $cPath_new = 'cPath=' . $this->tree[$counter]['path'];
     }
     $this->categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
     if (isset($cPath_array) && in_array($counter, $cPath_array)) {
         $this->categories_string .= '<b>';
     }
     // display category name
     $this->categories_string .= tep_db_decoder($this->tree[$counter]['name']);
     if (isset($cPath_array) && in_array($counter, $cPath_array)) {
         $this->categories_string .= '</b>';
     }
     $this->categories_string .= '</a>';
     if (SHOW_COUNTS == 'true') {
         $products_in_category = tep_count_products_in_category($counter);
         if ($products_in_category > 0) {
             $this->categories_string .= '&nbsp;<span class="category_count">(' . $products_in_category . ')</span>';
         }
     }
     $this->categories_string .= '</li></ul>' . "\n";
     if ($this->tree[$counter]['next_id'] != false) {
         $this->build_categories_string($this->tree[$counter]['next_id']);
     }
 }
function tep_show_category3($cid, $cpath, $COLLAPSABLE, $level = 0)
{
    global $categories_string3, $languages_id, $categories;
    $selectedPath = array();
    // Get all of the categories on this level
    $level++;
    $customer_group_array = array();
    if (!isset($_SESSION['sppc_customer_group_id'])) {
        $customer_group_array[] = 'G';
    } else {
        $customer_group_array = tep_get_customers_access_group($_SESSION['customer_id']);
    }
    $categories_query_raw = "SELECT c.categories_id, cd.categories_name, c.parent_id\r\n                             from " . TABLE_CATEGORIES . " c,\r\n                                  " . TABLE_CATEGORIES_DESCRIPTION . " cd\r\n                           WHERE c.parent_id = '" . $cid . "'\r\n                             and c.categories_id = cd.categories_id\r\n                             and cd.language_id='" . $languages_id . "'";
    $categories_query_raw .= tep_get_access_sql('c.products_group_access', $customer_group_array);
    $categories_query_raw .= " ORDER BY sort_order, cd.categories_name";
    $categories_query = tep_db_query($categories_query_raw);
    while ($categories = tep_db_fetch_array($categories_query)) {
        if (!isset($categories[$level]['parent_id']) || $categories[$level]['parent_id'] == "") {
            $categories[$level]['parent_id'] = 0;
        }
        $categories[$level]['categories_id'] = $categories[$level]['parent_id'] + 1;
        // Add category link to $categories_string3
        for ($a = 1; $a < $level; $a++) {
            $categories_string3 .= "&nbsp;&nbsp;";
        }
        $categories_string3 .= '<a href="';
        $cPath_new = $cpath;
        // if ($categories[$level]['parent_id'] > 0) {
        if ($categories['parent_id'] > 0) {
            $cPath_new .= "_";
        }
        $cPath_new .= $categories['categories_id'];
        // added for CDS CDpath support
        $CDpath = isset($_SESSION['CDpath']) ? '&CDpath=' . $_SESSION['CDpath'] : '';
        $cPath_new_text = "cPath=" . $cPath_new . $CDpath;
        $categories_string3 .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);
        $categories_string3 .= '">';
        if ($_GET['cPath']) {
            $selectedPath = explode("_", $_GET['cPath']);
        }
        if (in_array($categories['categories_id'], $selectedPath)) {
            $categories_string3 .= '<b>';
        }
        if ($categories[$level]['categories_id'] == 1) {
            $categories_string3 .= '<u>';
        }
        $categories_string3 .= tep_db_decoder($categories['categories_name']);
        if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) {
            $categories_string3 .= ' ->';
        }
        if ($categories[$level]['categories_id'] == 1) {
            $categories_string3 .= '</u>';
        }
        if (in_array($categories['categories_id'], $selectedPath)) {
            $categories_string3 .= '</b>';
        }
        $categories_string3 .= '</a>';
        if (SHOW_COUNTS) {
            $products_in_category = tep_count_products_in_category($categories['categories_id']);
            if ($products_in_category > 0) {
                $categories_string3 .= '&nbsp;(' . $products_in_category . ')';
            }
        }
        $categories_string3 .= '<br>';
        // If I have subcategories, get them and show them
        if (tep_has_category_subcategories($categories['categories_id'])) {
            if ($COLLAPSABLE) {
                if (in_array($categories['categories_id'], $selectedPath)) {
                    tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE, $level);
                }
            } else {
                tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE, $level);
            }
        }
    }
}