Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Categories Box Bullet and Line (Support)


241

Recommended Posts

Steve,

 

I tried out the code above and the underline still extends to the left of the beginning of the text. I implemented the code you posted to eliminate the underline like this to accomodate different images for the top level and sub categories:

 

// display category name
? ?if ($foo[$counter]['parent'] == 0) {
? ?$categories_string .= tep_image(DIR_WS_IMAGES . 'top_cat_pointer.gif', '') . ' ' . $foo[$counter]['name'];
}else {
? ?$categories_string .= tep_image(DIR_WS_IMAGES . 'sub_cat_bullet.gif', '') . ' '. $foo[$counter]['name'];
}

 

Here is an example of what my categories box looks like:

 

cat.jpg

 

Circled in red is where the underlining of the text starts before the first letter of the text link. Below is an example of my information box:

 

info.jpg

 

I would like the links to look like that if possible. I have played with moving code around with no luck yet. I will keep trying and check back to see if you have come up with a solution.

 

Thank You,

 

Mike

catalog/includes/boxes/categories.php

 

 

  
// display category name
 $categories_string .= tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif', '') . tep_draw_separator('pixel_trans.gif', '5', '1') . $foo[$counter]['name'];

 

or If you want the image to be part of the link

 

    $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
   $categories_string .= '">' . tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif', '') . tep_draw_separator('pixel_trans.gif', '5', '1');

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

  • 4 weeks later...
  • Replies 107
  • Created
  • Last Reply

Top Posters In This Topic

Hi All,

 

I was wondering if there is a way to show all categories with this contribution?

 

thanks!

If you mean in reference to your other post and the messed up code, yes it is possible and does not necesitate the use of this contribution as this contribution is a standard categories.php with a few code changes.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

I love the way this contribution works, but seem to be having a slight problem.

 

When I click to go to my home page, it seems to be working fine. But, if I refresh the page, or click on of my categories, it reverts back to my old style.

 

Thanks to anyone who might be able to point me in the right direction.

 

Rachel

Link to comment
Share on other sites

Hmm, just realized the OSC copyright date on the categories.php file (2002) is different from mine (2003). I had just copied it over my current one. No errors, just the problem I noted above.

 

Here's my regular categories.php file:

 

<?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
*/

 function tep_show_category($counter) {
   global $tree, $categories_string, $cPath_array;

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

// BOF: Add Bullet Images v1.0

   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"> ';
}

// EOF: Add Bullet Images v1.0

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

   if ($tree[$counter]['parent'] == 0) {
     $cPath_new = 'cPath=' . $counter;
   } else {
     $cPath_new = 'cPath=' . $tree[$counter]['path'];
   }

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

   if (isset($cPath_array) && in_array($counter, $cPath_array)) {
     $categories_string .= '<b>';
   }

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

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

   if (tep_has_category_subcategories($counter)) {
     $categories_string .= '';
   }

   $categories_string .= '</a>';

   if (SHOW_COUNTS == 'false') {
     $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
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

 new infoBoxHeading($info_box_contents, false, 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 //-->

 

Thanks again,

 

Rachel

Link to comment
Share on other sites

I love the way this contribution works, but seem to be having a slight problem.

 

When I click to go to my home page, it seems to be working fine. But, if I refresh the page, or click on of my categories, it reverts back to my old style.

 

Thanks to anyone who might be able to point me in the right direction.

 

Rachel

post a link to the issue

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Hmm, when I click the link I provided, I don't see the contribution at all. When I open my home page directly, though, it does show up. :blink: I assure you, your categories.php file HAS been uploaded to the site.

Link to comment
Share on other sites

Hmm, when I click the link I provided, I don't see the contribution at all. When I open my home page directly, though, it does show up. :blink: I assure you, your categories.php file HAS been uploaded to the site.

When I click the link I see the original contribution and then if I clcik a category or do a refresh I get your other page.

 

do you use BTS or STS

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

No, I don't use any of those. Here's a list of the contributions I have added, just in case you need to know:

 

http://www.oscommerce.com/community/contri...ns,1341/page,13 Must agree to terms

 

http://www.oscommerce.com/community/contributions,568 Add bullet images to category

 

http://www.oscommerce.com/community/contributions,1598 Unsold carts report

 

http://www.oscommerce.com/community/contributions,716 modified price per customer group

 

http://www.oscommerce.com/community/contributions,1435 order editor

 

http://www.oscommerce.com/community/contri...ons,1462/page,2 FedEx quotes

 

Category editor

 

http://www.oscommerce.com/community/contributions,598 Pick-up module

 

Fax/Phone 1.2  http://www.oscommerce.com/community/contributions,1170

 

Ala-Amazon login  http://www.oscommerce.com/community/contributions,2073

 

Order tracking  http://www.oscommerce.com/community/contributions,1522

 

Customers Per Products http://www.oscommerce.com/community/contributions,2095

 

Quick Product Adder http://www.oscommerce.com/community/contributions,194

 

More Info Button:  http://www.oscommerce.com/community/contributions,1889

 

Modified Invoice for Date and Order Number: http://www.oscommerce.com/forums/index.php?showtopic=83608

 

Modified Checkout_Payment Page: http://www.oscommerce.com/forums/index.php?showtopic=79750&st=0

 

Modified Invoice for Comments: http://www.oscommerce.com/forums/index.php?sho...=0entry154010

 

Modified Checkout_Shipping for 0 weight: http://www.oscommerce.com/forums/index.php?showtopic=105056

 

Quick Price Updates

http://www.oscommerce.com/community/contributions,122

 

Login Box w/My Account

http://www.oscommerce.com/community/contributions,590/page,5

 

State Abbreviation Fix

http://www.oscommerce.com/community/contri...te+abbreviation

 

Price List (HTML)

http://www.oscommerce.com/community/contri...arch,price+list

 

 

Batch Order Center

http://www.oscommerce.com/community/contributions,1235

 

 

Checkout for new customer modified

http://www.oscommerce.com/forums/index.php?showtopic=31021&st=0

 

Steve, I appreciate that you're taking the time to look at this.

Link to comment
Share on other sites

so your regular categories file is no longer on the server?

 

If using cache have you tried clearing the cache?

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Nope, old category file is not on the server.

 

By cache, do you mean the one under httpdocs? I do see lots of categories_box-english.cache on my server. Is it okay to just right click and then delete all the files in the cache folder? I've never messed with that folder before, so I don't want to mess anything up.

Link to comment
Share on other sites

Steve, it's doing something different now when I click on a specific category or hit refresh. It goes to just showing one bullet/line, and all the rest have disappeared. I haven't done anything to the site at all, just looked at the cache folder to see what was in there.

Link to comment
Share on other sites

in your admin under configuration and cache what do you have.

 

is cache set true

 

in admin under tools and Cache Control do you have a file for categories box

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Steve, cache is set to "true" in my admin-configuration section. Also gives the cache directory, which is /home/httpd/vhosts/my-site/httpdocs/cache/.

 

In the tools section, yes, there is one in there for categories box, with today's date next to it.

 

Rachel

Link to comment
Share on other sites

first step is to set cache false then see if things work. If things then work reset the file categories box in tools cache control.

 

my guess is the issue is being drawn from the cache which has yet to be populated with the new images etc for the categories box

Edited by 241

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

if you have reset the file in cache control for categories box then you can set cache back to true. It will take time to repopulate the cache file

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Hi All,

 

I was wondering if there is a way to show all categories with this contribution?

 

thanks!

If you mean in reference to your other post and the messed up code, yes it is possible and does not necesitate the use of this contribution as this contribution is a standard categories.php with a few code changes.

Hi steve,

 

Thanks for taking the time out to reply... are you able to explain this in a little more detail?

 

I was really after something like your contribution but with all categories showing... i like the idea of the bullets on the side... it looks neat.

 

Can you explain what additions i need to make to your code to show all the categories...

 

Thanks Heaps!

Link to comment
Share on other sites

Steve:

 

I like the contribution alot. One problem however. When I turn on the cache option (in admin) the category list does not show on the index.php page.

 

Did I miss configuring something?

I would doubt that this is due to the contribution.

 

Did you have cache On before the contribution.

 

This is most likely to do with your setup.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

  • 2 weeks later...

Not sure if this is correct place to post but is there any way to modify this to make the information infobox and also the news categories and latest news infoboxes from the newsdesk contribution look the same way as the categories [with line and bullets] as this would help make my site a bit more unified. I went to the newsdesk demo site but got a bed and breakfast site round the corner from my flat. :P

Link to comment
Share on other sites

Not sure if this is correct place to post but is there any way to modify this  to make the information infobox and also the news categories and latest news infoboxes from the newsdesk contribution look the same way as the categories [with line and bullets] as this would help make my site a bit more unified. I went to the newsdesk demo site but got a bed and breakfast site round the corner from my flat. :P

 

Which demo site would that be then as the demo link does not point to a bed and breakfast site and never has pointed to a bed and breakfast site.

 

Yes that is what I have done, however this is the support for Categories Bullet and line and not newsdesk.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Ok, finnaly I understand that this is the correct place for this question.

 

Can I combine this contribution, with "Graphical Infobox Headers"??

 

Graphical Infobox Headers allow to use graphical headers for all side info tables, and it's aviable here: http://www.oscommerce.com/community/contri...h,table+infobox

 

It's possible??

 

If not, how can I do?

 

Thank you.

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...