Jump to content
Sign in to follow this  
Keyser Soze

coolMenu

Recommended Posts

i installed cool menu it works but in Mozilla Firefox 1.0.4 it shows up nice but in the bottom fo the page i have a error as follows

 //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 //Menu properties oCMenu.pxBetween=0 oCMenu.fromLeft=8 oCMenu.onresize="location.reload()" oCMenu.fromTop=152 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=155 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=0.8)" oCMenu.level[1]=new cm_makeLevel() oCMenu.level[1].width=155 oCMenu.level[1].height=14 oCMenu.level[1].regClass="clLevel1" oCMenu.level[1].overClass="clLevel1over" oCMenu.level[1].borderX=1 oCMenu.level[1].borderY=1 oCMenu.level[1].align="right" oCMenu.level[1].offsetX=0 oCMenu.level[1].offsetY=0 oCMenu.level[1].borderClass="clLevel1border" oCMenu.level[1].align="right" oCMenu.level[1].filter="progid:DXImageTransform.Microsoft.Fade(duration=0.6)" oCMenu.level[2]=new cm_makeLevel() oCMenu.level[2].width=155 oCMenu.level[2].height=14 oCMenu.level[2].regClass="clLevel1" oCMenu.level[2].overClass="clLevel1over" oCMenu.level[2].borderX=1 oCMenu.level[2].borderY=1 oCMenu.level[2].align="right" oCMenu.level[2].offsetX=0 oCMenu.level[2].offsetY=0 oCMenu.level[2].borderClass="clLevel1border" oCMenu.level[2].align="right" oCMenu.level[2].filter="progid:DXImageTransform.Microsoft.Fade(duration=0.6)" oCMenu.level[3]=new cm_makeLevel() oCMenu.level[3].width=155 oCMenu.level[3].height=14 oCMenu.level[3].regClass="clLevel1" oCMenu.level[3].overClass="clLevel1over" oCMenu.level[3].borderX=1 oCMenu.level[3].borderY=1 oCMenu.level[3].align="right" oCMenu.level[3].offsetX=0 oCMenu.level[3].offsetY=0 oCMenu.level[3].borderClass="clLevel1border" oCMenu.level[3].align="right" oCMenu.level[3].filter="progid:DXImageTransform.Microsoft.Fade(duration=0.6)"
Fatal error: Cannot redeclare blank_length() (previously declared in /home/amedical/public_html/osCommerce/catalog/includes/coolmenu.php:134) in /home/amedical/public_html/osCommerce/catalog/includes/coolmenu.php on line 134

thank you

Share this post


Link to post
Share on other sites

Hi all,

 

 

 

I am rather new to scripting in PHP and know nothing about java. I have installed COOL MENU, but all i am getting is a blank box? Java is not disabled in my browser and I did install the no js fix. I have disabled cool menu for now but here is the top part of my product_info.php code mabe i have done something wrong. can any please help. if i can get one page to work i can get them all to work. I have only commented out the call to coolmenu.php in column_left.php, so all the code is there if you want to check it out.

Young's Gifts

Thanks

Adam

 

 

<?php
/*
 $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $
 adapted for Separate Pricing Per Customer v4 2005/03/06

 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');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
$product_auction_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
 $auction_product_check = tep_db_fetch_array($product_auction_query);

 $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $product_check = tep_db_fetch_array($product_check_query);
 
    // BOF Separate Price per Customer
    if(!tep_session_is_registered('sppc_customer_group_id')) { 
    $customer_group_id = '0';
    } else {
     $customer_group_id = $sppc_customer_group_id;
    }
  // EOF Separate Price per Customer
?>
<!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>

<?php
// BOF: WebMakers.com Changed: Header Tag Controller v2.4.7
// Replaced by header_tags.php
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?> 
 <title><?php echo TITLE; ?></title>
<?php
}
// EOF: WebMakers.com Changed: Header Tag Controller v2.4.7
?>

<?php echo META; ?>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- coolMenu //-->
<?php require(DIR_WS_INCLUDES . 'coolmenu.php'); ?>
<!-- coolMenu_eof //-->

<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="<?php echo PAGE_WIDTH; ?>" cellspacing="3" cellpadding="3">
 <tr>

Share this post


Link to post
Share on other sites
Hi all,

I am rather new to scripting in PHP and know nothing about java.  I have installed COOL MENU, but all i am getting is a blank box?  Java is not disabled in my browser and I did install the no js fix.  I have disabled cool menu for now but here is the top part of my product_info.php code mabe i have done something wrong.  can any please help. if i can get one page to work i can get them all to work.  I have only commented out the call to coolmenu.php in column_left.php, so all the code is there if you want to check it out.

Young's Gifts

Thanks

Adam

 

Hi Adam,

 

First off, I would amend your category names, you have a category with a ' (single quotation mark) in it.

 

We know that Single and Double quotation marks can cause problems with the menu.

 

If that fails, then leave the coolmenu.php active in the column_left.php file so that I can actually see all the source.

 

Regards

 

Mark


If at first you don't succeed. Find the answer on a Forum.

Share this post


Link to post
Share on other sites
Hi Adam,

 

First off, I would amend your category names, you have a category with a ' (single quotation mark) in it.

 

We know that Single and Double quotation marks can cause problems with the menu.

 

If that fails, then leave the coolmenu.php active in the column_left.php file so that I can actually see all the source.

 

Regards

 

Mark

 

 

Mark,

 

THANK YOU, I had looked at code all day yesterday and just did not think of that issue. The menu is working fine now. All I need to do now is adjust where it is on the page. :D :thumbsup:

 

Thanks

 

Adam

Share this post


Link to post
Share on other sites

Hey there. Im having trouble with adapting the coolmenu for firefox. No matter what changes I apply, even if I get its position right, once I resize the browser window the coolmenu stays put but the site in the background will have moved with the resize. Any one know why this is happening?

Share this post


Link to post
Share on other sites
Hey there. Im having trouble with adapting the coolmenu for firefox. No matter what changes I apply, even if I get its position right, once I resize the browser window the coolmenu stays put but the site in the background will have moved with the resize. Any one know why this is happening?

 

Yes (well sort of), the same problem is within Netscape 6 as well I believe. It is to do with the on-resize command.

 

I had this problem originally on my sites (which were centred) and I came up with a solution that worked for me (see page 34).

 

You could try amending my solution to work for yourself. I would start with that line in menu_animation.js and create a new on-resize command put into coolmenu.php

 

Mark :thumbsup:


If at first you don't succeed. Find the answer on a Forum.

Share this post


Link to post
Share on other sites
Sorry for the ignorance, but whats page 34 about. :P

 

There is some code on page 34 of this forum which shows how I made the menu go into the correct position by using javascript to work out where it is using page size calculations instead of hard fixing the from top and from right positions in the coolmenu.php file.

 

By creating a new on-resize function and removing the on-resize function in the menu_animation.js file, I was able to fix all the problems that I had.

 

Now I am not suggesting that this will work for you, but rather showing you the code that I used and allowing you to view and make amendments to the code for your own needs.

 

Mark


If at first you don't succeed. Find the answer on a Forum.

Share this post


Link to post
Share on other sites

Anyone figured out a good way to speed up the running of this code? I've installed the menu and gotten it working properly, but it substantially increases page load time, and I'm afraid it will run off impatient prospective customers. I've checked out a few of the links to live sites running the coolmenu (including that of the author), and those sites seem to be pretty speedy. I noticed a few other people complaning about page load times, but haven't seen any solutions. If I can't get it to work any faster, I guess I'll have to abandon it...which I'd rather not have to do, as I really like the menu. Any suggestions?

Share this post


Link to post
Share on other sites

I installed this contribution and it works very nicely. My problem is that it appears to be on top of the "what's new" and "manufacturers" boxes, and everything else that is on the background. Can someone help me to fix this? Thanks! :blink:

Share this post


Link to post
Share on other sites
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:

 

 

I had both my old CAtegories showing underneith my coolMenu categories, and I was able to hide the old categories by (in osCommerce admin) setting my Use Cache to 'false'.

Share this post


Link to post
Share on other sites
Has anyone solved the problem with subcategories dissapearing off the bottom of the screen? I know someone was asking about the submenu's dissapearing off the right of the screen.

 

 

Heya,

 

I've been racking my brains on this as well - much digging has come up with a couple of options.

 

If you're overlapping by a small amount, you can make the page snap down automatically when you mouseover the final row in your category.

 

in menu_animation.js, find:

 

c.hidesub(l,el); if(pm.mover) eval(pm.mover); if(!pm.isactive) pm.active(1);

 

and replace it with:

c.hidesub(l,el); if(pm.mover) eval(pm.mover); 
 if(!pm.isactive) {
   pm.active(1);
   var ht = bw.ns6?window.innerHeight:document.body.clientHeight;
   if (pm.lev>0 && ((pm.o.y + pm.b.y) > (ht-20)))
    window.scrollBy(0,c.l[pm.lev].m.length*pm.o.h);}

 

Not fantastically elegant, but it does the job.

 

My site had *too* many categories though, so even that wasn't enough - once the page snapped down I was still losing the middle of my category :(

 

You can make the *first* cat open by onClick instead of onMouseover, and require a click to close it as well - this allows your users to scroll the page as if they were accessing any other content. depending on your site a combination of both might work well.

 

To enable onClick, open coolmenu.php and locate:

 

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

 

after the last entry insert:

 

/**onclicker**/
oCMenu.openOnClick=1
oCMenu.closeOnClick=1

 

and you should be away.

 

Hope this is a little help to someone :blush:

 

Dan ;)

Share this post


Link to post
Share on other sites

Meh - won't let me edit my post??

 

Further to the above - setting openOnClick will also disable the clicking of the category names to show the contents of the catalog at that level :(

 

To get around this, set that to 0, but leave closeOnClick set to 1 ;)

 

Dan :)

Share this post


Link to post
Share on other sites

OK I@ve read through this topic and couldn't find the answer I was looking for.

 

I have everything installed however I am just getting a blank space where the menu should be.

 

Any ideas? :)

Share this post


Link to post
Share on other sites
OK I@ve read through this topic and couldn't find the answer I was looking for.

 

I have everything installed however I am just getting a blank space where the menu should be.

 

Any ideas? :)

 

Could be anything. For assistance, you will need to post a URL where we can look at the pages source.

 

Mark


If at first you don't succeed. Find the answer on a Forum.

Share this post


Link to post
Share on other sites
ah, can I paste what you need here?

 

Also, It instructs you to paste the following into every single page in the catalog directory, does that include sub-directories? The reasan I ask is because Step 4 tells you not to but Step 3 does not.

 

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

 

3.) Add the following lines to EVERY SINGLE file in your catalog-directory RIGHT AFTER THE <BODY> TAG.

(This is VERY important, if you don't add it right after the <body>-Tag, the script won't work!!).

 

So, add these 3 lines to every file in your catlog-directory between the <body>-Tag and the including of header.php:

 

<!-- coolMenu //-->

<?php require(DIR_WS_INCLUDES . 'coolmenu.php'); ?>

<!-- coolMenu_eof //-->

After adding these lines, your files should look like this:

 

<body marginwidth="0" marginheight="0" topmargin="0" >

 

<!-- coolMenu //-->

<?php require(DIR_WS_INCLUDES . 'coolmenu.php'); ?>

<!-- coolMenu_eof //-->

 

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

 

4.)? Add the following line to EVERY SINGLE file in your catalog-directory between <HEAD> and </HEAD>.

(only in the /catalog directory, NOT in any further subdirectories like /catalog/includes !!).

 

<script LANGUAGE="JavaScript1.2" SRC="includes/menu_animation.js"></SCRIPT>

Edited by J0hnnyBr4v0

Share this post


Link to post
Share on other sites
Also, It instructs you to paste the following into every single page in the catalog directory, does that include sub-directories? The reasan I ask is because Step 4 tells you not to but Step 3 does not.

 

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

 

Hi David,

 

That information is of no use in order to help you because I need to be able to see where the actual problem is, not the instructions.

 

In order to view the source, I would need to see the actual web page in my browser so that I could look through it for problems.

 

I can understand you not wanting to post the URL here, why don't you send me it in a PM.

 

Mark


If at first you don't succeed. Find the answer on a Forum.

Share this post


Link to post
Share on other sites
Thanks for your help Mark, all working now.

 

Well just got the sizes to sort out and then i'm happy. :)

 

just incase anyone else is stuck with the same problem.

 

I simply edited /includes/coolmenu.php

 

The problem I had was that the menu was sticking out from the box one the left hand side. I firtly re-sized the menu options as they were too big by changing

 

oCMenu.level[0].height=14

 

I also had my menu sitting too high, so I adjusted the following

 

oCMenu.fromTop=155

 

I also then had the issue of the box being too small to fit the meu in, so I simply edited the following to make the box size be calculated by a bigger value...

 

$height.= 3.35*count($categories);

 

I hope this helps if anyone has the same issue. ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×