Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] CategoryBoxEnhancement_v1.0 for 2.2 MS2


Nils P.

Recommended Posts

  • Replies 97
  • Created
  • Last Reply

Top Posters In This Topic

I would like to change the font of the Top Catagories (ie the catagories with the solid arrow) to 12 point font.

 

And keep the Sub Catagories (ie the catagories with the light arrow) at 10 point font

Hi Txema,

that might be a good idea. It won't be very difficult I think, I don't have any files here now, but I hope to try it soon.

Link to comment
Share on other sites

Fred:

I would like to change the font of the Top Catagories (ie the catagories with the solid arrow) to 12 point font.

 

And keep the Sub Catagories (ie the catagories with the light arrow) at 10 point font.

 

look in yr stylesheet.css for:

/* In Catalog */

.boxText {

font-family : Verdana, Arial, sans-serif;

font-size : 10px;

}

where you can change the font-size.

 

BTW, it's definitively not a good idea to change 10px into 12pt.

px is something totally different than pt.

px's (or em's) are used for PC screens, pt's are used for printing.

"If you're working on something new, then you are necessarily an amateur."

Link to comment
Share on other sites

  • 1 month later...
Hello, i just installed this and is working properly but is there any way to display categories and subcategories. in the main page by default?

Yes, there's a contribution that displays all categories and subcategories inside a table in the body of the main page. I don't remember the exact name and don't have the contrib number, but you should be able to find it anyway.

Link to comment
Share on other sites

Thanks for your reply, i have installed several just to show categories and subcategories in a way of expanded tree and none has work for me with your contribution. If anyone has acomplish this i'll really appreciate it.

 

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

This mod is working great, but, I would like to be able to have 3 bullets, one for each of these:

- any categories that contain sub-categories (right arrow)

- when a category that contains sub-categories is selected (down arrow)

- categories that do not contain sub-categories (dot)

 

I have tried to insert code from Category List with bullet for 2.2MS2 by Thomas Huber, but I can't get it to display the down arrow for categories with sub-categories that are selected, nor have I been able to get the bullets be clickable.

 

This is the code from the contribution mentioned above:

// Begin of Code snippet:

 

? ? if (tep_has_category_subcategories($counter)) {

? ?  if ( ($id) && (in_array($counter, $id)) ) {

? ? ? ? ? $categories_string .= '<img src="images/cat_arrow_down.gif" align="absmiddle"> ';

? ? ? ? } else {

? ? ? ? ? $categories_string .= '<img src="images/cat_arrow_right.gif" align="absmiddle"> ';

? ? ? ? }

} else {

?  $categories_string .= '<img src="images/cat_arrow_other.gif" align="absmiddle"> ';

}

 

// End of code snippet

 

Can someone help me integrate these two contributions in order to have three bullets?

 

Thank you!

Edited by millyramsey
Link to comment
Share on other sites

Milly, Category List with bullet for 2.2MS2 does not work with MS2 even though it says otherwise. $id for instance does not exist in MS2's categories.php any more. <_<

 

The code should look something like this instead:

if (tep_has_category_subcategories($counter)) {

if (isset($cPath_array) && (in_array($counter, $cPath_array))) {
 $categories_string .= tep_image(DIR_WS_IMAGES . 'cat_arrow_down.gif', '');
} else {
 $categories_string .= tep_image(DIR_WS_IMAGES . 'cat_arrow_right.gif', '');
}
} 

else {
$categories_string .= tep_image(DIR_WS_IMAGES . 'cat_arrow_other.gif', '');
}

You can still combine it with my contribution. Clickable bullets are a part of Category Box Enhancement version 1.1, let me know if you have problems with that. Good luck!

 

Regards,

Nils

Link to comment
Share on other sites

Nils, thank you so much! The bullets are working great now!

Except there is no highlighting!

This is the entire categories.php that I'm using:

 

<?php

/*

  $Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright © 2003 osCommerce

 

  Released under the GNU General Public License

 

  changed August 2003, by Nils Petersson

  contribution "Category Box Enhancement", version 1.1

   

*/

 

  function tep_show_category($counter) {

 

// BoF - Contribution Category Box Enhancement 1.1

    global $tree, $categories_string, $cPath_array, $cat_name;

 

    for ($i=0; $i<$tree[$counter]['level']; $i++) {

      $categories_string .= "  ";

    }

    $cPath_new = 'cPath=' . $tree[$counter]['path'];

    $categories_string .= '<a href="';

    $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';

 

    if (tep_has_category_subcategories($counter)) {

 

if (isset($cPath_array) && (in_array($counter, $cPath_array))) {

$categories_string .= tep_image(DIR_WS_IMAGES . 'cat_arrow_down.gif', '');

} else {

$categories_string .= tep_image(DIR_WS_IMAGES . 'cat_arrow_right.gif', '');

}

}

 

else {

$categories_string .= tep_image(DIR_WS_IMAGES . 'cat_arrow_other.gif', '');

}

 

 

// display category name

    $categories_string .= $tree[$counter]['name'];

 

  if ($cat_name == $tree[$counter]['name']) {

  $categories_string .= '</span>';

    }

 

    if (isset($cPath_array) && in_array($counter, $cPath_array)) {

      $categories_string .= '</b>';

    }

//  EoF Category Box Enhancement

 

    $categories_string .= '</a>';

 

    if (SHOW_COUNTS == 'true') {

      $products_in_category = tep_count_products_in_category($counter);

      if ($products_in_category > 0) {

        $categories_string .= ' (' . $products_in_category . ')';

      }

    }

 

    $categories_string .= '<br>';

 

    if ($tree[$counter]['next_id'] != false) {

      tep_show_category($tree[$counter]['next_id']);

    }

  }

?>

<!-- categories //-->

          <tr>

            <td>

<?php

 

// BoF - Contribution Category Box Enhancement 1.1

if (isset($cPath_array)) {

  for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {

    $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");

    if (tep_db_num_rows($categories_query) > 0)

    $categories = tep_db_fetch_array($categories_query);

  }

$cat_name = $categories['categories_name'];

}

// EoF Category Box Enhancement

// display category name

 

  $info_box_contents = array();

  $info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

 

  new infoBoxHeading($info_box_contents, true, false);

 

  $categories_string = '';

  $tree = array();

 

  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");

  while ($categories = tep_db_fetch_array($categories_query))  {

    $tree[$categories['categories_id']] = array('name' => $categories['categories_name'],

                                                'parent' => $categories['parent_id'],

                                                'level' => 0,

                                                'path' => $categories['categories_id'],

                                                'next_id' => false);

 

    if (isset($parent_id)) {

      $tree[$parent_id]['next_id'] = $categories['categories_id'];

    }

 

    $parent_id = $categories['categories_id'];

 

    if (!isset($first_element)) {

      $first_element = $categories['categories_id'];

    }

  }

 

  //------------------------

  if (tep_not_null($cPath)) {

    $new_path = '';

    reset($cPath_array);

    while (list($key, $value) = each($cPath_array)) {

      unset($parent_id);

      unset($first_id);

      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");

      if (tep_db_num_rows($categories_query)) {

        $new_path .= $value;

        while ($row = tep_db_fetch_array($categories_query)) {

          $tree[$row['categories_id']] = array('name' => $row['categories_name'],

                                              'parent' => $row['parent_id'],

                                              'level' => $key+1,

                                              'path' => $new_path . '_' . $row['categories_id'],

                                              'next_id' => false);

 

          if (isset($parent_id)) {

            $tree[$parent_id]['next_id'] = $row['categories_id'];

          }

 

          $parent_id = $row['categories_id'];

 

          if (!isset($first_id)) {

            $first_id = $row['categories_id'];

          }

 

          $last_id = $row['categories_id'];

        }

        $tree[$last_id]['next_id'] = $tree[$value]['next_id'];

        $tree[$value]['next_id'] = $first_id;

        $new_path .= '_';

      } else {

        break;

      }

    }

  }

  tep_show_category($first_element);

 

  $info_box_contents = array();

  $info_box_contents[] = array('text' => $categories_string);

 

  new infoBox($info_box_contents);

?>

            </td>

          </tr>

<!-- categories_eof //-->

 

Did I put your bullet code into your original correctly?

Link to comment
Share on other sites

Did I put your bullet code into your original correctly?

You put it in correctly, but a few lines are missing now from the original contribution:

    if (isset($cPath_array) && in_array($counter, $cPath_array)) {
     $categories_string .= '<b>';
   }
   
   if ($cat_name == $tree[$counter]['name']) {
     $categories_string .= '<span class="errorText">';
   }

... this goes right below the part I posted earlier, above

// display category name

That should do it. B)

Link to comment
Share on other sites

I have a question about the CategoryBoxEnhancement contribution and the Multiple_Stores contribution working together.

Sometimes the categories are not working like it should.

please take a look at the site www.it-factor.nl/catalog and click on some categories. i just don't work good.

 

I hope someone can help me, that would be great! :)

 

this is the code of the Catalog/includes/boxes/categories.php file

please take a look at it.

 

<?php

/*

? $Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $

 

? osCommerce, Open Source E-Commerce Solutions

? http://www.oscommerce.com

 

? Copyright ? 2003 osCommerce

 

? Released under the GNU General Public License

?

? changed August 2003, by Nils Petersson

? contribution "Category Box Enhancement", version 1.1

? ?

*/

 

? function tep_show_category($counter) {

 

// BoF - Contribution Category Box Enhancement 1.1

? ? global $tree, $categories_string, $cPath_array, $cat_name;

 

? ? for ($i=0; $i<$tree[$counter]['level']; $i++) {

? ? ? $categories_string .= "  ";

? ? }

? ? $cPath_new = 'cPath=' . $tree[$counter]['path'];

? ? $categories_string .= '<a href="';

? ? $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';

? ? if (tep_has_category_subcategories($counter)) {

? ? ? $categories_string .= tep_image(DIR_WS_IMAGES . 'pointer_blue.gif', '');

? ? }

? ? else {

? ? ? $categories_string .= tep_image(DIR_WS_IMAGES . 'pointer_blue_light.gif', '');

? ? }

 

? ? if (isset($cPath_array) && in_array($counter, $cPath_array)) {

? ? ? $categories_string .= '<b>';

? ? }

? ?

? ? if ($cat_name == $tree[$counter]['name']) {

? ? ? $categories_string .= '<span class="errorText">';

? ? }

 

// display category name

? ? $categories_string .= $tree[$counter]['name'];

 

? if ($cat_name == $tree[$counter]['name']) {

?  $categories_string .= '</span>';

? ? }

 

? ? if (isset($cPath_array) && in_array($counter, $cPath_array)) {

? ? ? $categories_string .= '</b>';

? ? }

//? EoF Category Box Enhancement

?

? ? $categories_string .= '</a>';

 

? ? if (SHOW_COUNTS == 'true') {

? ? ? $products_in_category = tep_count_products_in_category($counter);

? ? ? if ($products_in_category > 0) {

? ? ? ? $categories_string .= ' (' . $products_in_category . ')';

? ? ? }

? ? }

 

? ? $categories_string .= '<br>';

 

? ? if ($tree[$counter]['next_id'] != false) {

? ? ? tep_show_category($tree[$counter]['next_id']);

? ? }

? }

?>

<!-- categories //-->

? ? ? ? ? <tr>

? ? ? ? ? ? <td>

<?php

 

// BoF - Contribution Category Box Enhancement 1.1

if (isset($cPath_array)) {

? for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {

? ? ? ? ? ? ? ? $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_CATEGORIES_TO_STORES . " c2s where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and c.categories_id = c2s.categories_id and c2s.stores_id = '" . STORES_ID . "' and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");

? ? $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");

? ? if (tep_db_num_rows($categories_query) > 0)

? ? $categories = tep_db_fetch_array($categories_query);

? }

$cat_name = $categories['categories_name'];

}

// EoF Category Box Enhancement

// display category name

 

? $info_box_contents = array();

? $info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

 

? new infoBoxHeading($info_box_contents, true, false);

 

? $categories_string = '';

? $tree = array();

 

//rmh 12/09/2003 multi-stores edited next line

? $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_CATEGORIES_TO_STORES . " c2s where c.parent_id = '0' and c.categories_id = cd.categories_id and c.categories_id = c2s.categories_id and c2s.stores_id = '" . STORES_ID . "' and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");

? while ($categories = tep_db_fetch_array($categories_query))? {

? ? $tree[$categories['categories_id']] = array('name' => $categories['categories_name'],

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'parent' => $categories['parent_id'],

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'level' => 0,

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'path' => $categories['categories_id'],

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'next_id' => false);

 

? ? if (isset($parent_id)) {

? ? ? $tree[$parent_id]['next_id'] = $categories['categories_id'];

? ? }

 

? ? $parent_id = $categories['categories_id'];

 

? ? if (!isset($first_element)) {

? ? ? $first_element = $categories['categories_id'];

? ? }

? }

 

? //------------------------

? if (tep_not_null($cPath)) {

? ? $new_path = '';

? ? reset($cPath_array);

? ? while (list($key, $value) = each($cPath_array)) {

? ? ? unset($parent_id);

? ? ? unset($first_id);

? ? ? //rmh 12/09/2003 multi-stores edited next line

? ? ? $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_CATEGORIES_TO_STORES . " c2s where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and c.categories_id = c2s.categories_id and c2s.stores_id = '" . STORES_ID . "' and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");

? ? ? if (tep_db_num_rows($categories_query)) {

? ? ? ? $new_path .= $value;

? ? ? ? while ($row = tep_db_fetch_array($categories_query)) {

? ? ? ? ? $tree[$row['categories_id']] = array('name' => $row['categories_name'],

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  'parent' => $row['parent_id'],

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  'level' => $key+1,

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  'path' => $new_path . '_' . $row['categories_id'],

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  'next_id' => false);

 

? ? ? ? ? if (isset($parent_id)) {

? ? ? ? ? ? $tree[$parent_id]['next_id'] = $row['categories_id'];

? ? ? ? ? }

 

? ? ? ? ? $parent_id = $row['categories_id'];

 

? ? ? ? ? if (!isset($first_id)) {

? ? ? ? ? ? $first_id = $row['categories_id'];

? ? ? ? ? }

 

? ? ? ? ? $last_id = $row['categories_id'];

? ? ? ? }

? ? ? ? $tree[$last_id]['next_id'] = $tree[$value]['next_id'];

? ? ? ? $tree[$value]['next_id'] = $first_id;

? ? ? ? $new_path .= '_';

? ? ? } else {

? ? ? ? break;

? ? ? }

? ? }

? }

? tep_show_category($first_element);

 

? $info_box_contents = array();

? $info_box_contents[] = array('text' => $categories_string);

 

? new infoBox($info_box_contents);

?>

? ? ? ? ? ? </td>

? ? ? ? ? </tr>

<!-- categories_eof //-->

 

I imported the scripts of both contributions, but it doesnt work...

 

please let me know if you know the answer.

greetings from holland

Edited by verstege
Link to comment
Share on other sites

Erwin,

I don't know the Multiple_Stores contribution, but after a short look at your site, you should do two things in any case as first steps:

 

1. install the cache fix I uploaded on Sept 2, 2003 at http://www.oscommerce.com/community/contributions,1480 if you haven't already.

 

2. Empty your cache, and turn it off until all works like it should. Both can be done in the Admin area of your shop.

 

I can't promise you that this will solve your problems, but let me know what it did.

 

Regards,

Nils

Link to comment
Share on other sites

Hi

 

Nice contribution. Makes the categories box that bit more useful for the user. And very easy to install as well.

 

Can you tell me how I can add an extra <br> between each of the main categories to separate them a little bit. In my proto-store I think the categories are just a bit squashed together.

 

Thanks in advance

 

Tim

Link to comment
Share on other sites

  • 2 weeks later...

Matt

 

Thanks for that. It showed me where I needed to look to make the changes. I've had a play with it and come up with the following change to achieve the effect I want.

 

In boxes/categories.php line 20 is:

 

    global $tree, $categories_string, $cPath_array, $cat_name;

 

I have replaced this with:

    global $tree, $categories_string, $cPath_array, $cat_name, $catcount;

    $catcount++;

    if ($tree[$counter]['level'] == 0 && $catcount > 1){

      $categories_string .= "<hr size=1>";

    }

 

This adds a horizontal rule before each of the top level categories(except the first), splitting the category box up into a more readable list.

 

Hope this helps someone, someday.

Tim

Link to comment
Share on other sites

I want all my subcategories to have a third image by them, how do I do that?

 

www.graveyardrecords.com/catalog

 

here is my code :

 

<?php
/*
 $Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
 
 changed August 2003, by Nils Petersson
 contribution "Category Box Enhancement", version 1.1
   
*/

 function tep_show_category($counter) {

// BoF - Contribution Category Box Enhancement 1.1
   global $tree, $categories_string, $cPath_array, $cat_name;

   for ($i=0; $i<$tree[$counter]['level']; $i++) {
     $categories_string .= "  ";
   }
   $cPath_new = 'cPath=' . $tree[$counter]['path'];
   $categories_string .= '<a href="';
   $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
  
   if (tep_has_category_subcategories($counter)) {
     $categories_string .= tep_image(DIR_WS_IMAGES . 'arrow_down.gif', '');
   }
   else {
     $categories_string .= tep_image(DIR_WS_IMAGES . 'arrow_right.gif', '');
   }



  if (isset($cPath_array) && in_array($counter, $cPath_array)) {
     $categories_string .= '<b>';
   }
   
   if ($cat_name == $tree[$counter]['name']) {
     $categories_string .= '<span class="errorText">';
   }

// display category name
   $categories_string .= $tree[$counter]['name'];

 if ($cat_name == $tree[$counter]['name']) {
	 $categories_string .= '</span>';
   }

   if (isset($cPath_array) && in_array($counter, $cPath_array)) {
     $categories_string .= '</b>';
   }
//  EoF Category Box Enhancement
 
   $categories_string .= '</a>';

   if (SHOW_COUNTS == 'true') {
     $products_in_category = tep_count_products_in_category($counter);
     if ($products_in_category > 0) {
       $categories_string .= ' (' . $products_in_category . ')';
     }
   }

   $categories_string .= '<br>';

   if ($tree[$counter]['next_id'] != false) {
     tep_show_category($tree[$counter]['next_id']);
   }
 }
?>
<!-- categories //-->
         <tr>
           <td>
<?php

// BoF - Contribution Category Box Enhancement 1.1
if (isset($cPath_array)) {
 for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
   $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
   if (tep_db_num_rows($categories_query) > 0)
   $categories = tep_db_fetch_array($categories_query);
 }
$cat_name = $categories['categories_name']; 
}
// EoF Category Box Enhancement
// display category name

 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

 new infoBoxHeading($info_box_contents, true, false);

 $categories_string = '';
 $tree = array();

 $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
 while ($categories = tep_db_fetch_array($categories_query))  {
   $tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
                                               'parent' => $categories['parent_id'],
                                               'level' => 0,
                                               'path' => $categories['categories_id'],
                                               'next_id' => false);

   if (isset($parent_id)) {
     $tree[$parent_id]['next_id'] = $categories['categories_id'];
   }

   $parent_id = $categories['categories_id'];

   if (!isset($first_element)) {
     $first_element = $categories['categories_id'];
   }
 }

 //------------------------
 if (tep_not_null($cPath)) {
   $new_path = '';
   reset($cPath_array);
   while (list($key, $value) = each($cPath_array)) {
     unset($parent_id);
     unset($first_id);
     $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
     if (tep_db_num_rows($categories_query)) {
       $new_path .= $value;
       while ($row = tep_db_fetch_array($categories_query)) {
         $tree[$row['categories_id']] = array('name' => $row['categories_name'],
                                              'parent' => $row['parent_id'],
                                              'level' => $key+1,
                                              'path' => $new_path . '_' . $row['categories_id'],
                                              'next_id' => false);

         if (isset($parent_id)) {
           $tree[$parent_id]['next_id'] = $row['categories_id'];
         }

         $parent_id = $row['categories_id'];

         if (!isset($first_id)) {
           $first_id = $row['categories_id'];
         }

         $last_id = $row['categories_id'];
       }
       $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
       $tree[$value]['next_id'] = $first_id;
       $new_path .= '_';
     } else {
       break;
     }
   }
 }
 tep_show_category($first_element); 

 $info_box_contents = array();
 $info_box_contents[] = array('text' => $categories_string);

 new infoBox($info_box_contents);
?>
           </td>
         </tr>
<!-- categories_eof //-->

 

any help would be greatly appreciated..

Link to comment
Share on other sites

Graveyard666

 

I'd say that you want to play around with this bit of code:

 

   if (tep_has_category_subcategories($counter)) {
    $categories_string .= tep_image(DIR_WS_IMAGES . 'arrow_down.gif', '');
  }
  else {
    $categories_string .= tep_image(DIR_WS_IMAGES . 'arrow_right.gif', '');
  }

 

Relace with something like:

  if ($tree[$counter]['level'] == 0){
   $categories_string .= tep_image(DIR_WS_IMAGES . 'arrow_down.gif', '');
 } elseif ($tree[$counter]['level'] == 1){
   $categories_string .= tep_image(DIR_WS_IMAGES . 'arrow_down.gif', '');
 } else {
   $categories_string .= tep_image(DIR_WS_IMAGES . 'third_image.gif', '');   
 }

 

Mind you, I'm not that great with php so you might need to change it to get it to work (backup first).

 

 

Hope it helps.

Tim

Link to comment
Share on other sites

I would like to add a horizontal line between each of the categories. I tried the suggestion made by Tim Elliot above:

 

In boxes/categories.php line 20 is:

 

 

    global $tree, $categories_string, $cPath_array, $cat_name;

 

 

I have replaced this with:

 

 

    global $tree, $categories_string, $cPath_array, $cat_name, $catcount;

    $catcount++;

    if ($tree[$counter]['level'] == 0 && $catcount > 1){

      $categories_string .= "<hr size=1>";

    }

 

 

This adds a horizontal rule before each of the top level categories(except the first), splitting the category box up into a more readable list.

but it does not appear to have changed anything.

 

If anyone can tell me how to accomplish this it would be appreciated. Thanks.

 

Pete

Link to comment
Share on other sites

I would like to add a horizontal line between each of the categories. I tried the suggestion made by Tim Elliot above:

 

In boxes/categories.php line 20 is:

 

 

    global $tree, $categories_string, $cPath_array, $cat_name;

 

 

I have replaced this with:

 

 

    global $tree, $categories_string, $cPath_array, $cat_name, $catcount;

    $catcount++;

    if ($tree[$counter]['level'] == 0 && $catcount > 1){

      $categories_string .= "<hr size=1>";

    }

 

 

This adds a horizontal rule before each of the top level categories(except the first), splitting the category box up into a more readable list.

but it does not appear to have changed anything.

 

If anyone can tell me how to accomplish this it would be appreciated. Thanks.

 

Pete

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...