Guest Posted April 6, 2005 Share Posted April 6, 2005 Thats the way it works, Its a javascript menu created on the fly and placed on layers. This then hovers over the current page. You use the "oCMenu.fromTop" and "oCMenu.fromLeft" variables to set where the top left hand co-ordinates start. In addition you use the height variable to set the height of the new empty box created by the coolmenu.php file in the includes\boxes folder. Never used STS, so there may be some slight differences. Just make sure you back your files up first before making any amendments. It can be a right pain to get the menu into the correct position however, once done it needs very little maintenance. Mark <{POST_SNAPBACK}> Ah I got you now Mark cheers, Should have that explained in the instructions. :thumbsup: Right I have the top, left and width lined up with the categories box, the only problem now is the height. In coolmenu in boxes it has the following code: $info_box_contents[] = array('text' => ' <img src="images/trans.gif" width="126" height="' . $height . '">'); What and where defines the string for height? I've also noticed that although the text is wrapped to a new line if it's too long, if it just goes near the right edge the bullets cover up the last letter of each line :( anyone know of a way round this? even if its just having the bullets behind the text. Quote Link to comment Share on other sites More sharing options...
Guest Posted April 6, 2005 Share Posted April 6, 2005 Ah I got you now Mark cheers, Should have that explained in the instructions. :thumbsup: Right I have the top, left and width lined up with the categories box, the only problem now is the height. In coolmenu in boxes it has the following code: ?$info_box_contents[] = array('text' ?=> ' <img src="images/trans.gif" width="126" height="' . $height . '">'); What and where defines the string for height? I've also noticed that although the text is wrapped to a new line if it's too long, if it just goes near the right edge the bullets cover up the last letter of each line :( anyone know of a way round this? even if its just having the bullets behind the text. <{POST_SNAPBACK}> The $height variable, yes that is a good question. In the original installation it is in the \includes\coolmenu.php file. However, in many occasions this include file is not loaded prior to the box and therefore is a total waste of time. I made my own version and stuck it in the includes\boxes\coolmenu.php file. If you wish to use this, you are quite welcome. Open the includes\boxes\coolmenu.php file at at the top just after the <?php start copy the following: // get height of menu $height_query = tep_db_query("select count(*) as count from " . TABLE_CATEGORIES . " where parent_id = '0'"); $heightarray = tep_db_fetch_array($height_query); $height =($heightarray['count'] * 21); the *21 depends on the height you have set for your menu items in "includes\coolmenu.php" Mine is set to 20 oCMenu.level[0].height=20 Hope this helps. Mark Quote Link to comment Share on other sites More sharing options...
Guest Posted April 6, 2005 Share Posted April 6, 2005 (edited) The $height variable, yes that is a good question. In the original installation it is in the \includes\coolmenu.php file. However, in many occasions this include file is not loaded prior to the box and therefore is a total waste of time. I made my own version and stuck it in the includes\boxes\coolmenu.php file. If you wish to use this, you are quite welcome. Open the includes\boxes\coolmenu.php file at at the top just after the <?php start copy the following: // get height of menu $height_query = tep_db_query("select count(*) as count from " . TABLE_CATEGORIES . " where parent_id = '0'"); $heightarray = tep_db_fetch_array($height_query); $height =($heightarray['count'] * 21); the *21 depends on the height you have set for your menu items in "includes\coolmenu.php" Mine is set to 20 oCMenu.level[0].height=20 Hope this helps. Mark <{POST_SNAPBACK}> Nope didn't work :( but then again, I've noticed that the category box behind my coolmenu only has >> displayed in it which links to my first category. maybe that has a problem. Also get the following error when viewed in Firebird although no error in IE // get height of menu $height_query = tep_db_query("select count(*) as count from " . TABLE_CATEGORIES . " where parent_id = '0'"); $heightarray = tep_db_fetch_array($height_query); $height =($heightarray['count'] * 28); Categories Fixed the bullet issue by making it transparent with the arrow slightly smaller and lower. Take a look at my site Ideal Health & Safety Products Edited April 6, 2005 by Rochdalemark Quote Link to comment Share on other sites More sharing options...
Guest Posted April 6, 2005 Share Posted April 6, 2005 Nope didn't work :( but then again, I've noticed that the category box behind my coolmenu only has >> displayed in it which links to my first category. maybe that has a problem. Also get the following error when viewed in Firebird although no error in IE // get height of menu $height_query = tep_db_query("select count(*) as count from " . TABLE_CATEGORIES . " where parent_id = '0'"); $heightarray = tep_db_fetch_array($height_query); $height =($heightarray['count'] * 28); Categories Fixed the bullet issue by making it transparent with the arrow slightly smaller and lower. There is a problem with the categories box behind the menu, there should be nothing in there other than an image 1 pixel wide and ($height * 28 high). Check the code in the includes\boxes\coolmenu.php file. Also check includes\column_left.php to make sure you are calling coolmenu.php and not categories.php other than that I'm afraid without seeing the actual source code, can't advise much further. As far as Firebird is concerned, I've never used the package but I would imagine the problem is with the javascript not being compatible with the browser. The menu works fine in netscape (although a little out of line) and is fine in IE. Don't have other browsers installed to check it with. Mark Quote Link to comment Share on other sites More sharing options...
Guest Posted April 6, 2005 Share Posted April 6, 2005 Check the code in the includes\boxes\coolmenu.php file. Also check includes\column_left.php to make sure you are calling coolmenu.php and not categories.php other than that I'm afraid without seeing the actual source code, can't advise much further. Mark <{POST_SNAPBACK}> Code in the top of my column_left.php is as follows: // STS: ADD $sts_block_name = 'header2columnleft'; require(STS_RESTART_CAPTURE); // STS: EOADD if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include(DIR_WS_BOXES . 'coolmenu.php'); } require(DIR_WS_BOXES . 'whats_new.php'); // STS: ADD $sts_block_name = 'whatsnewbox'; require(STS_RESTART_CAPTURE); // STS: EOADD Code in my boxes/coolmenu.php is currently: <?php /* ------------------------------------------------ coolMenu for osCommerce author: Andreas Kothe url: http://www.oddbyte.de copyright: 2003 Andreas Kothe modified: 2003-07-28 Marc Zacher extended to work for javascript enanbled and disabled with javascript disabled, the conventional categories box is shown this extension is provided by Marc Zacher The copyright notice of Andreas Kothe in the html output has been removed and put in this header since it would cause problems in javascript context. Released under the GNU General Public License ------------------------------------------------ */ ?> <script type="text/javascript"> <!-- document.write(" <TR> <TD> "); <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_CATEGORIES ); $coolmenuinfoboxheading = new infoBoxHeading($info_box_contents, true, false, false, false); $output_string = $coolmenuinfoboxheading->table_string; $info_box_contents = array(); if (MAX_MANUFACTURERS_LIST < 2) { $cat_choose = array(array('id' => '', 'text' => BOX_CATEGORIES_CHOOSE)); } else { $cat_choose = ''; } $info_box_contents[] = array('text' => ' <img src="images/trans.gif" width="126" height="' . $height . '">'); $coolmenuinfobox = new infoBox($info_box_contents, false); $output_string .= $coolmenuinfobox->table_string; //remove all html commments $output_string = preg_replace("/<!--.*?-->/", "", $output_string); //escape all occurences of " $output_string = preg_replace('/"/', '\"', $output_string); //escape all occurences of / $output_string = preg_replace('/\//', '\/', $output_string); //remove trailing \n $output_string = preg_replace('/\\n+$/', '', $output_string); //replace all \n with ");\ndocument.write(" $output_string = preg_replace('/\\n/', "\");\ndocument.write(\"", $output_string); //prepend document.write at the beginning and append ");\n $output_string = "document.write(\"" . $output_string . "\");\n"; echo $output_string; ?> document.write(" <\/TD> <\/TR> "); //--> </script> <noscript> <?php include(DIR_WS_BOXES . 'categories.php'); ?> </noscript> Maybe I should try an earlier version of the menu or a dhtml one Quote Link to comment Share on other sites More sharing options...
Guest Posted April 6, 2005 Share Posted April 6, 2005 Sorry I'd posted the wrong version of column_left the following is the correct one: // STS: ADD $sts_block_name = 'header2columnleft'; require(STS_RESTART_CAPTURE); // STS: EOADD if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include(DIR_WS_BOXES . 'coolmenu.php'); } // STS: ADD $sts_block_name = 'categorybox'; require(STS_RESTART_CAPTURE); // STS: EOADD Quote Link to comment Share on other sites More sharing options...
Guest Posted April 6, 2005 Share Posted April 6, 2005 Sorry I'd posted the wrong version of column_leftthe following is the correct one: ?// STS: ADD ?$sts_block_name = 'header2columnleft'; ?require(STS_RESTART_CAPTURE); ?// STS: EOADD ?if ((USE_CACHE == 'true') && empty($SID)) { ? ?echo tep_cache_categories_box(); ?} else { ? ?include(DIR_WS_BOXES . 'coolmenu.php'); ?} ?// STS: ADD ?$sts_block_name = 'categorybox'; ?require(STS_RESTART_CAPTURE); ?// STS: EOADD <{POST_SNAPBACK}> OK column_left looks totally different to what I'm used to, as I said, I've never seen STS before (nor do I want to actually) but all in all, it looks to be ok. Your includes\boxes\coolmenu.php is the version that writes everything using javascript which I had problems with myself. I decided that most of my users would have javascript enabled and therefore used a simple infobox to create the outer box. Sorry, But I think its come to the point where I have helped as much as possible cause I don't know the differences between the normal php osc and STS. Hopefully, other users out there may be able to point you in the right direction for STS. Mark Quote Link to comment Share on other sites More sharing options...
Guest Posted April 6, 2005 Share Posted April 6, 2005 OK column_left looks totally different to what I'm used to, as I said, I've never seen STS before (nor do I want to actually) but all in all, it looks to be ok. Your includes\boxes\coolmenu.php is the version that writes everything using javascript which I had problems with myself. I decided that most of my users would have javascript enabled and therefore used a simple infobox to create the outer box. Sorry, But I think its come to the point where I have helped as much as possible cause I don't know the differences between the normal php osc and STS. Hopefully, other users out there may be able to point you in the right direction for STS. Mark <{POST_SNAPBACK}> Thanks for all your help Mark.. :thumbsup: Well for anyone who's following this I copied the origional categories.php into my boxes folder, what seems to happen is that both the cool menu loads and also my normal categories menu loads. one on top of the other. Not sure why that would be. Tried going back to an older version but still the same problem, thought it might be that I'm using ultimate urls by chemo and that my caches were causing a problem so i reset my caches, Nope that didn't fix it. All I can think of is that it's something to do with STS. Anyone who has this menu installed with STS please let me know how you managed it because I'm baffled :blink: Quote Link to comment Share on other sites More sharing options...
mafro Posted April 7, 2005 Share Posted April 7, 2005 Thanks for all your help Mark.. :thumbsup: Well for anyone who's following this I copied the origional categories.php into my boxes folder, what seems to happen is that both the cool menu loads and also my normal categories menu loads. one on top of the other. Not sure why that would be. Tried going back to an older version but still the same problem, thought it might be that I'm using ultimate urls by chemo and that my caches were causing a problem so i reset my caches, Nope that didn't fix it. All I can think of is that it's something to do with STS. Anyone who has this menu installed with STS please let me know how you managed it because I'm baffled :blink: <{POST_SNAPBACK}> Ok, to everyone that wants Coolmenu with STS ive done the mod, i just need to release a contribution with it all in there.. :thumbsup: I would explain it all but theres changes to be made to STS to accomodate the new menu box so its easier to put it in a contrib. Ill post again when the thing is released. mafro Quote Link to comment Share on other sites More sharing options...
Guest Posted April 7, 2005 Share Posted April 7, 2005 Ok, to everyone that wants Coolmenu with STS ive done the mod, i just need to release a contribution with it all in there.. :thumbsup: I would explain it all but theres changes to be made to STS to accomodate the new menu box so its easier to put it in a contrib. Ill post again when the thing is released. mafro <{POST_SNAPBACK}> WHOOHOO (w00t) Nice one mafro :thumbsup: Quote Link to comment Share on other sites More sharing options...
zero19 Posted April 14, 2005 Share Posted April 14, 2005 i need help with coolmenu i have a small problem which you can see on my site: anani.ca/estore the menu goes out of the box is there a way to fix this thank in advance Quote Link to comment Share on other sites More sharing options...
Guest Posted April 15, 2005 Share Posted April 15, 2005 (edited) i need help with coolmenu i have a small problem which you can see on my site:anani.ca/estore the menu goes out of the box is there a way to fix this thank in advance <{POST_SNAPBACK}> There looks nothing wrong with your menu, apart from it not fitting the box correctly. Either reduce the box size or edit your coolmenu.php file and edit the menu size to fit the box more snug when no sub category is open. The menu is supposed to open out to the right for each sub category level, yes outside the box :) Edited April 15, 2005 by Rochdalemark Quote Link to comment Share on other sites More sharing options...
php4ever Posted April 15, 2005 Share Posted April 15, 2005 here is one I've never seen before; http://www.compudar.com The CoolMenu when an item is selected displays an error and a series of "n" letters depending on the item. Any thoughts or ideas. Jared Quote www.jaredritchey.com Link to comment Share on other sites More sharing options...
Guest Posted April 15, 2005 Share Posted April 15, 2005 here is one I've never seen before; http://www.compudar.com The CoolMenu when an item is selected displays an error and a series of "n" letters depending on the item. Any thoughts or ideas. Jared <{POST_SNAPBACK}> The problem appears to be with the source code of your product_info.php file and not the menu. Mark Quote Link to comment Share on other sites More sharing options...
php4ever Posted April 15, 2005 Share Posted April 15, 2005 The problem appears to be with the source code of your product_info.php file and not the menu. Mark <{POST_SNAPBACK}> Thanks Mark; Would that explain Warning: main(includes/modules/FILENAME_FEATURED): failed to open stream: No such file or directory in /home/compudar/public_html/index.php on line 125 Warning: main(includes/modules/FILENAME_FEATURED): failed to open stream: No such file or directory in /home/compudar/public_html/index.php on line 125 Warning: main(): Failed opening 'includes/modules/FILENAME_FEATURED' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/compudar/public_html/index.php on line 125 Because it just does not like to function as expected. Jared Quote www.jaredritchey.com Link to comment Share on other sites More sharing options...
Guest Posted April 16, 2005 Share Posted April 16, 2005 Hello all.. I have a small problem with cool menu... as you see in my website aquariums/catalog the menu bar is not fit to the box... I am really wondering if i am doing anything wrong ?? Should the box tretch by itself to fit the cool menu ?? Or I must resize the box hieght to fit the cool menu ?? I am trying to find how to resize the hieght of both cool menu and box...but I am not success..I cannot find it... Can anyone guide me to fix on that problem ?? Also Is it possible to show the number or prodcut that i have in each categories in the cool menu ?? Thank you so much.. Sunpetch Panasjaroen Quote Link to comment Share on other sites More sharing options...
Guest Posted April 16, 2005 Share Posted April 16, 2005 Hello all.. I have a small problem with cool menu... as you see in my website aquariums/catalog the menu bar is not fit to the box... I am really wondering if i am doing anything wrong ?? Should the box tretch by itself to fit the cool menu ?? Or I must resize the box hieght to fit the cool menu ?? I am trying to find how to resize the hieght of both cool menu and box...but I am not success..I cannot find it... Can anyone guide me to fix on that problem ?? Also Is it possible to show the number or prodcut that i have in each categories in the cool menu ?? Thank you so much.. Sunpetch Panasjaroen Quote Link to comment Share on other sites More sharing options...
Gibbo Posted April 23, 2005 Share Posted April 23, 2005 There looks nothing wrong with your menu, apart from it not fitting the box correctly. Either reduce the box size or edit your coolmenu.php file and edit the menu size to fit the box more snug when no sub category is open. The menu is supposed to open out to the right for each sub category level, yes outside the box :) <{POST_SNAPBACK}> :'( I seem to have missed something, can you give me an indication on how to resize the box? Under the original Category box, it resized itself automatically. Thanks in advance. :thumbsup: Quote Link to comment Share on other sites More sharing options...
Guest Posted April 23, 2005 Share Posted April 23, 2005 :'( I seem to have missed something, can you give me an indication on how to resize the box? Under the original Category box, it resized itself automatically. Thanks in advance. :thumbsup: <{POST_SNAPBACK}> I'm assuming that you're referring to http://anani.ca/estore as that's the post referred to, if not let me know what the site is so I can take a look. If that's the site or the same problem you're having, do the following to resize the box.. First decide how wide you want it to be. We'll use my store as an example. I've resized it to 120 wide. You can just change the value to whatever you want for your own use. Find in "/includes/coolmenu.php": oCMenu.level[0].width=150 And change to: oCMenu.level[0].width=120 Find in "/includes/boxes/coolmenu.php": <img src="images/trans.gif" width="150" height="' . $height . '">'); And change to: <img src="images/trans.gif" width="120" height="' . $height . '">'); That will take care of the width issue. To fix the height you'll haev to play with the value to get it just right. But do the following, playing with the number until you find what suits it best. Find in "/includes/coolmenu.php": $height.= 2.65*count($categories); And change to: $height.= 3.33*count($categories); You may also want to move your menu slightly to the left/tight and/or up/down. I moved mine to the right one pixel. To do that, look for the following in "/includes/coolmenu.php" and edit as needed: oCMenu.fromLeft=10 oCMenu.fromTop=100 ~James Quote Link to comment Share on other sites More sharing options...
Gibbo Posted April 27, 2005 Share Posted April 27, 2005 Thanks for that, I has helped me understand a bit more of it, but has not solved the problem I am stuck on :( . Have a look at www.globalcoffee.co.nz, it is a dummy site I have put up to assist in getting a site to the way I wish it to be. Anyway, The Category Box on the left is in the right place, but is not tall enough to hold the CoolMenu menus. How do I make the Box expand to match the menu? Cheers Quote Link to comment Share on other sites More sharing options...
Guest Posted April 27, 2005 Share Posted April 27, 2005 Thanks for that, I has helped me understand a bit more of it, but has not solved the problem I am stuck on :( . Have a look at www.globalcoffee.co.nz, it is a dummy site I have put up to assist in getting a site to the way I wish it to be. Anyway, The Category Box on the left is in the right place, but is not tall enough to hold the CoolMenu menus. How do I make the Box expand to match the menu? Cheers <{POST_SNAPBACK}> Adjust the height in "/includes/coolmenu.php" as I'd described in my last post and you can make the category box taller or shorter. Just play with the value to get it the size you want. ~James Quote Link to comment Share on other sites More sharing options...
Guest Posted April 27, 2005 Share Posted April 27, 2005 Hi Everyone, for a change I'm asking for help off anyone who has been making large amendments to the coolmenu contribution. Has anyone managed to get the menu to fit in an absolute position instead of the usual from top from left etc. Usually, this is not a problem however, have a look at what happens when you print the screen. (or look at a page in the google cache). I've a client, who is not very happy with this, so its back to the drawing board. I could use a different menu, but the thought of all that programming on top of my current workload is not too good. Any help people would be appreciated. Mark :blush: Quote Link to comment Share on other sites More sharing options...
Guest Posted April 27, 2005 Share Posted April 27, 2005 (edited) Hi peeeps Can somone point me to the thread that will show me how to resize the coolmenu boxes? :thumbsup: Im sure its simple just can not see it :'( TIA _____________ www.cs-o.co.uk Edited April 27, 2005 by cs-o Quote Link to comment Share on other sites More sharing options...
Guest Posted April 27, 2005 Share Posted April 27, 2005 (edited) Sorry.. I missed the top of this page. LOL :rolleyes: _____________ www.cs-o.co.uk Edited April 27, 2005 by cs-o Quote Link to comment Share on other sites More sharing options...
Guest Posted April 28, 2005 Share Posted April 28, 2005 I have removed my STS Template system due to it slowing my site down considerably, I have now installed the standard version of coolmenu rather than the sts version. Why is it that when I replace just the one line in colum_left: ie include(DIR_WS_BOXES . 'categories.php'); BY: include(DIR_WS_BOXES . 'coolmenu.php'); So it ends up like if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include(DIR_WS_BOXES . 'coolmenu.php'); } I get the coolmenu displayed, but behind it is the standard category menu, so that when i go into a subcategory you can see the old style menu sticking out from below the coolmenu. If I remove the whole of the category code from colum_left and just use include(DIR_WS_BOXES . 'coolmenu.php'); It displays the coolmenu and there isn't the old style menu behind it, but my coolmenu box stretches halfway down my page, with the actual coolmenu only taking up a very small part of that. I've not changed the standard settings of the contribution apart from the width of the boxes. As far as I can tell the coolmenu box is supposed to increase in size by a certain amount dependant on the number of categories. Shouldn't this work on the std settings unless you change the level heights for the menu?? or am I missing something here?? :blink: 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.