Talle Posted January 29, 2007 Share Posted January 29, 2007 Hi I have 2 questions regarding the Category Box Enhancement 2.2 1. I´d like to remove the drop down menu in the categories box. the one saying Go To... Then drop down menu. Since I do not know php I´d like to get someone to tell me what to delete in this: // BoF - Contribution Category Box Enhancement 1.1 global $tree, $categories_string, $cPath_array, $cat_name; or $cPath_new = 'cPath=' . $tree[$counter]['path']; if (isset($cPath_array) && in_array($counter, $cPath_array) && $cat_name == $tree[$counter]['name']) { //Link nicht anklickbar, wenn angewählt $categories_string .= '<a href="'; $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">'; //Link nicht anklickbar, wenn angewählt } else { or } //Link nicht anklickbar, wenn angewählt 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', ''); } or if ($cat_name == $tree[$counter]['name']) { $categories_string .= '<span class="errorText">'; } or if ($cat_name == $tree[$counter]['name']) { $categories_string .= '</span>'; or if (isset($cPath_array) && in_array($counter, $cPath_array)) { $categories_string .= '</b>'; or // 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 or if ( (basename($PHP_SELF) != FILENAME_SPECIALS)) { $info_box_contents[] = array('align' => 'left', 'text' => '<font size=-2><b><a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '">' . BOX_INFORMATION_SPECIALS . '</a></b></font>'); }else{ $info_box_contents[] = array('align' => 'left', 'text' => '<font size=-2><b><a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '"><span class="errorText">' . BOX_INFORMATION_SPECIALS . '</a></b></font></span>'); } if ( (basename($PHP_SELF) != FILENAME_PRODUCTS_NEW)) { $info_box_contents[] = array('align' => 'left', 'text' => '<font size=-2><b><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, '', 'NONSSL') . '">' . BOX_INFORMATION_PRODUCTS_NEW . '</a></b></font>'); }else{ $info_box_contents[] = array('align' => 'left', 'text' => '<font size=-2><b><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, '', 'NONSSL') . '"><span class="errorText">' . BOX_INFORMATION_PRODUCTS_NEW . '</a></b></font></span>'); } function tep_get_paths($categories_array = '', $parent_id = '0', $indent = '', $path='') { global $languages_id; if (!is_array($categories_array)) $categories_array = array(); $categories_query = tep_db_query("select c.categories_id, cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where parent_id = '" . (int)$parent_id . "' 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)) { if ($parent_id=='0'){ $categories_array[] = array('id' => $categories['categories_id'], 'text' => $indent . $categories['categories_name']); } else{ $categories_array[] = array('id' => $path . $parent_id . '_' .$categories['categories_id'], 'text' => $indent . $categories['categories_name']); } if ($categories['categories_id'] != $parent_id) { $this_path=$path; if ($parent_id != '0') $this_path = $path . $parent_id . '_'; $categories_array = tep_get_paths($categories_array, $categories['categories_id'], $indent . ' ', $this_path); } } return $categories_array; } $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">' . tep_hide_session_id(), 'align' => 'left', 'text' => '<b>' . BOX_DROPDOWN_MENUS . '<br>' . tep_draw_pull_down_menu('cPath', tep_get_paths(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath, 'onchange="this.form.submit();" style="width: 100%"') ); these are the lines I added to categories.php 2. I do also want to know how to change the color of the hoovered and active links, want them to be dark grey not red as they are now.... They where so before I added the lines above.... Thank you! //Talle Link to comment Share on other sites More sharing options...
GemRock Posted January 29, 2007 Share Posted January 29, 2007 Hi Talle If you dont like the drop down, then you use the one by Kurt Dunzinger (2005), which does not have a drop down list. The following is the code that add the drop down: $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">' . tep_hide_session_id(), 'align' => 'left', 'text' => '<b>' . BOX_DROPDOWN_MENUS . '<br>' . tep_draw_pull_down_menu('cPath', tep_get_paths(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath, 'onchange="this.form.submit();" style="width: 100%"') ); The function tep_draw_pull_down_menu is the function creating the drop down. HTH Ken commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile). over 20 years of computer programming experience. Link to comment Share on other sites More sharing options...
Talle Posted January 29, 2007 Author Share Posted January 29, 2007 Thanx Ken. I have still not had any luck regarding the bold and underlined categories. and normal fonted subcategories. Have you any pointers or suggestions for me? What I want it to look like: Category 1 -SubCategory 1 Category 2 -SubCategory 2 Category 3 -SubCategory 3 But I want this without using <b><u> in the categories in admin panel..... please!!!!! Thank you again, Link to comment Share on other sites More sharing options...
GemRock Posted January 29, 2007 Share Posted January 29, 2007 OK, Find this block of code: 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>'; } and change it to: // if (isset($cPath_array) && in_array($counter, $cPath_array)) { $categories_string .= '<b><u>'; // } // display category name $categories_string .= $tree[$counter]['name']; // if (isset($cPath_array) && in_array($counter, $cPath_array)) { $categories_string .= '</b></u>'; // } I think that will do it, although I haven't tested it myself. Let me know if it works. You are the only one who wants to do this! :) Ken commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile). over 20 years of computer programming experience. Link to comment Share on other sites More sharing options...
Talle Posted January 29, 2007 Author Share Posted January 29, 2007 Hi Ken. It was worth a try unfortunaly it didn´t work.... The result was that everything went underlined and bold, subcategories to. I just want the categories to be bold constantly and only change color when active. The subcategories should only be bold and a different color when active (not underlined)... otherwise they should be normal font. Wierd that it´s only me who want this, I think it´s a nice way to keep the major categories separated from the subcategories, which makes it easier to navigate betwen the categories.... But I guess I´m a bit wierd then.... ;) So I´m back to zero.... best regards! /Talle Link to comment Share on other sites More sharing options...
GemRock Posted January 29, 2007 Share Posted January 29, 2007 Hi Talle In that case a deeper hack into the categories.php is needed but I think its not worth it. There's many other contribs out there that would give a better look & feel of the categories box. But if you insist on doing your way then try the following: Find the this line (at about line 507) in application_top.php (from the contrib): $breadcrumb_tags->add($categories['categories_name']); chnage it to: $breadcrumb_tags->add(strip_tags($categories['categories_name'])); That should strip off the html tags you enter in the category name. HTH Ken commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile). over 20 years of computer programming experience. Link to comment Share on other sites More sharing options...
GemRock Posted January 29, 2007 Share Posted January 29, 2007 For those who already downloaded the contrib, please correct the two typos in the included application_top.php: line 542 should read: $header_tags[keywords_tag]= trim(strip_tags($header_tags[keywords_tag])); That is, *keywords*, not *kewwords*. Sorry for the typo. Ken commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile). over 20 years of computer programming experience. Link to comment Share on other sites More sharing options...
GemRock Posted January 29, 2007 Share Posted January 29, 2007 Sorry, just realised I posted it to the wrong thread! wonder why I could not find it in the contrib support!!! Ken commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile). over 20 years of computer programming experience. Link to comment Share on other sites More sharing options...
Talle Posted January 30, 2007 Author Share Posted January 30, 2007 Hi ken. Thank you very much for your efforts. I have sorted out the problem, I installed Great Categories Contrib. In that I had the posibility to make the major category bold in the stylesheet after adding some lines. see here: http://www.babies.se Another thing that your brain is better for than mine I guess.... I have the web stats by Azer installed and with that contrib comes the posibility to see what pages the customer have Visited. For me it only show my domain www.mydomain.se and not the pages shown. Any suggestions? Best regards! //Talle Link to comment Share on other sites More sharing options...
GemRock Posted January 30, 2007 Share Posted January 30, 2007 Hi Talle Glad to know you finally found what you wanted, and that Kategorier Box is really a good choice for your site! But sorry I know nothing about Azer, never heard about it, so I cant advise you on that. :( Good Luck! Ken commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile). over 20 years of computer programming experience. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.