Guest Posted February 14, 2004 Share Posted February 14, 2004 Thanks for the quick responce. I have installed the contribution apart from inserting the 3 lines of code in every page. I then updated the install using the above instructions. At the moment i have turned the coolmenu off because im working on the shop. If I posted any of the files would that help. Once again Thanks. colin Quote Link to comment Share on other sites More sharing options...
hjp Posted February 14, 2004 Share Posted February 14, 2004 then post 1: /catalog/includes/coolmenu.php 2: /catalog/includes/footer.php 3: /catalog/includes/boxes/coolmenu.php Quote Link to comment Share on other sites More sharing options...
Guest Posted February 14, 2004 Share Posted February 14, 2004 Ok cheers for the help. 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','4'); if (MAX_MANUFACTURERS_LIST < 2) { $cat_choose = array(array('id' => '', 'text' => BOX_CATEGORIES_CHOOSE)); } else { $cat_choose = ''; } ?> <!-- Copyright 2002 www.dhtmlcentral.com modified for 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=10 oCMenu.fromTop=100 oCMenu.rows=0 oCMenu.menuPlacement="left" oCMenu.offlineRoot="" oCMenu.onlineRoot="" oCMenu.resizeCheck=1 oCMenu.wait=500 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=150 oCMenu.level[0].height=28 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=1.2)" <?php for ($i=1; $i<SUB_CATEGORIES; $i++) { echo' oCMenu.level[' . $i . ']=new cm_makeLevel() oCMenu.level[' . $i . '].width=250 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=1.2)" '; } // 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) { $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>"; } } echo "','" . tep_href_link(FILENAME_DEFAULT) . "&cPath=" . $categories['id'] . "')\n"; } // --- $categories = tep_get_categories($cat_choose); $height.= 2.65*count($categories); $depth=0; $blank_length; $depth_size; for($i=1; $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]++; } // remove blanks $categories[$i]['text'] = substr($categories[$i]['text'], 12*$blank_length); print_menu_line($categories[$i], $depth_size, $depth); } ?> // create menu oCMenu.construct() <!-- Copyright 2002 www.dhtmlcentral.com modified for osCommerce by Andreas Kothe - www.oddbyte.de --> </SCRIPT> footer.php <?php/* $Id: footer.php,v 1.1 2003/09/08 19:26:06 jhtalk Exp jhtalk $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ // STS: ADD // Get the output between column_right.php and footer.php $sts_block_name = 'columnright2footer'; require(STS_RESTART_CAPTURE); // STS: EOADD require(DIR_WS_INCLUDES . 'counter.php'); // STS: ADD $sts_block_name = 'counter'; require(STS_RESTART_CAPTURE); // STS: EOADD ?> <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"> <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?> </td> </tr> </table> <br> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="center" class="smallText"> <?php /* The following copyright announcement can only be appropriately modified or removed if the layout of the site theme has been modified to distinguish itself from the default osCommerce-copyrighted theme. For more information please read the following Frequently Asked Questions entry on the osCommerce support site: http://www.oscommerce.com/community.php/faq,26/q,50 Please leave this comment intact together with the following copyright announcement. */ echo FOOTER_TEXT_BODY ?> </td> </tr> </table> <?php // STS: ADD $sts_block_name = 'footer'; require(STS_RESTART_CAPTURE); // STS: EOADD if ($banner = tep_banner_exists('dynamic', '468x50')) { ?> <br> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="center"><?php echo tep_display_banner('static', $banner); ?></td> </tr> </table> <?php // STS: ADD $sts_block_name = 'banner'; require(STS_RESTART_CAPTURE); // STS: EOADD } <!-- coolMenu //--><?php require(DIR_WS_INCLUDES . 'coolmenu.php'); ?><!-- coolMenu_eof //--> ?> boxs/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)-A; //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 //--> Hope this shines some light on my errors. Keep smiling Colin Quote Link to comment Share on other sites More sharing options...
focusinnovations Posted February 14, 2004 Share Posted February 14, 2004 Hello, After installing coolmenu and the addon, I am getting a syntax error on line 220. Site=Mysite Anyone got a sec to help me? I tried looking thru the jscript but I can find the problem. Let me know if you need to see any of the code. Thanks in advance Quote Link to comment Share on other sites More sharing options...
focusinnovations Posted February 14, 2004 Share Posted February 14, 2004 I took off the addon for peeps with jscript disabled. I'll try installing the add-on later. Quote Link to comment Share on other sites More sharing options...
hjp Posted February 15, 2004 Share Posted February 15, 2004 $height.= A*mysql_num_rows($result)-A; //where A is the height of your oCMenu.level[0].height I can see that you have not changed 'A' all though I wrote that: A is the height of your oCMenu.level[0].height This meens that you have to find what number you have set in oCMenu.level[0].height and write that in stead of A. After that if you still have problems, I would like to see a link with coolmenu working. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 15, 2004 Share Posted February 15, 2004 Hi. where do I find this. oCMenu.level[0].height Cheers and no laughing. Colin Scotland Quote Link to comment Share on other sites More sharing options...
hjp Posted February 15, 2004 Share Posted February 15, 2004 in ..../includes/coolmenu.php the first file that you posted. You have set the size of your coolmenu menu to '28 px' - that is a big one. Everything you set there - also width is reflected on the coolmenu menu. Experiment with the numbers and you'l see. So if your height is 28 replace the 'A' with 28. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 15, 2004 Share Posted February 15, 2004 (edited) Hello again. Ive tried to reset the height value but I only get an empty box as a menu. It does say CoolMenu at the top but the box is empty. Im doing something stupid and I cant work it out. Speak soon Colin Scotland Site Edited February 15, 2004 by segdoune Quote Link to comment Share on other sites More sharing options...
hjp Posted February 15, 2004 Share Posted February 15, 2004 Where is your 'menu_animation.js' ?? That is the whole basis for the coolmenu to work. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 15, 2004 Share Posted February 15, 2004 its in the /includes folder Colin Quote Link to comment Share on other sites More sharing options...
hjp Posted February 15, 2004 Share Posted February 15, 2004 Yes - but you have to include it in your index.php. Else the menu won't show. In fact you have to place it in every php file that has a <head> tag under the root directory (in your case 'catalog') Like this <head><script LANGUAGE="JavaScript1.2" SRC="includes/menu_animation.js"></SCRIPT> Quote Link to comment Share on other sites More sharing options...
Guest Posted February 15, 2004 Share Posted February 15, 2004 Noop, Tried everything. Went over the install instrructions again. Included all the lines that i needed to. Still only a blank box. Im using simple template system could that be the problem. Cheers for all the help colin Scotland Quote Link to comment Share on other sites More sharing options...
hjp Posted February 15, 2004 Share Posted February 15, 2004 (edited) You're jumping a bit around when you're making the changes. You have to stick with my solution if you want to lock to a box. You have placed <?php require(DIR_WS_INCLUDES . 'coolmenu.php'); ?> between the <body> tag and the inclusion of header.php Don't do that. REMOVE IT FROM THERE and place it at the very bottom of your footer.php Then it should work Edited February 15, 2004 by hjp Quote Link to comment Share on other sites More sharing options...
Guest Posted February 16, 2004 Share Posted February 16, 2004 Hello again. Ive got myself totally lost so ive done a full re install of the shop. I will get this contrib working then do all the other stuff. What is the best method to get the menu up and running. Should i follow this thread or would an install of 1.2 do the trick. All help will be greatly apreaciated. Cheers for the help so far. Keep smiling Colin Quote Link to comment Share on other sites More sharing options...
Logovaz Posted February 16, 2004 Share Posted February 16, 2004 segdoune: make sure your product categories or sub-categories don't include any apostrophes ( ? ) if they do then you will have a problem. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 16, 2004 Share Posted February 16, 2004 Cheers all peeps for helping. Got the menu up and running, got lots of stuff to do to make it nice but at least its working. Thanks to All for the help. The Web wouldnt be the Web if you guys didnt help people like myself. Cheers and Keep smiling. Colin Scotland Quote Link to comment Share on other sites More sharing options...
cj2003 Posted February 16, 2004 Share Posted February 16, 2004 segdoune -> what did you do to make it work?? I have the similar problem and also seem to be struck like you were? Christian Quote Link to comment Share on other sites More sharing options...
hjp Posted February 17, 2004 Share Posted February 17, 2004 Cheers all peeps for helping.Got the menu up and running, got lots of stuff to do to make it nice but at least its working. Thanks to All for the help. The Web wouldnt be the Web if you guys didnt help people like myself. Cheers and Keep smiling. Colin Scotland Hello Colin, I think I finally have found out what you want. I can see from your site, that you don't need a centered page, but perhaps only want the coolmenu to fit in the coolmenu (category) box, so that the box expands or shrinks when you add og remove categories. I can also see, that the boxes in the left side ar bigger than in the right side. That does not look so good, I think. But this may also be easily fixed. So let's try to make amendmends to your site as it is now. We only have to change something in 2 files: 1: /catalog/includes/boxes/coolmenu.php 2: /catalog/includes/coolmenu.php First: Copy the 2 files so that you have a backup to put back in place if you regret or make typoes. Now let us change 1: /catalog/includes/boxes/coolmenu.php so that left and right boxes are of the same width. (If you don't want that, then don't do it) In that file find: <img src="images/trans.gif" width="150" height="' . $height . '">'); and replace with: <img src="images/trans.gif" width="'. BOX_WIDTH .'" height="' . $height . '">'); BOX_WIDTH sets the width of the boxes and can be found and changed in: /catalog/includes/application_top.php Next let us change 2: /catalog/includes/coolmenu.php to exactly fit coolmenu to your current page. Find oCMenu.fromLeft and oCMenu.fromTop and change the numbers to: oCMenu.fromLeft=8 oCMenu.fromTop=72 I think that fits your page. Then in the same file find: $height.=2.65*count($categories); and replace with: $result=tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where parent_id = '0'"); mysql_num_rows($result); $height.= 20*mysql_num_rows($result)-20+mysql_num_rows($result); The number 20 is the height of your coolmenu bars. It is set to 20 in your file in oCMenu.level[0].height=20 Next find oCMenu.level[0].width and set to oCMenu.level[0].width=156 Maybe you should set oCMenu.level[' . $i . '].width to the same number (156) so that they are of equal width. The latter is the width of the submenues. Try that and let me know if that has helped. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 17, 2004 Share Posted February 17, 2004 Hi. Once again thanks for the help. I followed your instructions and it seems to look ok. Infact it looks great. Ill back up everything before i start mucking about with the next contrib. STS. Keep smiling Colin Scotland Quote Link to comment Share on other sites More sharing options...
crisKo Posted February 19, 2004 Share Posted February 19, 2004 Hi all and thankyou in advance... I've installed the coolmenu and the default.php page works fine, but when I click on a subcategory make a bug that shows: "makeCM not defined" What am I do wrong??? Any Idea......? Yours :unsure: Quote Link to comment Share on other sites More sharing options...
crisKo Posted February 20, 2004 Share Posted February 20, 2004 Ok the solution was here http://www.oscommerce.com/forums/index.php?sho...60entry127562 But.... I want to use Search Engine Friendly URL's , How can I change the coolmenu to a search friendly? (I ask myself).... jaja :D Quote Link to comment Share on other sites More sharing options...
msheno01 Posted February 23, 2004 Share Posted February 23, 2004 I am having a problem fitting coolmenu to the categories box and making it dynamic to the size of the window. I have tried making the adjustments to the 3 files but still no luck. The menu won't fit into the categories box and it is not dynamic. I could post the files if that will help. Thanks Quote Link to comment Share on other sites More sharing options...
hjp Posted February 23, 2004 Share Posted February 23, 2004 can you post a link? Quote Link to comment Share on other sites More sharing options...
romalong 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!!! 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.