bongo Posted April 27, 2006 Share Posted April 27, 2006 Hi, I have installed More Category Boxes on my web site. Im trying to make this include the theme i have bougt for my site. Tried to make it work, but dont get it all to work. Here is the code for the original file that i want to implement sow that the design is right on the More Categoy Boxes script. [/<?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 */ function tep_show_category($counter) { global $tree, $categories_string, $cPath_array; $categories_string .= '<tr><td class="infoBoxContents" height="18">'; if ($tree[$counter]['parent'] == 0) { $categories_string .= tep_image(DIR_WS_IMAGES . 'theme/arrow.jpg') . ' '; } for ($i=0; $i<$tree[$counter]['level']; $i++) { $categories_string .= " "; } $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>'; } $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 .= '</td></tr><tr><td height="1" bgcolor="E5E4E4"></td></tr>'; if ($tree[$counter]['next_id'] != false) { tep_show_category($tree[$counter]['next_id']); } } ?> <!-- categories //--> <tr> <td><?php echo tep_image(DIR_WS_IMAGES . 'theme/box_top.jpg'); ?></td> </tr> <tr> <td background="images/theme/box_bg.jpg"> <table width="90%" align="center" cellpadding="0" cellspacing="0"> <tr><td height="5"></td></tr> <?php $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); echo $categories_string; ?> </table></td> </tr> <tr> <td><?php echo tep_image(DIR_WS_IMAGES . 'theme/box_bottom.jpg'); ?></td> </tr> <tr> <td height="10"></td> </tr> <!-- categories_eof //--> Hope somebody can help me :D The script is just fantastic when you want seperate categories. Thanks :thumbsup: Best Regards Thomas B Quote Link to comment Share on other sites More sharing options...
delpierras Posted May 27, 2006 Share Posted May 27, 2006 Hi. The question was asked now several times in this thread. But there has never been an answer to it: The category names of the boxes are only in ONE language (there's only one box in the admin menu for it). How can you use is as multi-lingual? I mean that the category names OF THE BOXES show different names depending on the language you've chosen. Cheers mates for your help :blush: Quote Link to comment Share on other sites More sharing options...
Guest Posted June 6, 2006 Share Posted June 6, 2006 @jvdmaas - I haven't seen the problem with the tables being moved down, but if you use the Web Developer extension with Firefox you should be able to tell what's going on table-wise. @kevinz - Look for this code near the end of includes/more_categories.php: echo "\n</td>\n</tr>\n"; Add another one of those and it should do what you need. Modify it as needed for your desired look/feel. @delpierras - Sorry, this contrib isn't yet multi-language capable. -jared Quote Link to comment Share on other sites More sharing options...
doublesam Posted June 29, 2006 Share Posted June 29, 2006 Hi all! Has any one managed to display dategory name in main content (in the product listing page) using the More Category Boxes contribution?. I don't have anything appearing there. Actually, there is a contribution which does that (Display Category Name In Main Content), it is a simple line of code: In /catalog/index.php, find this code (line 232 in clean osCommerce v2.2 MS) <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> and change to : <td class="pageHeading"> <?php // hacked to display current category name in main content area! echo $tree[$current_category_id]['name']; ?> But I did not managed to make it work with More Category Boxes. Doublesam Secondary question: would it be very difficult to have the box heading titles multilingual? Thanks for the help. Quote Link to comment Share on other sites More sharing options...
tec Posted July 24, 2006 Share Posted July 24, 2006 hiya, have a quick question, is there a way to make each new category box a drop down? does anyone know of a contribution that will do this? my client has a coin site, and has many subs, causing the load time to sometimes be too long, so i am looking for a mod where i can create seperate drop downs for each category Quote Link to comment Share on other sites More sharing options...
Simpel Posted August 19, 2006 Share Posted August 19, 2006 (edited) This is a very nice contribution! I got only one problem. I like to have a pulldown menu in the new category boxes. I tried and it works. But now I get an pull down menu of all the categories and not the one I had choosen to put in my new category boxes. Does anyone got an solution? I thought it will be a mix of those: $info_box_contents = array(); ------------------------- $info_box_contents[] = array('text' => new_tep_show_category $boxId,$cPath_array,$tree,$first_element)); and $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">' . tep_hide_session_id(), 'align' => 'left', 'text' => tep_draw_pull_down_menu('cPath', tep_get_paths(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath, 'onchange="this.form.submit();"') ); --------------------- Thanks in advance Edited August 19, 2006 by Simpel Quote Link to comment Share on other sites More sharing options...
♥stubbsy Posted August 21, 2006 Share Posted August 21, 2006 Hi there, is there an easy way in which the display order of the categories can be changed? I currently have 3 and I wasnt to temporarily add a new on at the top. Any ideas? Cheers Stubbsy Quote Link to comment Share on other sites More sharing options...
tdig Posted September 15, 2006 Share Posted September 15, 2006 Hi Jared, Great contrib. I need one category box in the left column and one in the right column. I can do that by enabling default "normal" category in the left and modifying "More Category Boxes" to column_right.php but then what is listed in the right box must also be in the left box - correct? Is it possible to disable default category box and modify your code to assign category1 to left and category2 to right? Or.. Is it possible to install 2 "More Category Boxes" and rename all instances of the second to more-categories2? Or.. Any other way? It is for two retail stores under one roof wanting to share a website but have it as seperate as possible. Thanks for any suggestions. -Tim Quote Link to comment Share on other sites More sharing options...
kdogg Posted October 5, 2006 Share Posted October 5, 2006 I need some help here. I have just installed this at www.empireairsoft.com and its working great with firefox browser. However when you use internet exploror, every catagory has a red X next to it like an image is missing. How do I fix this so it displays right in IE too.? Quote Link to comment Share on other sites More sharing options...
kdogg Posted October 5, 2006 Share Posted October 5, 2006 Ok well, its calling for some images that it wasnt looking for before this mod. It's looking for the fallowing: catalog/images/arrw1_L.gif catalog/images/arrw2_L.gif Are these something that are suppose to be in with the contribution? Is there a way to disable it calling for them? Quote Link to comment Share on other sites More sharing options...
Guest Posted October 9, 2006 Share Posted October 9, 2006 Is there any way to show the More Category Boxes as a pulldown menu? Thanks :D Quote Link to comment Share on other sites More sharing options...
♥stubbsy Posted November 25, 2006 Share Posted November 25, 2006 Hi there, i'm trying to develop this a little and add title text to the link which is produced for the each category. I have been given a pointer on where to start, but cannot seem to get it working correctly. Basically what I am trying to achieve is to add the name of the category as the title of the link. e.g. if my first category is called 'motocross gear' then the link would actually look like this <a href="http://www.mysite.com/motocross-gear.html?infoBox=1" title="motocross gear">motocross gear</a> Can anyone help? Cheers Dave Quote Link to comment Share on other sites More sharing options...
agcadmin Posted December 30, 2006 Share Posted December 30, 2006 Hello. Is there a way to replace the customizable name (infobox heading) for a new category box with a jpg or gif? Any help would be greatly appreciated. Thanks, Dave Quote Link to comment Share on other sites More sharing options...
Guest Posted January 5, 2007 Share Posted January 5, 2007 I've had this contrib installed for some time now. Works a treat and installed and worked first time. I have a new need now and as part of my research I searched here hoping I would find someone had already solved my query and I wouldn't have to re-invent the wheel. Turns out the only reference was someone else asking the same question Hi Jared,Great contrib. I need one category box in the left column and one in the right column. I can do that by enabling default "normal" category in the left and modifying "More Category Boxes" to column_right.php but then what is listed in the right box must also be in the left box - correct? Is it possible to disable default category box and modify your code to assign category1 to left and category2 to right? Or.. Is it possible to install 2 "More Category Boxes" and rename all instances of the second to more-categories2? Or.. Any other way? It is for two retail stores under one roof wanting to share a website but have it as seperate as possible. Thanks for any suggestions. -Tim Can anyone point me in the right direction? Quote Link to comment Share on other sites More sharing options...
tec Posted January 8, 2007 Share Posted January 8, 2007 has anyone figured out how to get the sub cats to show? so i can have 2 boxes, both showing different categories and their respective sub cats Quote Link to comment Share on other sites More sharing options...
tec Posted January 8, 2007 Share Posted January 8, 2007 ok, another question, i believe it was also posted above, is there a way to have images for each new box? Quote Link to comment Share on other sites More sharing options...
Veronica Posted February 14, 2007 Share Posted February 14, 2007 Is possible apply to More Category Boxes CSS format? How?? pleaseeee Quote Link to comment Share on other sites More sharing options...
danitrin Posted February 15, 2007 Share Posted February 15, 2007 Where is the code to edit the 'look' of the catagory boxes, I need it to blend in with my site theme Quote Link to comment Share on other sites More sharing options...
danitrin Posted February 15, 2007 Share Posted February 15, 2007 I have another question, in the admin area where you select a category, my categorys are all populated with the same product..how do I correct this? Quote Link to comment Share on other sites More sharing options...
danitrin Posted February 15, 2007 Share Posted February 15, 2007 Please ignore my second question, I figured it out Quote Link to comment Share on other sites More sharing options...
danitrin Posted March 8, 2007 Share Posted March 8, 2007 Has anyone used this with a template based website. I'm having a hard time integrating this into my existing site and could use some help if anyone has had any experience with this. Thanks! Quote Link to comment Share on other sites More sharing options...
Guest Posted April 13, 2007 Share Posted April 13, 2007 Hi Jared, Back again :blush: I have installed ultimate SEO by chemo and am now having an issue with the "?infobox=0" being tagged onto the end of my .html urls. It probably is something I should ask on ultimate seo's as well but thought I'd query you first. The other clash with the seo contrib is that all categories show in all boxes regardless of where I have them assigned in the admin. Not good :( :( I feel like crying. I *need* both contribs. I'll search around both contribs to see if I can find where they seem to be rubbing eachother the wrong way. Look forward to your thoughts. Sheri Hi Sheri, it's a long time ago since you wrote this but.... did you solve the problem with Ultimate SEO and More Categories and get both to work. Or is here anyone who did it right?? My problem is that the subcategories in a second box will not be shown if i click it. The subcategories in box1 do. I replace in more_categories.php $categories_string .= tep_href_link(FILENAME_DEFAULT, 'infoBox=' . $boxId . '&' . $cPath_new) . '">'; with $categories_string .= tep_href_link(FILENAME_DEFAULT, '&' . $cPath_new) . '">'; the "?infobox=0" disappeared and my USEO Urls didn't change. But after that the subcategories don't appear in box2. When I don't change the a.m. code , it will work fine but the URLs change and that's not what we like.... :-( I hope that someone can help me greetings from Germany Bernd Quote Link to comment Share on other sites More sharing options...
Holder Posted May 7, 2007 Share Posted May 7, 2007 I have created 6 categories - 1, 2, 3, 4, 5, 6 In more categories have chosen box1 - 1, 2 and 3 category, and in box2 have chosen 4, 5 and 6 category In the catalogue categories are displayed: box1 1 2 3 box2 1 <--- WRONG, it should not be here! 4 5 6 All made under the instruction in a file readme.txt Help me please Quote Link to comment Share on other sites More sharing options...
MJP Posted May 8, 2007 Share Posted May 8, 2007 from the readme: "If you don't want cat-one to show up in that category box along with cat-three and cat-four, you MUST change ALL of the remaining slots in that infobox to either cat-three or cat-four." so you shouldn't select cat 1 to be included in the Box 2 as you have it. you should set all the catergories for box 2 to 4,5, or 6 Quote Link to comment Share on other sites More sharing options...
Holder Posted May 8, 2007 Share Posted May 8, 2007 Thanks, i badly know english... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.