hjp Posted February 27, 2004 Share Posted February 27, 2004 i'm trying to use coolMenu!it's really nice! good work! i found out how to position it via oCMenu.fromLeft=10 oCMenu.fromTop=100. but the problem is just how to get rid of previous side box appeared through this code behind coolMenu: if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include(DIR_WS_BOXES . 'coolmenu.php'); } thanx!!! There are several ways e.g. you could include an invisible image with preferred height and width instead if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include('invisible image'); } or you could make coolmenu overflow the box beneath (ajust position, widht and height of coolmenu, so that the box is covered or something else Quote Link to comment Share on other sites More sharing options...
Guest Posted February 27, 2004 Share Posted February 27, 2004 is there a way to get coolmenu to work with a centered site? i've looked around, but cant find any fixes. Quote Link to comment Share on other sites More sharing options...
sb_1 Posted February 27, 2004 Share Posted February 27, 2004 Yes, i just worked through this issue. You need to add a div tag, find the div, and use it as a reference to position your menu. That part is all easy. The part that was hard for me is to have the menu show up in the right position onload, and ot just onresize. The way i fixed this was to call the resize funtion from the onload in the body tag. If you need specific code examples let me know. Scott [email protected] Quote Link to comment Share on other sites More sharing options...
romalong Posted February 27, 2004 Share Posted February 27, 2004 There are several ways e.g.you could include an invisible image with preferred height and width instead if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include('invisible image'); } or you could make coolmenu overflow the box beneath (ajust position, widht and height of coolmenu, so that the box is covered or something else ok... the instruction says to replace: include(DIR_WS_BOXES . 'categories.php'); by: include(DIR_WS_BOXES . 'coolmenu.php'); i comment this include at all and side box disappeared leaving coolMenu intact and it seems to be working properly. though what the difference between including invisible image and just commenting that include? what is coolmenu.php for if you suggest to include an invisible image instead of it? no need to include coolmenu.php? tnx! Quote Link to comment Share on other sites More sharing options...
hjp Posted February 27, 2004 Share Posted February 27, 2004 i'm trying to use i found out how to position it via oCMenu.fromLeft=10 oCMenu.fromTop=100. but the problem is just how to get rid of previous side box appeared through this code behind coolMenu: if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include(DIR_WS_BOXES . 'coolmenu.php'); } I understood from your quote that the box was shown behind the coolmenu, and that you wanted to get rid of the box, but if that's not the case you seem to have found out yourself simply by following the instructions on how to install the coolmenu contribution. Quote Link to comment Share on other sites More sharing options...
msheno01 Posted February 28, 2004 Share Posted February 28, 2004 hjp, my current beta site is still no live. Here are the files that needed to be edited. /index.php <?php /* $Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); // the following cPath references come from application_top.php $category_depth = 'top'; if (isset($cPath) && tep_not_null($cPath)) { $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); $cateqories_products = tep_db_fetch_array($categories_products_query); if ($cateqories_products['total'] > 0) { $category_depth = 'products'; // display products } else { $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'"); $category_parent = tep_db_fetch_array($category_parent_query); if ($category_parent['total'] > 0) { $category_depth = 'nested'; // navigate through the categories } else { $category_depth = 'products'; // category has no products, but display the 'no products' message } } } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <script LANGUAGE="JavaScript1.2" SRC="includes/menu_animation.js"></SCRIPT> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <?php require(DIR_WS_INCLUDES . 'html_title.php'); ?> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <?php if ($category_depth == 'nested') { $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'"); $category = tep_db_fetch_array($category_query); ?> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <?php if (isset($cPath) && strpos('_', $cPath)) { // check to see if there are deeper categories within the current category $category_links = array_reverse($cPath_array); for($i=0, $n=sizeof($category_links); $i<$n; $i++) { $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'"); $categories = tep_db_fetch_array($categories_query); if ($categories['total'] < 1) { // do nothing, go through the loop } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); break; // we've found the deepest category the customer is in } } } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); } $number_of_categories = tep_db_num_rows($categories_query); $rows = 0; while ($categories = tep_db_fetch_array($categories_query)) { $rows++; $cPath_new = tep_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n"; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; } } // needed for the new products module shown below $new_products_category_id = $current_category_id; ?> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td> </tr> </table></td> </tr> </table></td> <?php } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) { // create column list $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL, 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME, 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER, 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE, 'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY, 'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT, 'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE, 'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW); asort($define_list); $column_list = array(); reset($define_list); while (list($key, $value) = each($define_list)) { if ($value > 0) $column_list[] = $key; } $select_column_list = ''; for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { switch ($column_list[$i]) { case 'PRODUCT_LIST_MODEL': $select_column_list .= 'p.products_model, '; break; case 'PRODUCT_LIST_NAME': $select_column_list .= 'pd.products_name, '; break; case 'PRODUCT_LIST_MANUFACTURER': $select_column_list .= 'm.manufacturers_name, '; break; case 'PRODUCT_LIST_QUANTITY': $select_column_list .= 'p.products_quantity, '; break; case 'PRODUCT_LIST_IMAGE': $select_column_list .= 'p.products_image, '; break; case 'PRODUCT_LIST_WEIGHT': $select_column_list .= 'p.products_weight, '; break; } } // show the products of a specified manufacturer if (isset($HTTP_GET_VARS['manufacturers_id'])) { if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only a specific category $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'"; } else { // We show them all $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"; } } else { // show the products in a given categorie if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only specific catgeory $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; } else { // We show them all $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; } } if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) { for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { if ($column_list[$i] == 'PRODUCT_LIST_NAME') { $HTTP_GET_VARS['sort'] = $i+1 . 'a'; $listing_sql .= " order by pd.products_name"; break; } } } else { $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1); $sort_order = substr($HTTP_GET_VARS['sort'], 1); $listing_sql .= ' order by '; switch ($column_list[$sort_col-1]) { case 'PRODUCT_LIST_MODEL': $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_NAME': $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : ''); break; case 'PRODUCT_LIST_MANUFACTURER': $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_QUANTITY': $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_IMAGE': $listing_sql .= "pd.products_name"; break; case 'PRODUCT_LIST_WEIGHT': $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_PRICE': $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; } } ?> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php $category_query1 = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'"); $category1 = tep_db_fetch_array($category_query1); if ($category1['categories_name'] != "") {echo $category1['categories_name'];} else { echo HEADING_TITLE;} ?></td> <?php // optional Product List Filter if (PRODUCT_LIST_FILTER > 0) { if (isset($HTTP_GET_VARS['manufacturers_id'])) { $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name"; } else { $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name"; } $filterlist_query = tep_db_query($filterlist_sql); if (tep_db_num_rows($filterlist_query) > 1) { echo ' <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' '; if (isset($HTTP_GET_VARS['manufacturers_id'])) { echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']); $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)); } else { echo tep_draw_hidden_field('cPath', $cPath); $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS)); } echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']); while ($filterlist = tep_db_fetch_array($filterlist_query)) { $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']); } echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"'); echo '</form></td>' . "\n"; } } // Get the right image for the top-right $image = DIR_WS_IMAGES . 'table_background_list.gif'; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"); $image = tep_db_fetch_array($image); $image = $image['manufacturers_image']; } elseif ($current_category_id) { $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); $image = tep_db_fetch_array($image); $image = $image['categories_image']; } ?> <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <!-- BOF: Show subcategories in Product Listing --> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"><tr><?php if (isset($HTTP_GET_VARS['manufacturers_id'])) { }else{ if (isset($cPath)) { if (ereg('_', $cPath)) { $category_links = array_reverse($cPath_array); $cat_to_search = $category_links[0]; } else { $cat_to_search = $cPath; } // check to see if there are deeper categories within the current category $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $cat_to_search . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by sort_order, cd.categories_name"); if (tep_db_num_rows($categories_query) > 0 ) { $rows = 0; while ($categories = tep_db_fetch_array($categories_query)) { $rows++; $cPath_new = tep_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo ' <td align="center" class="smallText" style="width: ' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n"; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != tep_db_num_rows($categories_query))) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; } } } } } ?></tr></table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <!-- EOF: Show subcategories in Product Listing --> <tr> <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td> </tr> </table></td> <?php } else { // default page ?> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="main"><?php echo tep_customer_greeting(); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"><?php include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td> </tr> <?php include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS); ?> </table></td> </tr> </table></td> <?php } ?> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> /includes/coolmenu.php <?php /* ------------------------------------------------ coolMenu for osCommerce author: Andreas Kothe url: http://www.oddbyte.de Released under the GNU General Public License ------------------------------------------------ */ // --- CONFIG --- define('SHOW_COUNT','false'); define('SUB_CATEGORIES','2'); if (MAX_MANUFACTURERS_LIST < 2) { $cat_choose = array(array('id' => '', 'text' => BOX_CATEGORIES_CHOOSE)); } else { $cat_choose = ''; } ?> <!-- Copyright 2002 www.dhtmlcentral.com -- modified for PHP and osCommerce by Andreas Kothe - www.oddbyte.de --> <script> //Extra code to find position: function findPos(){ if(bw.ns4){ //Netscape 4 x = document.layers.tlayerm.pageX y = document.layers.tlayerm.pageY }else{ //other browsers x=0; y=0; var el,temp el = bw.ie4?document.all["topm"]:document.getElementById("topm"); if(el.offsetParent){ temp = el while(temp.offsetParent){ //Looping parent elements to get the offset of them as well temp=temp.offsetParent; x+=temp.offsetLeft y+=temp.offsetTop } } x+=el.offsetLeft y+=el.offsetTop } //Returning the x and y as an array return [x,y] } oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname pos = findPos() //Menu properties oCMenu.pxBetween=0 //experiment with fromleft and fromtop - I use -2 and -7 but you can try something different and place the menu anywhere on the page oCMenu.fromLeft=pos[0]-2 oCMenu.fromTop=pos[1]-7 oCMenu.onresize="location.reload()" oCMenu.rows=0 // etc. oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname //Menu properties oCMenu.pxBetween=0 oCMenu.fromLeft=70 oCMenu.fromTop=125 oCMenu.rows=0 oCMenu.menuPlacement="left" oCMenu.offlineRoot="" oCMenu.onlineRoot="" oCMenu.resizeCheck=1 oCMenu.wait=200 oCMenu.fillImg="cm_fill.gif" oCMenu.zIndex=0 //Background bar properties oCMenu.useBar=1 oCMenu.barWidth="menu" oCMenu.barHeight="menu" oCMenu.barClass="clBar" oCMenu.barX="menu" oCMenu.barY="menu" oCMenu.barBorderX=0 oCMenu.barBorderY=0 oCMenu.barBorderClass="" oCMenu.level[0]=new cm_makeLevel() oCMenu.level[0].width=156 oCMenu.level[0].height=18 oCMenu.level[0].regClass="clLevel0" oCMenu.level[0].overClass="clLevel0over" oCMenu.level[0].borderX=1 oCMenu.level[0].borderY=1 oCMenu.level[0].borderClass="clLevel0border" oCMenu.level[0].offsetX=0 oCMenu.level[0].offsetY=0 oCMenu.level[0].rows=0 oCMenu.level[0].arrow="images/arrow.gif" oCMenu.level[0].arrowWidth=11 oCMenu.level[0].arrowHeight=11 oCMenu.level[0].align="right" oCMenu.level[0].filter="progid:DXImageTransform.Microsoft.Fade(duration=0.1)" <?php for ($i=1; $i<SUB_CATEGORIES; $i++) { echo' oCMenu.level[' . $i . ']=new cm_makeLevel() oCMenu.level[' . $i . '].width=156 oCMenu.level[' . $i . '].height=14 oCMenu.level[' . $i . '].regClass="clLevel1" oCMenu.level[' . $i . '].overClass="clLevel1over" oCMenu.level[' . $i . '].borderX=1 oCMenu.level[' . $i . '].borderY=1 oCMenu.level[' . $i . '].align="right" oCMenu.level[' . $i . '].offsetX=0 oCMenu.level[' . $i . '].offsetY=0 oCMenu.level[' . $i . '].borderClass="clLevel1border" oCMenu.level[' . $i . '].align="right" oCMenu.level[' . $i . '].filter="progid:DXImageTransform.Microsoft.Fade(duration=0.3)" '; } // end for // --- function blank_length($text) { $count = 0; while(substr($text, 0,12) == " ") { $text = substr($text, 12); $count++; } return $count; } // --- function print_menu_line($categories, $depth_size,$depth_parentid, $depth) { $size=0; for($i=0; $depth_size[$i]!=0; $i++) { $size++; } echo "oCMenu.makeMenu('"; if ($depth == 0) { echo "top" . '_'.$depth_size[0] . "','','"; } else if ($depth == 1) { echo "sub" .'_'.$depth_size[0] .'_'. $depth_size[1] . "','top" .'_'. $depth_size[0] . "','"; } else { // $depth < 1 echo "sub"; for ($i=0; $i<$size; $i++) { echo ($depth_size[$i] != 0) ? '_'.$depth_size[$i] : '_'; } echo "','sub"; for ($i=0; $i<$size-1; $i++) { echo ($depth_size[$i] != 0) ? '_'.$depth_size[$i] : '_'; } echo "','"; } echo $categories['text']; if (SHOW_COUNT == 'true') { $products_in_category = tep_count_products_in_category($categories['id']); if ($products_in_category > 0) { echo "<FONT COLOR=\"#c0c0c0\"> (" . $products_in_category . ")</FONT>"; } } $cPathNew = "cPath="; for ($i=0; $i<$size-1; $i++) { $cPathNew .= ($depth_size[$i] != 0) ? $depth_parentid[$i].'_':''; } $cPathNew .= $categories['id']; echo "','" . tep_href_link(FILENAME_DEFAULT,$cPathNew) . "')\n"; } // --- $categories = tep_get_categories(''); $result=tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where parent_id = '0'"); mysql_num_rows($result); $height.= 50*mysql_num_rows($result)-20+mysql_num_rows($result); $depth=0; $blank_length; $depth_size; $depth_parentid; for($i=0; $i<count($categories); $i++) { // don't insert 1st entry ("please choose ...") $blank_length = blank_length($categories[$i]['text']); if($blank_length == $depth) { $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } else if ($blank_length > $depth) { $depth++; $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } else if ($blank_length < $depth) { for ($j=$depth; $j>$blank_length; $j--) { $depth_size[$j] = 0; $depth--; } $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } $depth_parentid[$categories[$i]['depth']] = $categories[$i]['id']; // remove blanks $categories[$i]['text'] = substr($categories[$i]['text'], 12*$blank_length); print_menu_line($categories[$i], $depth_size,$depth_parentid, $depth); } ?> // create menu oCMenu.construct() <!-- Copyright 2002 www.dhtmlcentral.com -- modified for PHP and osCommerce by Andreas Kothe - www.oddbyte.de --> </SCRIPT>[QUOTE] Quote Link to comment Share on other sites More sharing options...
hjp Posted February 28, 2004 Share Posted February 28, 2004 I don't see where you include your coolmenu in index.php. If it is not included it won't show. Try to follow the instructions in the coolmenu contrib. Quote Link to comment Share on other sites More sharing options...
Islander2u Posted February 28, 2004 Share Posted February 28, 2004 Are there any plans to release/submit an updated version of this contribution that will work with or without center shop? Or do we need to continually read through 50+ pages each time to find the fixes. I have not added this to my shop yet, but reading through this thread, I see the same questions, problems, and mistakes brought up over and over. If someone has gotten it working properly, wouldn't it be a good idea? As I haven't added this yet I don't know if this is because it is widely depending on how the user has set up there shop and not the contribution its self. I don't want these questions to be taken the wrong way. I know its a lot of time and effort to build these contributions, and everyone in the community appreciates the help, but it would be helpful. Quote Link to comment Share on other sites More sharing options...
hjp Posted February 28, 2004 Share Posted February 28, 2004 Are there any plans to release/submit an updated version of this contribution that will work with or without center shop? Or do we need to continually read through 50+ pages each time to find the fixes. Who would be willing to do it.? You have to find one who is going to use his or her spare time and work for free in order to help you with a finished solution. For instance, I have given a solution on how to use coolmenu with a centered shop. I did not post the solution because I thought it would be nice to help a lot of unknown people. I did it, because I wanted to have a centered page with coolmenu on my own web shop and did not find a solution for that in the forum. So I made my own solution because I needed it myself. Having done that I found it would be fair to share my solution with others, also because I got helped myself of which of course, the oscommerce software is the biggest gain. And that, I think but don't know of course, is the way contributors of fixes and solutions do it. And therefore, untill somebody of pure good will puts together a finished solution, which would be hard to put together because of all the different possibilities, others will have to read through the posts in the forums and pick out what's right for them. But I do agree, that it is sometimes hard do find the right solution, especially when you are not familiar with the structure of oscommerce, javascript and php. It has been time consuming for me to walk through the oscommerce code but I found out that I definitely had to understand the structure to be able to change anything. Quote Link to comment Share on other sites More sharing options...
msheno01 Posted February 29, 2004 Share Posted February 29, 2004 The coolmenu shows, it is just that the catagories box is small, and the coolmenu is not dynamic to the the infobox. How do i get it to fit in the info box? Thanks for help Quote Link to comment Share on other sites More sharing options...
hjp Posted February 29, 2004 Share Posted February 29, 2004 The coolmenu shows, it is just that the catagories box is small, and the coolmenu is not dynamic to the the infobox. How do i get it to fit in the info box? Thanks for help Do you use a centered shop or a shop that fills the hole page? Can you show me /includes/boxes/coolmenu.php and /includes/footer.php Quote Link to comment Share on other sites More sharing options...
romalong Posted February 29, 2004 Share Posted February 29, 2004 i've got three different languages on my OSC. coolMenu doesn't want to show categories if i switch to english. who knows why? tnx!!! Quote Link to comment Share on other sites More sharing options...
Islander2u Posted February 29, 2004 Share Posted February 29, 2004 ...would be hard to put together because of all the different possibilities... HJP, Thank you for your response. That was my main question, is there one fix that works with the majority of configurations (no centershop or with) and it sounds like no, there are other factors as well. After having read this thread, I know how time consuming it must be, it looks as though you live in here, but your input and tips are greatly appreciated. Thanks Quote Link to comment Share on other sites More sharing options...
msheno01 Posted March 1, 2004 Share Posted March 1, 2004 Thanks for your help. I have been trying to modify the code but am getting no where. Includes/boxes/coolmenu.php <?php /* ------------------------------------------------ coolMenu for osCommerce author: Andreas Kothe url: http://www.oddbyte.de Released under the GNU General Public License ------------------------------------------------ */ ?> <!-- coolMenu //--> <!-- copyright 2003 Andreas Kothe - www.oddbyte.de // --> <TR> <TD> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => 'coolMenu' ); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array(); if (MAX_MANUFACTURERS_LIST < 2) { $cat_choose = array(array('id' => '', 'text' => BOX_CATEGORIES_CHOOSE)); } else { $cat_choose = ''; } //the code below ajusts the height of the coolmenu dynamically according to the number of categories in the main menu $result=tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where parent_id = '0'"); $height.= A*mysql_num_rows($result)-18; //where A is the height of your oCMenu.level[0].height //experiment with the multiplyer denpending on the size of your menu $info_box_contents[] = array('text' => '<ilayer id="tlayerm"><div id="topm"><img src="images/trans.gif" width="'. BOX_WIDTH .'" height="' . $height . '"></div></ilayer>'); //BOX_WIDTH you set in .../includes/application_top.php new infoBox($info_box_contents); ?> </TD> </TR> <!-- coolMenu_eof //--> Includes/footer.php <table border="0" width="100%" cellspacing="0" cellpadding="1"> <tr class="footer"> <td class="footer">??<?php echo strftime(DATE_FORMAT_LONG); ?>?? </td> <td align="right" class="footer">??</td> </tr> <table border="0" width="100%" cellspacing="0" cellpadding="4"> <tr class="headerNavigation"> <td align="center" class="headerNavigation"><?php { ?><a href="<?php echo tep_href_link(FILENAME_PRIVACY, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo BOX_INFORMATION_PRIVACY; ?></a> ?|? <?php } ?><a href="<?php echo tep_href_link(FILENAME_CONDITIONS, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo BOX_INFORMATION_CONDITIONS; ?></a> ?|? <a href="<?php echo tep_href_link(FILENAME_SHIPPING, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo BOX_INFORMATION_SHIPPING; ?></a> ?|? <a href="<?php echo tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo BOX_INFORMATION_ALLPRODS; ?></a> ?|? <a href="<?php echo tep_href_link(FILENAME_CONTACT_US, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo BOX_INFORMATION_CONTACT; ?></a> ?|? <a href="<?php echo tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo BOX_INFORMATION_ALLPRODS; ?></a> ?|? <a href="allcategories.php" class="headerNavigation"><?php echo Categories ?></a></td> </tr> </table></table> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="center" class="smallText"> <?php echo FOOTER_TEXT_BODY ?> </td> </tr> </table> <?php if ($banner = tep_banner_exists('dynamic', '468x50')) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="center"><?php echo tep_display_banner('static', $banner); ?></td> </tr> <?php } require(DIR_WS_FUNCTIONS . 'user_tracking.php'); if ( OSC_CONFIG_USER_TRACKING == 'true') { tep_update_user_tracking(); } ?> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%" > <tr> <td width="33%"> </td> <td width="33%"> <img border="0" src="images/banners/fbtm.gif" ></td> <td width="34%">?</td> </tr> </table> </td> </tr> </table> <!-- coolMenu //--><?php require(DIR_WS_INCLUDES . 'coolmenu.php'); ?><!-- coolMenu_eof //--> Quote Link to comment Share on other sites More sharing options...
Godkid Posted March 1, 2004 Share Posted March 1, 2004 Hi, I know this is probably answered already but I've tried searching and haven't found the answer YET so I'm posting... I have the coolmenu installed and working.. however I can't get it positioned properly.. I'm using a store that extands across the page and the problem is that the coolmenu is vertically aligning too high.. i figure it's something with positioning.. but haven't been able to figure it out Any help is appreciated. God bless Quote Link to comment Share on other sites More sharing options...
romalong Posted March 1, 2004 Share Posted March 1, 2004 Hi, I know this is probably answered already but I've tried searching and haven't found the answer YET so I'm posting... I have the coolmenu installed and working.. however I can't get it positioned properly.. I'm using a store that extands across the page and the problem is that the coolmenu is vertically aligning too high.. i figure it's something with positioning.. but haven't been able to figure it out Any help is appreciated. God bless edit values of strings 46, 47 in the include/coolmenu.php. oCMenu.fromLeft=8 oCMenu.fromTop=153 Quote Link to comment Share on other sites More sharing options...
romalong Posted March 1, 2004 Share Posted March 1, 2004 i've got three different languages on my OSC. coolMenu doesn't want to show categories if i switch to english. who knows why? tnx!!! Quote Link to comment Share on other sites More sharing options...
hjp Posted March 1, 2004 Share Posted March 1, 2004 Thanks for your help. I have been trying to modify the code but am getting no where. You did not answer my question, whether you use osc with a centered page or a 100% page, because you seem to have mixed up the two solutions, and then it's difficult to get something to work. But let us asume that you use osc with a centered page then I would say that It NEARLY seems right but in /includes/coolmenu.php you have oCMenu.fromLeft and oCMenu.fromTop stated twice. You can't use both. You will have to comment out //oCMenu.fromLeft=70 //oCMenu.fromTop=125 furthermore you have the height calculation : $result=tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where parent_id = '0'"); mysql_num_rows($result); $height.= 50*mysql_num_rows($result)-20+mysql_num_rows($result); stated twice in /includes/coolmenu.php but also in /includes/boxes/coolmenu.php Remove that code (or comment it out) from /includes/coolmenu.php Then in /includes/boxes/coolmenu.php you have $height.= A*mysql_num_rows($result)-18; //where A is the height of your oCMenu.level[0].height Well - you can't use 'A' - as I say in my comment: A should be the height of oCMenu.level[0].height - so put in that number there One other thing: in your column_left.php do you have include(DIR_WS_BOXES . 'categories.php'); or do you have include(DIR_WS_BOXES . 'coolmenu.php'); Quote Link to comment Share on other sites More sharing options...
crisKo Posted March 1, 2004 Share Posted March 1, 2004 hello, I have several problems with mi page since I install my coolmenu about 9 days ago... before I put my coolmenu I have the search engine frindly activated, so all my pages looks like this: http://www.mydomain.net/catalog/product_in...products_id/379 The coolmenu forzed me (because is not generated to this kind of pages) to desactivate the search engine friendly and all my pages come to look like this: http://www.mydomain.net/catalog/product_in...products_id=379 Now all the search engines links to my subcategories and to my product info are broken and make a javascript error, some search engines like google are reindexing my pages and look to go beter but is very slowly and my visits and sales are about the 50% than before the coolmenu installation. At this point I can't desactivate the coolmenu and the go back with the search engine friendly use, because I am in the middle of the reindexing process. Please if anyone know something about this kind of troubles or any Idea to make a javascript to link old urls to the new ones. I'll apreciate it. Thank for your support. Quote Link to comment Share on other sites More sharing options...
msheno01 Posted March 2, 2004 Share Posted March 2, 2004 Thanks for you help. I have modified the code according to what you said. The category box is longer now but the menu is too wide and isn't dynamic to the page. When I resize the page, the menu moves out of the infobox. In includes/colum_left.php, i am using includes(coolmenu.php) Here is a screen shot Thanks for your help. Quote Link to comment Share on other sites More sharing options...
hjp Posted March 2, 2004 Share Posted March 2, 2004 then ajust the width of coolmenu to fit the box or vicaversa Quote Link to comment Share on other sites More sharing options...
msheno01 Posted March 2, 2004 Share Posted March 2, 2004 The menu is still not locked in the box. It moves outside the infobox when the explorer windows is resized. Thanks for the help. Quote Link to comment Share on other sites More sharing options...
hjp Posted March 2, 2004 Share Posted March 2, 2004 (edited) The menu is still not locked in the box. It moves outside the infobox when the explorer windows is resized. You have not yet given an answer to my question: Do you use coolmenu on a centered page or do you not? Edited March 2, 2004 by hjp Quote Link to comment Share on other sites More sharing options...
msheno01 Posted March 3, 2004 Share Posted March 3, 2004 sorry for not answering since I am the one that needs help. :blink: I am using it with it with centershop. I have in my header the following code: print ('<table width="790" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="#000000"> <tr> <td bgcolor="#FFFFFF">'); Thanks for the help. Quote Link to comment Share on other sites More sharing options...
hjp Posted March 3, 2004 Share Posted March 3, 2004 If you use a centered page then you should do it like this instead. http://www.oscommerce.com/forums/index.php?sho...ndpost&p=308916 You then have to remove the 'require(...coolmenu..)' from the php files under your catalog, because you then have it included in your footer.php. you also have to comment out height calculation, I think, in the /includes/coolmenu.php script because calculation now is in .../boxes/coolmenu.php: // $result=tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where parent_id = '0'"); //mysql_num_rows($result); //$height.= 14*mysql_num_rows($result)-14; You could start with removing the require(DIR_WS_INCLUDES . 'coolmenu.php'); from index.php for a start. and maybe you should backup the changed files first, in case you mix up anything. 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.