Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

coolMenu


Keyser Soze

Recommended Posts

Im having some trouble with the coolmenu.

http://www.fluxmind.dyns.net/~flux/catalog/

As you can see it floats above the page.

 

Hi,

a simple problem: that's what it looks like if coolmenu doesn't have a stylesheet. Checking your source code, I found you are using some template system, and are pointing to a stylesheet file that is not the default one. But I guess you forgot to add the coolmeu stlye stuff there. (actually I know you did :wink: )

 

Nils

Link to comment
Share on other sites

  • Replies 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Thanx Nils for the quick reply.

I added the coolmenu stuff to the thema stylesheet, now it seems to position correctly,

but even I have used your auto positioning code, it still doesnt position right

and there is still no categories box.

could you point me in the right direction here?

thanx

Link to comment
Share on other sites

I have used your auto positioning code, it still doesnt position right

and there is still no categories box.

Ok... something's wrong with your JS/No JS mod. If you turn off JS, you will find that the categories box will show, so the <noscript> part is working. A short look at the HTML source code of your site reveals that the javascript part is flawed. There should be document.writes in every line , but in your code, it's only in the first and last lines. So there's no hope that the category box can be drawn.

I'd either try to undo all the changes from the No-JS mod, or double check if you really followed all of Marc Zacher's instuctions with the mod, maybe reinstall it.

 

Nils

Link to comment
Share on other sites

ok ive found the problem in the JS mod

the $ output_string is empty;

$info_box_contents[] = array('text'  => '

<img src="images/trans.gif" width="150" 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;

 

that returns nothing

I went thru all the instructions in the JS NO JS mod again

and they are all done the way they were supposed to be.

even if i comment out echo $output_string; the code shows up sitll,

so my guess is its not coming from the same file, but from somewhere else.

either way though $output_string is empty.

 

im on 2.2 MS2. do i have to make any more changes ?

and could you also please post the forum for the JS no JS mod, i cant find it thru searching

thankyou

Link to comment
Share on other sites

ok ive found the problem in the JS mod

the $ output_string is empty;

$output_string .= $coolmenuinfobox->table_string;

There it is... remove the " . " to make it look like

$output_string = $coolmenuinfobox->table_string;

 

And this *is* the support thread for the NoJS mod, AFAIK.

 

Good luck,

Nils

Link to comment
Share on other sites

Here is the whole code

<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="150" 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>

 

If i use the original file ie. no mod then it works

but the JS no JS mod, as soon as i replace the original with it, it doesnt work.

[/code]

Link to comment
Share on other sites

I am running a the No JS mod on top of coolmenu 1.2. It works fine, the code you posted works fine with my shop (when undoing the . issue).

 

Your PHP, for some reason I do not know at the moment, is not performing the preg_replace actions in coolmenu.php. Perhaps you can find the reason for that yourself. Maybe you have another server (a local one) to test the whole thing there?

Link to comment
Share on other sites

this is a local server

Lol... a local server is like a WAMP or LAMP on your very own PC... the point is, just try it with a *different* server with a different OS /PHP version/combo. preg_replace can be buggy under certain circumstances.

 

and even before php does a preg_replace the $output_string is empty

No - if it were, there would not be all the required tags for the box in the Javascript area. Everything is fine with your output string, except it doesn't do the replacements and additions with preg_replace. Check your source code (the HTML source code of the generated page, not the PHP code) - it's all there.

Anyways, I guess you'll be fine on your own from here...

Link to comment
Share on other sites

Hi all,

 

I installed coolMenu twice, just to make sure i did correctly, and I?m still getting the same, incorrect, behavior. I will try my best to explain what is happening...

 

My categories are being displayed at the top of the page and pushing the rest of the HTML down. So, i get this big blank white space at the top with my menu items left justified. Then below the categories is all the HTML. Additionally when I mouse over a menu item, the subcategories display under the parents categories, not to the left of them.

 

I followed the directions to a "T", and read almost this entire thread. If someone can help me, or ask some questions that might push me in the right direction it would be appreciated.

 

I also tried changing the values for

oCMenu.fromLeft=10

oCMenu.fromTop=100

but to no avail.

 

please, please, please help me

TIA,

Elon

Link to comment
Share on other sites

My categories are being displayed at the top of the page and pushing the rest of the HTML down. So, i get this big blank white space at the top with my menu items left justified. Then below the categories is all the HTML. Additionally when I mouse over a menu item, the subcategories display under the parents categories, not to the left of them.

The reason for that usually is that coolmenu can't find the sylesheet. (As described a page or two back ;) ) You have to find out why this is the case.

 

My wild guess: maybe your shop is not using the original css file due to some theme or template thingy or something, but you copied the coolmenu styles to the original one, as instructed ->Problem. :o

 

Good luck,

Nils

Link to comment
Share on other sites

I'm not sure if anyone has asked this yet but for the record I at least browsed through most of the pages in this thread ;)

 

I'm wondering if anyone has been able to attach the sub-menus of the coolMenu to images. I know it's just a simple javascript command but I'm not the best a it. I've gone through the menu_animation.js file and have found where it uses the mouseover event to trigger the next menu but I need help on the missing pieces.

 

Here's a good chunk of the file: (sorry in advance if this is too much :( )

makeCM.prototype.makeMenu=function(name,parent,txt,lnk,targ,w,h,img1,img2,cl,cl2,align,rows,nolink,onclick,onmo
useover,onmouseout){
 var c = this; if(!name) name = c.name+""+c.mc; var p = parent!=""&&parent&&c.m[parent]?parent:0;
 if(c.mc==0){
 //Added 4.07 - bug(?) in opera 7 - you cannot dom-add layers created in one document to another one (or so it seems) - so turn of usedom
 if(bw.op7 && this.frames)	bw.usedom=0
 var tmp=location.href;
   if(tmp.indexOf('file:')>-1||tmp.charAt(1)==':') c.root=c.offlineRoot; else c.root=c.onlineRoot
   if(c.useBar){if(!c.barBorderClass) c.barBorderClass=c.barClass; c.bar1 = cm_divCreate(c.name+'bbar_0',c.barClass,'',0,1);
     c.bar = cm_divCreate(c.name+'bbar',c.barBorderClass,'',1,1,0,0,c.bar1); if(bw.usedom) c.bar.appendChild(c.bar1);    
   }}var create=1,img,arrow; var m = c.m[name] = new Object(); m.name=name; m.subs=new Array(); m.parent=p; m.arnum=0; m.arr=0
 var l = m.lev = p?c.m[p].lev+1:0; c.mc++; m.hide=0;
 if(l>=c.l.length){
   var p1,p2=0; if(l>=c.level.length) p1=c.l[c.level.length-1];
   else p1=c.level[l]; c.l[l]=new Array(); if(!p2) p2=c.l[l-1]
   if(l!=0){ if(isNaN(p1.align)) p1["align"]=cm_checkalign(p1.align)
     for(var i in p1){if(i!="str"&&i!="m"){if(p1[i]==null) c.l[l][i]=p2[i]; else c.l[l][i]=p1[i] }}
   }else{c.l[l]=c.level[0]; c.l[l].align=cm_checkalign(c.l[l].align)}
   c.l[l]["str"]=''; c.l[l].m=new Array(); if(!c.l[l].borderClass) c.l[l].borderClass=c.l[l].regClass
   c.l[l].app=0; c.l[l].max=0; c.l[l].arnum=0; c.l[l].o=new Array(); c.l[l].arr=new Array()
   c.level[l]=p1=p2=null
   if(l!=0) c.l[l].str=c.l[l].app=cm_divCreate(c.name+ '_' +l+'_0',c.l[l].borderClass,'')
 }if(p){p = c.m[p]; p.subs[p.subs.length]=name; 
   if(p.subs.length==1&&c.l[l-1].arrow){ p.arr=1; 
     if(p.parent){c.m[p.parent].arnum++
       if(c.m[p.parent].arnum>c.l[l-1].arnum){
         c.l[l-1].str+=c.l[l-1].arr[c.l[l-1].arnum]=cm_divCreate(c.name+ '_a' +(l-1)+'_'+c.l[l-1].arnum,'clCMAbs','<img height="'+c.l[l-1].arrowHeight
           +'" width="'+c.l[l-1].arrowWidth+'" src="'+c.root+c.l[l-1].arrow+'" alt="" />',0,1,c.l[l-1].app); c.l[l-1].arnum++
       }}}if(bw.reuse) if(p.subs.length>c.l[l].max) c.l[l].max = p.subs.length; else create=0
 }m.rows=rows>-1?rows:c.l[l].rows; m.w=cm_cp(w||c.l[l].width,1); m.h=cm_cp(h||c.l[l].height,0); m.txt=txt; m.lnk=lnk; 
 if(align) align=cm_checkalign(align); m.align=align||c.l[l].align; m.cl=cl=cl||c.l[l].regClass; 
 m.targ=targ; m.cl2=cl2||c.l[l].overClass; m.create=create;  m.mover=onmouseover; m.mout=onmouseout; 
 m.onclck=onclick; m.active = cm_active; m.isactive=0; m.nolink=nolink
 if(create) c.l[l].m[c.l[l].m.length]=name
 if(img1){m.img1 = new Image(); m.img1.src=c.root+img1; if(!img2) img2=img1; m.img2 = new Image(); m.img2.src=c.root+img2;
   m.cl="clCMAbs"; m.txt=''; if(!bw.reuse&&!nolink) m.txt = '<a href="#" onmouseover="'+c.name+'.showsub(\''+name+'\')" onmouseout="'+c.name+'.mout(\''+name+'\')" onclick="'+c.name+'.onclck(\''+name+'\'); return false">';;
   m.txt+='<img alt="" src="'+c.root+img1+'" width="'+m.w+'" height="'+m.h+'" id="img'+m.name+'" '
   if(bw.dom&&!nolink) m.txt+='style="cursor:pointer; cursor:hand"'; if(!bw.reuse){if(!bw.dom) m.txt+='name="img'+m.name+'"'; m.txt+=' border="0"'}; m.txt+=' />'; if(!bw.reuse&&!nolink) m.txt+='</a>'
 }else{m.img1=0; m.img2=0}; 
 if(l==0||create) c.l[l].str+=cm_getLayerStr(m,c.l[l].app,c.name,c.fillImg,c.l[l].borderClass,c.l[l].arrow,c.l[l].arrowWidth,c.l[l].arrowHeight,c.root)
 if(l==0){if(m.w>c.maxw) c.maxw=m.w; if(m.h>c.maxh) c.maxh=m.h; c.totw+=c.pxBetween+m.w+c.l[0].borderX;c.toth+=c.pxBetween+m.h+c.l[0].borderY}
 if(lnk && !onmouseover){
 var path=lnk.indexOf("mailto:")>-1||lnk.indexOf("http://")>-1?"":c.root
 m.mover="self.status='"+path+m.lnk+"'"
 if(!m.mout) m.mout=""; m.mout+=";self.status='';"
}
}

 

So I need to know what "c.name" is and just plain "name." Any javascript gurus out there?

 

Thanks

-Aaron

Link to comment
Share on other sites

HI

 

i was wondering if i can add extra button in cool menu to link to other page then the stuff in my database like: forum, contact us.

 

Someone jknow how to do this? ;)

 

Thanks a lot

Link to comment
Share on other sites

...has any one gotten the Cool menu and the enable/disable contribution working together.

 

I have cool menu working fine on the site. However, the enable/disable contribution does not work for the cool menu. Disabled categories still show up in the cool menu.

 

Any help would be appreciated!

Great contrib. works fine on my site, BUT..;-)

 

I am having the same problem.

"Disabled" Categories still come up in the menu.

 

Can't you add some check to check in the database if the cat. is disabled?

 

Regards and Thank you in advance.

 

Marius

Link to comment
Share on other sites

Hello Andreas,

 

I have tried to install your cool menu into a work in progress store and went through the whole thing twice now. Uploaded the files made all the changes and end up in the same place.

The menu system shows up above the oscommerce inage on top of the display. Any idea why and what I might be doing wrong?

 

Thank you.

Link to comment
Share on other sites

Paul,

 

as I wrote two messages above yours, Andreas, the author of coolmenu, isn't active here any more, so no use addressing him, sorry...

 

To answer your question, the problem you're describing has been addressed several times in this thread, the last time just one page back - try that first.

 

Nils

Link to comment
Share on other sites

This post should solve a few issues... some have already been resolved in earlier post, though some people are not willing to do the 'hard yards'and read through 38 pages. I personally would recommend reading through them so you learn a lot more about the way the menu works... but here's some tips anyway.

 

If your menu is hovering over the rest of your page, this is probably due the 'require(DIR_WS_INCLUDES . 'coolmenu.php');' code being called after the category box.

 

This next tip will solve the first problem, and also the issue of the menu appearing on the page in mid-air before the rest of the page is loaded. This will ensure that the menu loads in sync with the categories box.

 

In catalog\includes\boxes\coolmenu.php find this at the top of the file:

<?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 // -->

and add the following after it as per below:

<?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 // -->
<?php
/* CoolMenu - BOF */
require(DIR_WS_INCLUDES . 'coolmenu.php');
/* CoolMenu - EOF */
?>

 

Now you can remove all copies of the following from the body tags of your other files:

<!-- coolMenu //-->
<?php require(DIR_WS_INCLUDES . 'coolmenu.php'); ?>
<!-- coolMenu_eof //-->

This also works well if you have several other files, like links pages, FAQ pages, etc. since the code gets called with the menu... if you don't call the menu, then the code isn't parsed for no reason. :rolleyes:

 

Also, in catalog\includes\application_top.php add the following to the end of the file before the final '?>':

/* Cool Menu - BOF */
?>
<script LANGUAGE="JavaScript1.2" SRC="includes/menu_animation.js"></SCRIPT>
<?php }
/* Cool Menu - BOF */

By doing this, you can also remove the other instances of it from the <head> tags of all your files. :D

 

Hope this helps... let me know if you come across any problems with these tips.

 

Cheers,

Tony

"The price of success is perseverance. The price of failure comes much cheaper."

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...