Loaded Commerce Community

Banner


Board index » CRE Loaded Support » CRE Loaded 6.4

All times are UTC - 5 hours




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Information Pages Bug...
PostPosted: Sat Feb 13, 2010 9:57 pm 
Offline
CRE Freak
User avatar

Joined: Thu Mar 08, 2007 1:00 am
Posts: 96
I'm having an issue with the information pages facility in Cre 6.4.1a Pro...
This is what's happening...
I can browse through my shop product pages without problem, but the minute I have clicked on an information page and then go back to viewing a product again the breadcrumb trail no longer retains its correct structure, ie: it now reads "Information Pages » Product Name" instead of what it should read: Home » Category » Sub Category » Product Name.

Also, on the product detail pages at the bottom the following links appear which relate to and link back to the information pages section:
<< Privacy Policy ---- Back to List

The same is happening with the Contact Us information page, the breadcrumb reads as "Contact Us » Contact Us" as apposed to "Home » Contact Us" and then if I view a product after this the breadcrumb trail reads as: "Contact Us » Product Name" and the links back to the information pages section appear on the bottom of the product detail page as well.

Does anyone have any ideas why this is happening, and how to fix this?


Top
 Profile  
 
 Post subject: Re: Information Pages Bug...
PostPosted: Sun Feb 14, 2010 4:22 am 
Offline
CRE Talented

Joined: Sun Nov 29, 2009 10:57 am
Posts: 352
Hi Jiffy, you could try the following link,

http://blog.wasimasif.com/categories-breadcrumb-not-working-cre-loaded-pro/

_________________
CSS Store - http://mdjl40.mdjl-demo.co.uk -Work in Progress
YMM Filter Lists - http://mdjl-demo.co.uk/6-4-1a -Pagnation/Filter Lists


Top
 Profile  
 
 Post subject: Re: Information Pages Bug...
PostPosted: Sun Feb 14, 2010 4:53 am 
Offline
CRE Freak
User avatar

Joined: Thu Mar 08, 2007 1:00 am
Posts: 96
Thanks for that TheLango, unfortunately my version of CRE already had that fix made to it and its still not working so its not that :-(

Breadcrumb works fine until such time the user visits any of the information pages


Top
 Profile  
 
 Post subject: Re: Information Pages Bug...
PostPosted: Sun Feb 14, 2010 2:42 pm 
Offline
CRE Freak
User avatar

Joined: Thu Mar 08, 2007 1:00 am
Posts: 96
I've just tested the above problem on the live 6.4 Pro Demo located at creloaded.com and the same problem happens, so its not just something on my system/configuration. Go to the demo front end, if the information pages info box is switched off go to the backend and enable it, then go back to the front end and check. Works fine until you view an information page and then go back to the product categories menu and view a product detail page. The breadcrumb trail gets screwed up and also places links related to the information pages at the bottom of the product detail page!


Top
 Profile  
 
 Post subject: Re: Information Pages Bug...
PostPosted: Fri Feb 19, 2010 6:47 pm 
Offline
CRE Talented

Joined: Sun Nov 29, 2009 10:57 am
Posts: 352
Yep, Have just found the same bug..

Have just replicated on the Demo store by creating a new pages Category and a new page within it.

As Jiffy said, navigating throught the store is no problem, once you enter any of the cds pages, the cdpath is the added to url of your products.

returning to the product info page, then shows that shitty back to list and next cds page at the bottom.



Any idea on a fix guys?


Cheers

_________________
CSS Store - http://mdjl40.mdjl-demo.co.uk -Work in Progress
YMM Filter Lists - http://mdjl-demo.co.uk/6-4-1a -Pagnation/Filter Lists


Top
 Profile  
 
 Post subject: Re: Information Pages Bug...
PostPosted: Fri Feb 19, 2010 10:22 pm 
Offline
CRE Expert

Joined: Thu Jul 13, 2006 12:00 am
Posts: 658
I'll have the developers read this thread, and we will make a tracker etc and get it fixed

_________________
Regards,

------------------------------------------------------------------------
Kirk Osburne

CRE everything
WebGraphicsSource.com
------------------------------------------------------------------------


Top
 Profile  
 
 Post subject: Re: Information Pages Bug...
PostPosted: Sat Feb 20, 2010 3:44 am 
Offline
CRE Talented

Joined: Sun Nov 29, 2009 10:57 am
Posts: 352
Thanks Kirk..

Just to let you guys know, cannot replicate in 6.4.0 versions of Pro or B2B

EDIT** yes I can, same bug for 6.4.0 versions

_________________
CSS Store - http://mdjl40.mdjl-demo.co.uk -Work in Progress
YMM Filter Lists - http://mdjl-demo.co.uk/6-4-1a -Pagnation/Filter Lists


Top
 Profile  
 
 Post subject: Re: Information Pages Bug...
PostPosted: Sat Jun 12, 2010 8:29 am 
Offline
CRE Expert

Joined: Thu Jul 13, 2006 12:00 am
Posts: 658
http://creforge.com/tracker/index.php?f ... 9&atid=564

Quote:
This is not a bug, it is by design. If CDPath is in the URL,
the bottom navigation will display.

You can control the pages to which CDPath is carried by editing
includes/functions/CDS_functions_htmloutput.php.

Add or Remove pages that carry CDPath by adjusting the $pages
array accordingly.

_________________
Regards,

------------------------------------------------------------------------
Kirk Osburne

CRE everything
WebGraphicsSource.com
------------------------------------------------------------------------


Top
 Profile  
 
 Post subject: Re: Information Pages Bug...
PostPosted: Wed May 18, 2011 10:12 am 
Offline
CRE Freak
User avatar

Joined: Tue Jan 06, 2009 4:57 pm
Posts: 72
Hey Kirk,

I am still having this problem with 'Back to List' link in that it links to information pages, when clicked on a product page.

How should I fix this? Any ideas?

Many thanks,
Andy.

p.s. I maybe still be having the problems listed at the start of the thread to, are they fixable?


Top
 Profile  
 
 Post subject: Re: Information Pages Bug...
PostPosted: Sun May 22, 2011 3:40 am 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2404
Location: New Zealand
fbpublishers wrote:
Hey Kirk,

I am still having this problem with 'Back to List' link in that it links to information pages, when clicked on a product page.

How should I fix this? Any ideas?

Many thanks,
Andy.

p.s. I maybe still be having the problems listed at the start of the thread to, are they fixable?

Hi Andy,
The tracker link in Kirk's post above tells you how to fix these issues:

Quote:
This is not a bug, it is by design. If CDPath is in the URL,
the bottom navigation will display.

You can control the pages to which CDPath is carried by editing
includes/functions/CDS_functions_htmloutput.php.

Add or Remove pages that carry CDPath by adjusting the $pages
array accordingly.

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: Information Pages Bug...
PostPosted: Mon May 23, 2011 10:08 am 
Offline
CRE Freak
User avatar

Joined: Tue Jan 06, 2009 4:57 pm
Posts: 72
Ah thanks Simon, I just worked it out, so If i dont want that link on the the page, I just remove the page reference from the array that is mentioned in that post?


Top
 Profile  
 
 Post subject: Re: Information Pages Bug...
PostPosted: Mon May 23, 2011 5:36 pm 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2404
Location: New Zealand
fbpublishers wrote:
Ah thanks Simon, I just worked it out, so If i dont want that link on the the page, I just remove the page reference from the array that is mentioned in that post?

Yes, that's the one, from $pages array.
Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: Information Pages Bug...
PostPosted: Tue May 24, 2011 6:00 am 
Offline
CRE Freak
User avatar

Joined: Tue Jan 06, 2009 4:57 pm
Posts: 72
Hey Simon,

The only file I could find in includes/functions was cds_functions.php. I couldnt find the $pages array. It may be there but I tried searcing for it in the document and nothing came back. Here is the code:
Code:
<?php
/*
  $Id: cds_functions.php,v 1.1 2007/07/28 11:21:11 datazen Exp $

  CRE Loaded, Commercial Open Source E-Commerce
  http://www.creloaded.com

  Copyright (c) 2007 CRE Loaded
  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

function cre_pages_parse_categories_path($CDpath) {
  // make sure the category ids are integers
  $CDpath_array = array_map('tep_string_to_int', explode('_', $CDpath));
  // make sure no duplicate category ids exist which could lock the server in a loop
  $tmp_array = array();
  $n = sizeof($CDpath_array);
 
  for ($i = 0; $i < $n; $i++) {
      if ($CDpath_array[$i] == 0) continue;
      if (!in_array($CDpath_array[$i], $tmp_array)) {
          $tmp_array[] = $CDpath_array[$i];
      }
  }
    return $tmp_array;
}

function cre_get_listing_array($id = 0) {
  global $languages_id;
   
  // build the SQL
  $listing_sql = "SELECT ic.categories_id as 'ID', ic.categories_parent_id as 'parentID', ic.categories_sort_order as 'sort', ic.categories_image as 'image', icd.categories_heading as 'name', ic.categories_url_override as 'url', ic.categories_url_override_target as 'target', ic.category_append_cdpath as 'append', 'c' as 'type', ic.categories_sub_category_view as 'view', ic.categories_listing_columns as 'list_columns'   
                    from " . TABLE_CDS_CATEGORIES . " ic
                  LEFT JOIN " . TABLE_CDS_CATEGORIES_DESCRIPTION . " icd
                    on (ic.categories_id = icd.categories_id)
                  WHERE ic.categories_status = '1'
                    and icd.language_id = '" . (int)$languages_id . "'
                    and ic.categories_in_pages_listing = '2'
                                    and ic.categories_parent_id = '" . $id . "'
                  UNION
                  SELECT p.pages_id as 'ID', p2c.categories_id as 'parentID', p2c.page_sort_order as 'sort', p.pages_image as 'image', pd.pages_title as 'name', p.pages_url as 'url', p.pages_url_target as 'target', '' as 'append', 'p' as 'type', '' as 'view', '2' as 'list_columns'
                    from " . TABLE_CDS_PAGES . " p,
                         " . TABLE_CDS_PAGES_DESCRIPTION . "  pd,
                         " . TABLE_CDS_PAGES_TO_CATEGORIES . " p2c
                  WHERE p.pages_id = pd.pages_id
                    and pd.language_id ='" . (int)$languages_id . "'
                    and p.pages_id = p2c.pages_id
                    and p.pages_status = '1'
                    and p.pages_in_page_listing = '2'
                                    and p2c.categories_id ='" . $id . "'
                                ORDER BY sort";
                           
  $listing_query = tep_db_query($listing_sql);
  $listing_check = tep_db_num_rows($listing_query);
   
    $CDpath_array = (isset($_GET['CDpath']) && $_GET['CDpath'] != '') ? cre_pages_parse_categories_path($_GET['CDpath']) : array();
    $pID = (isset($_GET['pID']) && $_GET['pID'] != '') ? (int)$_GET['pID'] : 0;
   
    $this_listing_array = array();
    if ($listing_check > 0) {                               
    while ($listing_result = tep_db_fetch_array($listing_query)) {
          if($listing_result['type'] == 'c') {
        $this_listing_array[] = array('name' => $listing_result['name'],
                                              'ID' => $listing_result['ID'],
                                              'parentID' => $listing_result['parentID'],
                                              'sort' => $listing_result['sort'],
                                              'image' => $listing_result['image'],                                                                           
                                              'type' => $listing_result['type'],
                                                                  'url' => $listing_result['url'],
                                                                  'target' => $listing_result['target'],
                                                                  'append' => $listing_result['append'],
                                                                  'view' => $listing_result['view'],
                                                                  'list_columns' => $listing_result['list_columns']                                                                                                                                                                     
                                             );
      } else {
        $this_listing_array[] = array('name' => $listing_result['name'],
                                              'ID' => $listing_result['ID'],
                                              'parentID' => $listing_result['parentID'],
                                              'sort' => $listing_result['sort'],
                                                                            'image' => $listing_result['image'],
                                              'type' => $listing_result['type'],
                                                                  'url' => $listing_result['url'],
                                                                  'target' => $listing_result['target'],
                                                                  'append' => $listing_result['append'],
                                                                  'view' => $listing_result['view'],
                                                                  'list_columns' => $listing_result['list_columns']                                                                                                                                                                                                                               
                                                                );
      }               
        } // end while
    }   
                                             
  return $this_listing_array;
}

function cre_get_box_array($id = 0) {
  global $languages_id;
   
  // build the SQL
  $box_sql = "SELECT ic.categories_id as 'ID', ic.categories_parent_id as 'parentID', ic.categories_sort_order as 'sort', icd.categories_name as 'name', ic.categories_url_override as 'url', ic.categories_url_override_target as 'target', ic.category_append_cdpath as 'append', 'c' as 'type'
                FROM " . TABLE_CDS_CATEGORIES . " ic
              LEFT JOIN " . TABLE_CDS_CATEGORIES_DESCRIPTION . " icd
                ON (ic.categories_id = icd.categories_id)
              WHERE ic.categories_status = '1'
                AND icd.language_id = '" . (int)$languages_id . "'
                AND ic.categories_in_menu = '1'
                AND ic.categories_parent_id = '" . $id . "'
              UNION
              SELECT p.pages_id as 'ID', p2c.categories_id as 'parentID', p2c.page_sort_order as 'sort', pd.pages_menu_name as 'name', p.pages_url as 'url', p.pages_url_target as 'target', ' ' as 'append', 'p' as 'type'
                FROM " . TABLE_CDS_PAGES . " p,
                     " . TABLE_CDS_PAGES_DESCRIPTION . "  pd,
                     " . TABLE_CDS_PAGES_TO_CATEGORIES . " p2c
              WHERE p.pages_id = pd.pages_id
                AND pd.language_id ='" . (int)$languages_id . "'
                AND p.pages_id = p2c.pages_id
                AND p.pages_status = '1'
                AND p.pages_in_menu = '1'
                AND pd.pages_menu_name <> ''
                AND p2c.categories_id ='" . $id . "'
                ORDER BY sort";
                           
  $box_query = tep_db_query($box_sql);
  $box_check = tep_db_num_rows($box_query);
   
    $CDpath_array = (isset($_GET['CDpath']) && $_GET['CDpath'] != '') ? cre_pages_parse_categories_path($_GET['CDpath']) : array();
    $pID = (isset($_GET['pID']) && $_GET['pID'] != '') ? (int)$_GET['pID'] : 0;
   
    $box_array = array();
    if ($box_check > 0) {                               
    while ($box_result = tep_db_fetch_array($box_query)) {
          if($box_result['type'] == 'c') {
              $has_subs = cre_category_has_subs((int)$box_result['ID']);
                $selected = (in_array($box_result['ID'], $CDpath_array)) ? true : false;
        $box_array[] = array('name' => $box_result['name'],
                                    'ID' => $box_result['ID'],
                                    'parentID' => $box_result['parentID'],
                                    'sort' => $box_result['sort'],
                                    'type' => $box_result['type'],
                                                          'subs' => $has_subs,
                                                          'selected' => $selected,
                                                          'url' => $box_result['url'],
                                                          'target' => $box_result['target'],
                                                          'append' => $box_result['append']
                                    );
      } else {
              $selected = ($pID == $box_result['ID']) ? true : false;
        $box_array[] = array('name' => $box_result['name'],
                                    'ID' => $box_result['ID'],
                                    'parentID' => $box_result['parentID'],
                                    'sort' => $box_result['sort'],
                                    'type' => $box_result['type'],
                                                          'subs' => false,
                                                      'selected' => $selected,
                                                          'url' => $box_result['url'],
                                                          'target' => $box_result['target'],
                                                          'append' => $box_result['append']
                                                        );
      }               
        } // end while
    }   
                                               
  return $box_array;
}

function cre_category_has_subs($id = 0) {

  $has_subs_sql = "SELECT categories_id
                     from " . TABLE_CDS_CATEGORIES . "
                   WHERE categories_parent_id = '" . $id . "'
                                   and categories_status = '1'
                     and categories_in_menu = '1'";

  $has_subs_check = tep_db_num_rows(tep_db_query($has_subs_sql));
    $has_subs = ($has_subs_check > 0) ? true : false;
   
    return $has_subs;
}

function cre_get_cds_page_path($current_page_id = '') {
  $path_query = tep_db_query("SELECT categories_id
                                  from " . TABLE_CDS_PAGES_TO_CATEGORIES . "
                                                            WHERE pages_id = '" . (int)$current_page_id . "'");
                                                           
  $path = tep_db_fetch_array($path_query);
    $CDpath_new = cre_get_cds_category_path($path['categories_id']);
   
    return $CDpath_new;
}

function cre_get_cds_category_path($current_categories_id = '') {

  if (tep_not_null($current_categories_id)) {
    $CDpath_new = $current_categories_id;
    $loop = true;
        while ($loop === true) {       
      $categories_query = tep_db_query("SELECT categories_parent_id
                                                from " . TABLE_CDS_CATEGORIES. "
                                                                                WHERE categories_id = '" . (int)$current_categories_id . "'");
                                                                               
      $categories = tep_db_fetch_array($categories_query);
       
          if ($categories['categories_parent_id'] != 0) {
            $CDpath_new .= '_' . $categories['categories_parent_id'];
                $current_categories_id = $categories['categories_parent_id'];
                continue;
          }
            $loop = false;
            break;
    }
  } 
  $CDpath_array_new = explode('_', $CDpath_new);
  krsort($CDpath_array_new);
  $CDpath_new = implode('_', $CDpath_array_new);

  return $CDpath_new;
}

function cre_build_box_string() {
  global $level, $subvalue;
   
    $this_box_string = '';
  $sub_indicator = (defined('CDS_TEXT_SUBS_INDICATOR')) ? CDS_TEXT_SUBS_INDICATOR : '';
  if ($subvalue[$level]['type'] == 'c') {
    $id = cre_get_cds_category_path($subvalue[$level]['ID']);
    if ($subvalue[$level]['url'] != '') {
      $separator = (strpos($subvalue[$level]['url'], '?')) ? '&amp;' : '?';
      $this_box_link = ($subvalue[$level]['append'] == true) ? $subvalue[$level]['url'] . $separator . 'CDpath=' . $id : $subvalue[$level]['url'];
      $this_box_target = ($subvalue[$level]['target'] != '') ? 'target="' . $subvalue[$level]['target'] . '"' : '';
    } else {
      $this_box_link = tep_href_link(FILENAME_PAGES, 'CDpath=' . $id);
      $this_box_target = '';
    }
  } else {
    $this_box_link = tep_href_link(FILENAME_PAGES, 'pID=' . $subvalue[$level]['ID'] . '&amp;CDpath=' . cre_get_cds_page_path($subvalue[$level]['ID']));
    $this_box_target = '';
  } 
  $this_box_string .= '<a href="' . $this_box_link . '"' . $this_box_target . '>';
  $this_box_string .= ($subvalue[$level]['selected'] == true) ? '<b>' : '';
  $this_box_string .= $subvalue[$level]['name'];
  $this_box_string .= ($subvalue[$level]['selected'] == true) ? '</b>' : '';
  $this_box_string .= ($subvalue[$level]['subs'] == true) ? $sub_indicator : '';
  $this_box_string .= '</a>';
  $this_box_string .= '<br>';
   
  return $this_box_string;
}

function cre_get_box_string() {
  global $languages_id, $level, $subvalue;
                                         
  $box_string = '';
  $this_id = 0;
  $level = 0;
  $spacer = '&nbsp;&nbsp;';
  $sub_indicator = (defined('CDS_TEXT_SUBS_INDICATOR')) ? CDS_TEXT_SUBS_INDICATOR : '';
                                                                 
  // get the box array
  $box_array = cre_get_box_array($this_id);
 
  while (list($key, $value) = each($box_array)) {
    // level 0
    if ($value['type'] == 'c') {
      $id = cre_get_cds_category_path($value['ID']);
      if ($value['url'] != '') {
        $separator = (strpos($value['url'], '?')) ? '&amp;' : '?';
        $box_link = ($value['append'] == true) ? $value['url'] . $separator . 'CDpath=' . $id : $value['url'];
        $box_target = ($value['target'] != '') ? 'target="' . $value['target'] . '"' : '';
      } else {
        $box_link = tep_href_link(FILENAME_PAGES, 'CDpath=' . $id);
        $box_target = '';
      }
    } else {
      $box_link = tep_href_link(FILENAME_PAGES, 'pID=' . $value['ID'] . '&amp;CDpath=' . cre_get_cds_page_path($value['ID']));
      $box_target = '';
    }   
    $box_string .= '<a href="' . $box_link . '"' . $box_target . '>';
    $box_string .= ($value['selected'] == true) ? '<b>' : '';
    $box_string .= $value['name'];
    $box_string .= ($value['selected'] == true) ? '</b>' : '';
    $box_string .= ($value['subs'] == true) ? $sub_indicator : '';
    $box_string .= '</a>';
    $box_string .= '<br>';

    // level 1
    if ($value['selected'] == true) {
      $sub_box_array1 = cre_get_box_array($value['ID']);
      $level++;
      while (list($subkey[$level], $subvalue[$level]) = each($sub_box_array1)) {
        $box_string .= str_repeat($spacer, 1) . cre_build_box_string();
        // level 2
        if ($subvalue[$level]['selected'] == true) {         
          $sub_box_array2 = cre_get_box_array($subvalue[$level]['ID']);
                    $pID_check = (isset($_GET['pID']) && $_GET['pID'] != '') ? $_GET['pID'] : 0;                           
          if ( (end(explode('_', $_GET['CDpath'])) == $pID_check) ) {
            if (array_key_exists(($subkey[$level] + 1), $sub_box_array2) ) { continue; } else { break; }
          }
          $level++;
          while (list($subkey[$level], $subvalue[$level]) = each($sub_box_array2)) {
            $box_string .= str_repeat($spacer, 2) . cre_build_box_string();
            // level 3
            if ($subvalue[$level]['selected'] == true) {                       
              $sub_box_array3 = cre_get_box_array($subvalue[$level]['ID']);
                      $pID_check = (isset($_GET['pID']) && $_GET['pID'] != '') ? $_GET['pID'] : 0;                           
              if ( (end(explode('_', $_GET['CDpath'])) == $pID_check) ) {
                if (array_key_exists(($subkey[$level] + 1), $sub_box_array3) ) { continue; } else { break; }
              }                           
              $level++;
              while (list($subkey[$level], $subvalue[$level]) = each($sub_box_array3)) {
                $box_string .= str_repeat($spacer, 3) . cre_build_box_string();
                // level 4
                if ($subvalue[$level]['selected'] == true) {
                  $sub_box_array4 = cre_get_box_array($subvalue[$level]['ID']);
                      $pID_check = (isset($_GET['pID']) && $_GET['pID'] != '') ? $_GET['pID'] : 0;                           
                  if ( (end(explode('_', $_GET['CDpath'])) == $pID_check) ) {
                    if (array_key_exists(($subkey[$level] + 1), $sub_box_array4) ) { continue; } else { break; }
                  }
                  $level++;
                  while (list($subkey[$level], $subvalue[$level]) = each($sub_box_array4)) {
                    $box_string .= str_repeat($spacer, 4) . cre_build_box_string();           
                    // level 5
                    if ($subvalue[$level]['selected'] == true) {
                      $sub_box_array5 = cre_get_box_array($subvalue[$level]['ID']);
                                    $pID_check = (isset($_GET['pID']) && $_GET['pID'] != '') ? $_GET['pID'] : 0;                           
                      if ( (end(explode('_', $_GET['CDpath'])) == $pID_check) ) {
                        if (array_key_exists(($subkey[$level] + 1), $sub_box_array5) ) { continue; } else { break; }
                      }
                      $level++;
                      while (list($subkey[$level], $subvalue[$level]) = each($sub_box_array5)) {
                        $box_string .= str_repeat($spacer, 5) . cre_build_box_string();
                        // level 6
                        if ($subvalue[$level]['selected'] == true) {
                          $sub_box_array6 = cre_get_box_array($subvalue[$level]['ID']);
                          $pID_check = (isset($_GET['pID']) && $_GET['pID'] != '') ? $_GET['pID'] : 0;                           
                          if ( (end(explode('_', $_GET['CDpath'])) == $pID_check) ) {
                            if (array_key_exists(($subkey[$level] + 1), $sub_box_array6) ) { continue; } else { break; }
                          }
                          $level++;
                          while (list($subkey[$level], $subvalue[$level]) = each($sub_box_array6)) {
                            $box_string .= str_repeat($spacer, 6) . cre_build_box_string();   
                            // level 7
                            if ($subvalue[$level]['selected'] == true) {
                              $sub_box_array7 = cre_get_box_array($subvalue[$level]['ID']);
                                          $pID_check = (isset($_GET['pID']) && $_GET['pID'] != '') ? $_GET['pID'] : 0;                           
                              if ( (end(explode('_', $_GET['CDpath'])) == $pID_check) ) {
                                if (array_key_exists(($subkey[$level] + 1), $sub_box_array7) ) { continue; } else { break; }
                              }
                              $level++;
                              while (list($subkey[$level], $subvalue[$level]) = each($sub_box_array7)) {
                                $box_string .= str_repeat($spacer, 7) . cre_build_box_string();                                               
                                // level 8
                                if ($subvalue[$level]['selected'] == true) {
                                  $sub_box_array8 = cre_get_box_array($subvalue[$level]['ID']);
                                              $pID_check = (isset($_GET['pID']) && $_GET['pID'] != '') ? $_GET['pID'] : 0;                           
                                  if ( (end(explode('_', $_GET['CDpath'])) == $pID_check) ) {
                                    if (array_key_exists(($subkey[$level] + 1), $sub_box_array8) ) { continue; } else { break; }
                                  }
                                  $level++;
                                  while (list($subkey[$level], $subvalue[$level]) = each($sub_box_array8)) {
                                    $box_string .= str_repeat($spacer, 8) . cre_build_box_string();                                               
                                    // level 9
                                    if ($subvalue[$level]['selected'] == true) {
                                      $sub_box_array9 = cre_get_box_array($subvalue[$level]['ID']);
                                        $pID_check = (isset($_GET['pID']) && $_GET['pID'] != '') ? $_GET['pID'] : 0;                           
                                      if ( (end(explode('_', $_GET['CDpath'])) == $pID_check) ) {
                                        if (array_key_exists(($subkey[$level] + 1), $sub_box_array9) ) { continue; } else { break; }
                                      }
                                      $level++;
                                      while (list($subkey[$level], $subvalue[$level]) = each($sub_box_array9)) {
                                        $box_string .= str_repeat($spacer, 9) . cre_build_box_string();                                               
                                      } // end while9       
                                    }                                                                       
                                  } // end while8
                                }                                                               
                              } // end while7
                            }                                                       
                          } // end while6       
                        }
                      } // end while5
                    }                                       
                  } // end while4
                }                                           
              } // end while3
            }                         
          } // end while2   
        }
      } // end while1
    }       
  }
                                 
  return $box_string;
}

function cre_get_header_banner($CDpath) {
  $CDpath_array = explode('_', $CDpath);
  krsort($CDpath_array);
  $header_banner = array();
  for ($i = sizeof($CDpath_array), $n = 0; $i > $n; $i--) {
    $cat_id = $CDpath_array[$i-1];
    $category_query = tep_db_query("SELECT category_header_banner from " . TABLE_CDS_CATEGORIES . " where categories_id = '" . (int)$cat_id . "'");
    $category = tep_db_fetch_array($category_query);
    if ($category['category_header_banner'] != '') {
      $header_banner = array('id' => (int)$cat_id, 'banner' => $category['category_header_banner']);
      break;
    }
  }
  return $header_banner;
}

function cre_get_cds_path_back($current_id, $current_type, $prev_type) {

  $CDpath = isset($_GET['CDpath']) ? $_GET['CDpath'] : '';
  $CDpath_new = array();

  if (tep_not_null($CDpath)) {
    $CDpath_new = explode('_', $CDpath);
    if ($current_type == 'c' && $prev_type == 'c') {
      if (sizeof($CDpath_new) > 0) {
        array_pop($CDpath_new);
      }
      array_push($CDpath_new, $current_id);
    }
    if ($current_type == 'c' && $prev_type == 'p') {
      if (sizeof($CDpath_new) > 1) {
        array_pop($CDpath_new);
      }
    }
    if ($current_type == 'p' && $prev_type == 'c') {
      array_push($CDpath_new, $current_id);
    }
    $CDpath_new = implode('_', $CDpath_new);
  }

  return $CDpath_new;
}

function cre_get_cds_path_next($current_id, $current_type, $next_type) {

  $CDpath = isset($_GET['CDpath']) ? $_GET['CDpath'] : '';
  $CDpath_new = array();

  if (tep_not_null($CDpath)) {
    $CDpath_new = explode('_', $CDpath);
    if ($current_type == 'c' && $next_type == 'c') {
      if (sizeof($CDpath_new) > 0) {
        array_pop($CDpath_new);
      }
      array_push($CDpath_new, $current_id);
    }
    if ($current_type == 'c' && $next_type == 'p') {
      if (sizeof($CDpath_new) > 1) {
        array_pop($CDpath_new);
      }
    }
    if ($current_type == 'p' && $next_type == 'c') {
      array_push($CDpath_new, $current_id);
    }
    $CDpath_new = implode('_', $CDpath_new);
  }

  return $CDpath_new;
}

function cre_category_exists($category_id) {
   
  $category_query = tep_db_query("SELECT categories_id   
                                      from " . TABLE_CDS_CATEGORIES . "
                                                               WHERE categories_id = '" . (int)$category_id . "'");
                             
  $this_exists = (tep_db_num_rows($category_query) > 0) ? true : false;
   
  return $this_exists;
}

function cre_get_category_heading_image($category_id) {
    global $languages_id;
   
  $category_query = tep_db_query("SELECT ic.category_heading_title_image, icd.categories_heading 
                                      from " . TABLE_CDS_CATEGORIES . " ic,
                                                                             " . TABLE_CDS_CATEGORIES_DESCRIPTION . " icd
                                                               WHERE ic.categories_id = '" . (int)$category_id . "'
                                                                      and icd.categories_id = '" . (int)$category_id . "'
                                                                        and icd.language_id = '" . (int)$languages_id . "'");
                                                                                                                     
  $category = tep_db_fetch_array($category_query);

  return  tep_image(DIR_WS_IMAGES . $category['category_heading_title_image'], $category['categories_heading']);
}

function cre_get_category_title($category_id) {
  global $languages_id;
   
  $category_query = tep_db_query("SELECT categories_heading 
                                      from " . TABLE_CDS_CATEGORIES_DESCRIPTION . "
                                                               WHERE categories_id = '" . (int)$category_id . "'
                                                                  and language_id = '" . (int)$languages_id . "'");
                                                               
  $category = tep_db_fetch_array($category_query);

  return $category['categories_heading'];
}

function cre_get_category_description($category_id) {
  global $languages_id;
   
  $category_query = tep_db_query("SELECT categories_description 
                                      from " . TABLE_CDS_CATEGORIES_DESCRIPTION . "
                                                               WHERE categories_id = '" . (int)$category_id . "'
                                                                  and language_id = '" . (int)$languages_id . "'");
                                                               
  $category = tep_db_fetch_array($category_query);
   
  return $category['categories_description'];
}

function cre_get_category_blurb($category_id) {
  global $languages_id;
   
  $category_query = tep_db_query("SELECT categories_blurb
                                      from " . TABLE_CDS_CATEGORIES_DESCRIPTION . "
                                                               WHERE categories_id = '" . (int)$category_id . "'
                                                                  and language_id = '" . (int)$languages_id . "'");
                                                               
  $category = tep_db_fetch_array($category_query);
   
  return $category['categories_blurb'];
}

function cre_get_category_thumbnail($category_id) {
  global $languages_id;
   
  $category_query = tep_db_query("SELECT ic.categories_image, icd.categories_heading
                                      from " . TABLE_CDS_CATEGORIES . " ic,
                                                                             " . TABLE_CDS_CATEGORIES_DESCRIPTION . " icd
                                                               WHERE ic.categories_id = '" . (int)$category_id . "'
                                                                      and icd.categories_id = '" . (int)$category_id . "'
                                                                      and icd.language_id = '" . (int)$languages_id . "'");
                                                               
  $category = tep_db_fetch_array($category_query);
   
  return tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_heading'], CDS_THUMBNAIL_WIDTH, CDS_THUMBNAIL_HEIGHT);
}

function cre_get_category_view($category_id) {
   
  $category_query = tep_db_query("SELECT categories_sub_category_view     
                                      from " . TABLE_CDS_CATEGORIES . "
                                                               WHERE categories_id = '" . (int)$category_id . "'");
                                                               
  $category = tep_db_fetch_array($category_query);
  $flat_view = ((int)$category['categories_sub_category_view'] == 0) ? true : false;

  return $flat_view;
}

function cre_get_category_listing_columns($category_id) {
   
  $category_query = tep_db_query("SELECT categories_listing_columns
                                      from " . TABLE_CDS_CATEGORIES . "
                                                               WHERE categories_id = '" . (int)$category_id . "'");
                                                               
  $category = tep_db_fetch_array($category_query);

  return $category['categories_listing_columns'];
}

function cre_page_exists($page_id) {
   
  $page_query = tep_db_query("SELECT pages_id 
                                  from " . TABLE_CDS_PAGES . "
                                                           WHERE pages_id = '" . (int)$page_id . "' and pages_status = '1'");
                                                               
                                                             
  $this_exists = (tep_db_num_rows($page_query) > 0) ? true : false;                                                                 
   
  return $this_exists;
}

function cre_get_page_title($page_id) {
  global $languages_id;
   
  $page_query = tep_db_query("SELECT pages_title
                                  from " . TABLE_CDS_PAGES_DESCRIPTION . "
                                                           WHERE pages_id = '" . (int)$page_id . "'
                                                              and language_id = '" . (int)$languages_id . "'");
                                                               
  $page = tep_db_fetch_array($page_query);

  return $page['pages_title'];
}

function cre_get_page_body($page_id) {
  global $languages_id;
   
  $page_query = tep_db_query("SELECT pages_body
                                  from " . TABLE_CDS_PAGES_DESCRIPTION . "
                                                           WHERE pages_id = '" . (int)$page_id . "'
                                                              and language_id = '" . (int)$languages_id . "'");
                                                               
  $page = tep_db_fetch_array($page_query);
   
  return $page['pages_body'];
}

function cre_get_page_blurb($page_id) {
  global $languages_id;
   
  $page_query = tep_db_query("SELECT pages_blurb
                                  from " . TABLE_CDS_PAGES_DESCRIPTION . "
                                                           WHERE pages_id = '" . (int)$page_id . "'
                                                              and language_id = '" . (int)$languages_id . "'");
                                                               
  $page = tep_db_fetch_array($page_query);
   
  return $page['pages_blurb'];
}

function cre_get_page_thumbnail($page_id) {
  global $languages_id;
   
  $page_query = tep_db_query("SELECT ip.pages_image, icp.pages_title
                                      from " . TABLE_CDS_PAGES . " ip,
                                                                             " . TABLE_CDS_PAGES_DESCRIPTION . " icp
                                                               WHERE ip.pages_id = '" . (int)$page_id . "'
                                                                      and icp.pages_id = '" . (int)$page_id . "'
                                                                      and icp.language_id = '" . (int)$languages_id . "'");
                                                               
  $page = tep_db_fetch_array($page_query);
   
  return tep_image(DIR_WS_IMAGES . $page['pages_image'], $page['pages_title'], CDS_THUMBNAIL_WIDTH, CDS_THUMBNAIL_HEIGHT);
}

function cre_get_acf_filename($page_id) {
  global $languages_id;
   
  $page_query = tep_db_query("SELECT pages_file
                                  from " . TABLE_CDS_PAGES_DESCRIPTION . "
                                                           WHERE pages_id = '" . (int)$page_id . "'
                                                              and language_id = '" . (int)$languages_id . "'");
                                                               
  $page = tep_db_fetch_array($page_query);
   
  return $page['pages_file'];
}

function cre_get_product_insert($id) {
  global $languages_id, $pf, $listing_columns;

  if (isset($_GET['pID']) && $_GET['pID'] != '') {
    $sql = "SELECT pages_attach_product
              from " . TABLE_PAGES . "
            WHERE pages_id = " . (int)$id . "
              and pages_status = '1'";
  } else {
    $sql = "SELECT categories_attach_product
              from " . TABLE_PAGES_CATEGORIES . "
            WHERE categories_id = " . (int)$id . "
              and categories_status = '1'";   
  }
  $page = tep_db_fetch_array(tep_db_query($sql));   
  $attach_product = (isset($_GET['pID']) && $_GET['pID'] != '') ? $page['pages_attach_product'] : $page['categories_attach_product'];
  $cPath = tep_get_product_path($attach_product);

  $product_string = '';
 
  if (isset($attach_product) && $attach_product != 0) {
    $cds_attach_product = tep_db_fetch_array(tep_db_query("SELECT pd.products_name, p.products_price, p.products_image
                                                             from " . TABLE_PRODUCTS . " p,
                                                                  " . TABLE_PRODUCTS_DESCRIPTION ." pd
                                                           WHERE p.products_id = pd.products_id
                                                             and p.products_id = " . $attach_product));
                                                                                                                         
    $pf->loadProduct($attach_product, $languages_id);
    $products_price = $pf->getPriceStringShort();
    if (htmlspecialchars(substr($products_price, -6)) == htmlspecialchars("&nbsp;")) {
      $products_price = substr($products_price, 0, strlen($products_price)-6);
    }
    $product_string .= '<!-- pages_product_insert -->' . "\n";      
            if ($listing_columns != 1) {
      $product_string .= '<table border="0" cellspacing="0" cellpadding="0" align="right"><tr><td class="attach_product">' . "\n";
            } else {
      $product_string .= '<table border="0" cellspacing="0" cellpadding="0"><tr><td class="attach_product">' . "\n";         
            }
   // $product_string .= '<div>' . "\n";
    $product_string .= '  <table border="0" cellspacing="0" cellpadding="0">' . "\n";
    $product_string .= '    <tr>' . "\n";
    $product_string .= '      <td><div class="cds_product_img">' . "\n";
    $product_string .= '        <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'CDpath=' . $_GET['CDpath'] . '&amp;products_id=' . $attach_product) . '">' . tep_image(DIR_WS_IMAGES . $cds_attach_product['products_image'], addslashes($cds_attach_product['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'  . "\n";
    $product_string .= '      </div></td>' . "\n";
    $product_string .= '    </tr>' . "\n";
    $product_string .= '    <tr>' . "\n";
    $product_string .= '      <td><div class="cds_product_name">' . "\n";
    $product_string .= '        <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'CDpath=' . $_GET['CDpath'] . '&amp;products_id=' . $attach_product) . '">' . $cds_attach_product['products_name'] . '</a>' . "\n";
    $product_string .= '      </div></td>' . "\n";
    $product_string .= '    </tr>' . "\n";

    //### subproducts
    $allowcriteria = (STOCK_ALLOW_CHECKOUT == 'false') ? " and p.products_quantity > 0 " : "";
    $csort_order = tep_db_fetch_array(tep_db_query("SELECT configuration_value
                                                                          from " . TABLE_CONFIGURATION . "
                                                                        WHERE configuration_key = 'CATEGORIES_SORT_ORDER'"));
    $select_order_by = '';
    switch ($csort_order['configuration_value']) {
      case 'PRODUCT_LIST_MODEL':
        $select_order_by .= 'p.products_model';
        break;
      case 'PRODUCT_LIST_NAME':
        $select_order_by .= 'pd.products_name';
        break;
      case 'PRODUCT_LIST_PRICE':
        $select_order_by .= 'p.products_price';
        break;
     default:
       $select_order_by .= 'p.products_model';
       break;
    }
    $sub_products_sql = tep_db_query("SELECT p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, p.products_model
                                                          from " . TABLE_PRODUCTS . " p,
                                                                 " . TABLE_PRODUCTS_DESCRIPTION . " pd
                                                        WHERE p.products_parent_id = " . (int)$attach_product . " " . $allowcriteria."
                                                          and p.products_id = pd.products_id
                                                          and pd.language_id = " . (int)$languages_id . "
                                                        ORDER BY " . $select_order_by);

    if (tep_db_num_rows($sub_products_sql) > 0) {
      $product_string .= '    <tr>' . "\n";
      $product_string .= '      <td><table border="0" cellspacing="0" cellpadding="0">' . "\n";
      while ($sub_products = tep_db_fetch_array($sub_products_sql)) {
        $remain = strlen(substr( $sub_products['products_name'], 0, strpos($sub_products['products_name'], ' - ')) . ' - ');
        $subname = substr($sub_products['products_name'], $remain);
        $pf->loadProduct($sub_products['products_id'], $languages_id);
        $sub_products_price = $pf->getPriceStringShort();
        if (htmlspecialchars(substr($sub_products_price, -6)) == htmlspecialchars("&nbsp;")) {
          $sub_products_price = substr($sub_products_price, 0, strlen($sub_products_price)-6);
        }
        $product_string .= '        <tr>' . "\n";
        $product_string .= '          <td>' . "\n";
        $product_string .= '            <div class="cds_product_buy"><a href="' . tep_href_link(FILENAME_DEFAULT . 'action=buy_now&amp;products_id=' . $sub_products['products_id'] . '&amp;cPath=' . $cPath) . '">' . "\n";
        $product_string .= '            <nobr>' . CDS_TEXT_BUY .  '&nbsp;' . $subname . $sub_products_price . '</nobr></a></div>' . "\n";
        $product_string .= '          </td>' . "\n";
        if (eregi('productSpecialPrice', $sub_products_price)) {
          if (htmlspecialchars(substr($sub_products_price, 0,6)) == htmlspecialchars("&nbsp;")) {
            $sub_products_price = substr($sub_products_price, 6, strlen($sub_products_price));
          }
          $product_string .= '      </tr>' . "\n";
          $product_string .= '      <tr>' . "\n";
        }
        $product_string .= '        </tr>' . "\n";

      }
      $product_string .= '      </table></td>' . "\n";
      $product_string .= '    </tr>' . "\n";
    } else {  // no sub products
      $product_string .= '    <tr>' . "\n";
      $product_string .= '      <td><table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
      $product_string .= '        <tr>' . "\n";
      if (eregi('productSpecialPrice', $products_price)) {
        if (htmlspecialchars(substr($products_price, 0,6)) == htmlspecialchars("&nbsp;")) {
          $products_price = substr($products_price, 6, strlen($products_price));
        }
        $product_string .= '        </tr>' . "\n";
        $product_string .= '        <tr>' . "\n";
      }
      $product_string .= '          <td>' . "\n";
      $product_string .= '            <div class="cds_product_buy"><a href="' . tep_href_link(FILENAME_DEFAULT . 'action=buy_now&amp;products_id=' . $attach_product . '&amp;cPath=' . $cPath) . '">' . "\n";
      $product_string .= '            <nobr>' . CDS_TEXT_BUY . '&nbsp;<span class="cds_product_buy">' . $products_price . '</span></nobr></a></div>' . "\n";
      $product_string .= '          </td>' . "\n";
      $product_string .= '        </tr>' . "\n";
      $product_string .= '      </table></td>' . "\n";
      $product_string .= '    </tr>' . "\n";
    }
        $product_string .= '<tr><td class="cds_product_insert_width">' . tep_draw_separator('pixel_trans.gif', '1', '1') . '</td></tr>' . "\n";
    $product_string .= '   </table>' . "\n";
  //  $product_string .= ' </div>' . "\n";
    $product_string .= ' </td></tr>' . "\n";
        $product_string .= '</table>' . "\n";
//kiran added for fixing link issue in IE
$product_string .= '<br clear="left" />' . "\n";
    $product_string .= '<!-- pages_product_insert //eof-->' . "\n";
  }
  return $product_string;
}

function cre_build_listing_link($val, $image = false) {

  $this_box_link = '';
  $this_box_string = '';
  if ($val['type'] == 'c') {
    if ($val['url'] != '') {
      $separator = (strpos($val['url'], '?')) ? '&amp;' : '?';
      $this_box_link = ($val['append'] == true) ? $val['url'] . $separator . 'CDpath=' . cre_get_cds_category_path($val['ID']) : $val['url'];       
      $this_box_target = ($val['target'] != '') ? 'target="' . $val['target'] . '"' : '';
    } else {
      $this_box_link = tep_href_link(FILENAME_PAGES,'CDpath=' . cre_get_cds_category_path($val['ID']));
      $this_box_target = '';
    }
  } else {
    $this_box_link = tep_href_link(FILENAME_PAGES, 'pID=' . $val['ID'] . '&amp;CDpath=' . cre_get_cds_page_path($val['ID']));
    $this_box_target = '';
  }
  $this_box_string .= '<a href="' . $this_box_link . '"' . $this_box_target . '>';
  if ($val['type'] == 'c') {
    if ($image == true) {
      $this_box_string .= cre_get_category_thumbnail($val['ID']);
    } else {
      $this_box_string .= $val['name'];
    }
  } else {
    if ($image == true) {
      $this_box_string .= cre_get_page_thumbnail($val['ID']);
    } else {
    $this_box_string .= $val['name'];
    }   
  }
  $this_box_string .= '</a>';
  $this_box_string .= '<br>';
   
  return $this_box_string;
}

function cre_get_category_display_string() {
  global $value, $subvalue, $cell_width, $thumbnail, $title, $blurb, $has_image, $sub_has_image, $flat_view;
         
  $product_string = ''; 
  $this_width = (defined('CDS_THUMBNAIL_WIDTH') && CDS_THUMBNAIL_WIDTH > 0) ? CDS_THUMBNAIL_WIDTH : 1;         
  $this_display_string = '<td valign="top" width="' . $cell_width . '%">' . "\n";   
  if ($flat_view == true && isset($subvalue)) {
    $this_display_string .= '  <table width="100%" border="0" cellspacing="0" cellpadding="0">' . "\n";
    $this_display_string .= '    <tr>' . "\n";
    if ($sub_has_image == true) {
      $this_display_string .= '      <td width="' . $this_width . '" class="cds_listing_category_img" valign="top" align="center"></td>' . "\n";
    } else {
      $this_display_string .= '      <td width="' . CDS_FLAT_VIEW_INDENT_VALUE . '" valign="top" align="center"></td>' . "\n";
    }
    $this_display_string   .= '    <td valign="top" class="cds_listing_category_content"><table border="0" cellpadding="0" cellspacing="0" width="100%">' . "\n";
    $this_display_string   .= '      <tr>' . "\n";
    $this_display_string   .= '        <td class="cds_listing_category_title">' . "\n";   
  }
  $this_display_string     .= '          <table width="100%" border="0" cellspacing="0" cellpadding="0">' . "\n";
  $this_display_string     .= '            <tr>' . "\n";
  if ($has_image == true) {
    $this_display_string   .= '                <td width="' . $this_width . '" class="cds_listing_category_img" valign="top" align="center">' . $thumbnail . '</td>' . "\n";
  } else {
    $this_display_string   .= '                <td width="1" valign="top" align="center"></td>' . "\n";
  }
  $this_display_string .= '                  <td valign="top" class="cds_listing_category_content"><table border="0" cellpadding="0" cellspacing="0" width="100%">' . "\n";
      if (isset($title) && strip_tags($title) != '') {
    $this_display_string .= '                <tr>' . "\n";
    $this_display_string .= '                  <td class="cds_listing_category_title">' . $title . '</td>' . "\n";
    $this_display_string .= '                </tr>' . "\n";
      }
  $this_display_string .= '                <tr>' . "\n";
  $this_display_string .= '                  <td class="cds_listing_category_blurb">' . $product_string . $blurb . '</td>' . "\n";
  $this_display_string .= '                </tr>' . "\n";
  $this_display_string .= '              </table>' . "\n";
  $this_display_string .= '            </td>' . "\n";
  $this_display_string .= '          </tr>' . "\n";
  $this_display_string .= '        </table>' . "\n"; 
  if ($flat_view == true && isset($subvalue)) {
    $this_display_string .= '        </td>' . "\n";
    $this_display_string .= '      </tr>' . "\n";
    $this_display_string .= '      <tr>' . "\n";
    $this_display_string .= '        <td class="cds_listing_category_blurb"></td>' . "\n";
    $this_display_string .= '      </tr>' . "\n";
    $this_display_string .= '      </table>' . "\n";
    $this_display_string .= '    </td>' . "\n";
    $this_display_string .= '  </tr>' . "\n";
    $this_display_string .= '</table>' . "\n";   
  } 
  $this_display_string .= '   </td>' . "\n"; 


  return $this_display_string;
}

function cre_get_page_display_string() {
  global $subvalue, $cell_width, $thumbnail, $title, $blurb, $has_image, $sub_has_image, $flat_view;
   
  $this_width = (defined('CDS_THUMBNAIL_WIDTH') && CDS_THUMBNAIL_WIDTH > 0) ? CDS_THUMBNAIL_WIDTH : 1;     
  $this_display_string = '<td valign="top" width="' . $cell_width . '%">' . "\n";
    if ($flat_view == true && isset($subvalue)) {
    $this_display_string .= '  <table width="100%" border="0" cellspacing="0" cellpadding="0">' . "\n";
    $this_display_string .= '    <tr>' . "\n";
    if ($sub_has_image == true) {
      $this_display_string .= '      <td width="' . $width . '" class="cds_listing_pages_img" valign="top" align="center"></td>' . "\n";
      } else {
      $this_display_string .= '      <td width="' . CDS_FLAT_VIEW_INDENT_VALUE . '" valign="top" align="center"></td>' . "\n";
      }
    $this_display_string   .= '    <td valign="top" class="cds_listing_pages_content"><table border="0" cellpadding="0" cellspacing="0" width="100%">' . "\n";
    $this_display_string   .= '      <tr>' . "\n";
    $this_display_string   .= '        <td class="cds_listing_pages_title">' . "\n";   
    }
   $this_display_string     .= '          <table width="100%" border="0" cellspacing="0" cellpadding="0">' . "\n";
  $this_display_string     .= '            <tr>' . "\n";
    if ($has_image == true) {
    $this_display_string   .= '                <td width="' . $this_width . '" class="cds_listing_pages_img" valign="top" align="center">' . $thumbnail . '</td>' . "\n";
    } else {
    $this_display_string   .= '                <td width="1" valign="top" align="center">' . $thumbnail . '</td>' . "\n";
    }
  $this_display_string .= '                  <td valign="top" class="cds_listing_pages_content"><table border="0" cellpadding="0" cellspacing="0" width="100%">' . "\n";
      if (isset($title) && strip_tags($title) != '') {
    $this_display_string .= '                <tr>' . "\n";
    $this_display_string .= '                  <td class="cds_listing_pages_title">' . $title . '</td>' . "\n";
    $this_display_string .= '                </tr>' . "\n";
      }
  $this_display_string .= '                <tr>' . "\n";
  $this_display_string .= '                  <td class="cds_listing_pages_blurb">' . $blurb . '</td>' . "\n";
  $this_display_string .= '                </tr>' . "\n";
  $this_display_string .= '              </table>' . "\n";
  $this_display_string .= '            </td>' . "\n";
  $this_display_string .= '          </tr>' . "\n";
  $this_display_string .= '        </table>' . "\n";
    if ($flat_view == true && isset($subvalue)) {
    $this_display_string .= '        </td>' . "\n";
    $this_display_string .= '      </tr>' . "\n";
    $this_display_string .= '      <tr>' . "\n";
    $this_display_string .= '        <td class="cds_listing_pages_blurb"></td>' . "\n";
    $this_display_string .= '      </tr>' . "\n";
    $this_display_string .= '      </table>' . "\n";
    $this_display_string .= '    </td>' . "\n";
    $this_display_string .= '  </tr>' . "\n";
    $this_display_string .= '</table>' . "\n";   
    }
   
  $this_display_string .= '   </td>' . "\n"; 

  return $this_display_string;
}   
   

function cre_get_cds_thema($CDpath) {
  $CDpath_array = explode('_', $CDpath);
  krsort($CDpath_array);
  $template_name = '';
  for ($i=sizeof($CDpath_array), $n=0; $i>$n; $i--) {
    $cat_id = $CDpath_array[$i-1];
    $category_query = tep_db_query("SELECT categories_template from " . TABLE_CDS_CATEGORIES . " where categories_id = '" . (int)$cat_id . "'");
    $category = tep_db_fetch_array($category_query);
    if ($category['categories_template'] != '') {
      $template_name = $category['categories_template'];
      break;
    }
  }
  return $template_name;
}
?>


What do I need to change?

Many thanks,
Andy.


Top
 Profile  
 
 Post subject: Re: Information Pages Bug...
PostPosted: Tue May 24, 2011 6:37 am 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2404
Location: New Zealand
Apologies for blindly agreeing with that link - the file you need is: /includes/runtime/functions/cds_functions_htmloutput.php
Remove / comment out what you don't want.

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: Information Pages Bug...
PostPosted: Thu Jan 26, 2012 1:13 am 
Offline
CRE Addict
User avatar

Joined: Tue Mar 30, 2010 8:36 pm
Posts: 206
soundzgood2 wrote:
Apologies for blindly agreeing with that link - the file you need is: /includes/runtime/functions/cds_functions_htmloutput.php
Remove / comment out what you don't want.

Simon


hi, simon.

i tried this fix, and actually deleted all of the pages in the $pages = array, but am still getting the "back to list" thing with the CDpath getting added onto the end of the url for products. can you please tell me what i am doing incorrectly?

TIA!

(i know you already know this code, but i am pasting it here for convenience:)

original code:
=====================
<?php
/*
$Id: functions_htmloutput.php,v 1.0.0.0 2008/01/22 13:41:11 datazen Exp $

CRE Loaded, Open Source E-Commerce Solutions
http://www.creloaded.com

Copyright (c) 2007 CRE Loaded
Copyright (c) 2003 osCommerce

Released under the GNU General Public License

*/
global $link, $PHP_SELF;

// if CDpath session is set, carry CDpath to next URL
if (!eregi('CDpath=', $link)) {
if (isset($_SESSION['CDpath']) && $_SESSION['CDpath'] != NULL) {
$pages = array('articles.php',
'articles.tpl.php',
'articles_new.php',
'articles_new.tpl.php',
'article_info.php',
'article_info.tpl.php',
'categories.php',
'categories1.php',
'categories2.php',
'categories3.php',
'categories4.php',
'categories5.php',
'product_info.php',
'product_info.tpl.php',
'index_nested.tpl.php',
'index_products.tpl.php');
if (in_array(basename($PHP_SELF), $pages)) {
$this_separator = (strpos($link, '?')) ? '&' : '?';
$link .= $this_separator . 'CDpath=' . $_SESSION['CDpath'];
}
}
}
?>
==========================

changed it to:

==========================
<?php
/*
$Id: functions_htmloutput.php,v 1.0.0.0 2008/01/22 13:41:11 datazen Exp $

CRE Loaded, Open Source E-Commerce Solutions
http://www.creloaded.com

Copyright (c) 2007 CRE Loaded
Copyright (c) 2003 osCommerce

Released under the GNU General Public License

*/
global $link, $PHP_SELF;

// if CDpath session is set, carry CDpath to next URL
if (!eregi('CDpath=', $link)) {
if (isset($_SESSION['CDpath']) && $_SESSION['CDpath'] != NULL) {
$pages = array('');
if (in_array(basename($PHP_SELF), $pages)) {
$this_separator = (strpos($link, '?')) ? '&' : '?';
$link .= $this_separator . 'CDpath=' . $_SESSION['CDpath'];
}
}
}
?>
=======================

_________________
B2B 6.4.1 with MVS enabled


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

Board index » CRE Loaded Support » CRE Loaded 6.4

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
It is currently Wed May 23, 2012 7:43 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Login

Forums Latest Activity

Top Listing

1. Cart2Cart - Shopping...
    Category: Shopping Cart Database Conversion Scripts
    
2. Points & Rewards PLUS!...
    Category: Add-Ons
    
3. Configuration Server...
    Category: Fixes
    
4. Credit Card with CCV
    Category: Payment Modules
    
5. CC7333_ATS
    Category: Templates
    
Show more...

© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy