Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

"Dynamenu" for osCommerce


Recommended Posts

What exactly are you putting into the header of the STS Template?

 

In the STS_template im just calling the $categorybox into the top of the page (so its above the content not in the columns.

 

<?php include(DIR_WS_BOXES . 'dm_categories.php'); ?> was placed at the very end of the header.php after the last php closing tag.

Link to comment
Share on other sites

// Create the root category list
function tep_make_cat_dmlist($rootcatid = 0, $maxlevel = 0){

   global $cPath_array, $show_full_tree, $languages_id;

   global $idname_for_menu, $cPath_array, $show_full_tree, $languages_id;

   // Modify category query if not fetching all categories (limit to root cats and selected subcat tree)
	if (!$show_full_tree) {
       $parent_query	= 'AND (c.parent_id = "0"';	

			if (isset($cPath_array)) {

			    $cPath_array_temp = $cPath_array;

			    foreach($cPath_array_temp AS $key => $value) {
					    $parent_query	.= ' OR c.parent_id = "'.$value.'"';
					}

					unset($cPath_array_temp);
			}	

       $parent_query .= ')';				
	} else {
       $parent_query	= '';	
	}		

	$result = tep_db_query('select c.categories_id, cd.categories_name, c.parent_id from ' . TABLE_CATEGORIES . ' c, ' . TABLE_CATEGORIES_DESCRIPTION . ' cd where c.categories_id = cd.categories_id and cd.language_id="' . (int)$languages_id .'" '.$parent_query.'order by sort_order, cd.categories_name');

	while ($row = tep_db_fetch_array($result)) {				
       $table[$row['parent_id']][$row['categories_id']] = $row['categories_name'];
   }

   $output .= tep_make_cat_dmbranch($rootcatid, $table, 0, $maxlevel);

   return $output;
}

 

Code for the above problem. starting at line 209 ending at line 245

Link to comment
Share on other sites

I installed dynamenu earlier successful, however now do I get an error message regarding the ereg_replace function. I found that this function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged. Is it a solution to use the preg_replace function? How does one apply it and upgrade the code? I think this question might be of interest for others to. Help is appreciated. Thanks in advance.

 

Here is the error message I get:

 

Deprecated: Function ereg_replace() is deprecated in \catalog\includes\functions\dynamenu\lib\layersmenu-common.inc.php on line 487 (and 793)

 

in

\catalog\includes\functions\dynamenu\lib\layersmenu-common.inc.php

on line 487

 

$this->menuStructure = ereg_replace (chr (13) , ' ' , $tree_string); // Microsoft Stupidity Suppression

 

 

in

\catalog\includes\functions\dynamenu\lib\layersmenu-common.inc.php

on line 793

 

$this->tree[$cnt] ['parsed_href'] = (ereg_replace('  ', ' ' , $this->tree[$cnt] ['href']) == ' ' ) ?  '#' : $this -> prependedUrl . $this->tree[$cnt] ['href'];

Link to comment
Share on other sites

Take it out of the template and put it at the end of catalog/includes/application_bottom.php

(I've never gotten it to work right from the template or footer.php files)

 

I had to move the code that calls application_bottom.php above the closing </body></html> tags in the php files in the root folder so that the footer code is echoed before those tags.

 

I have it in my STS template as described in the Dynamenu installation for STS.

~Tracy
 

Link to comment
Share on other sites

Interesting - the error shows you are trying to call the tep_make_cat_dmlist twice in your includes/boxes/dm_categories.php file. Have you used a file comparison tool (such as Winmerge) to compare your dm_categories.php file with the file that you downloaded in the contribution?

 

What is on the two lines referenced in the error? (lines 210 and 245 of your dm_categories.php file) ?

 

In the STS_template im just calling the $categorybox into the top of the page (so its above the content not in the columns.

 

<?php include(DIR_WS_BOXES . 'dm_categories.php'); ?> was placed at the very end of the header.php after the last php closing tag.

~Tracy
 

Link to comment
Share on other sites

Well, at a glance that looks correct to me. I'd still use a file comparison tool on it just to be sure.

 

In your sts_user_code.php file did you setup the dynamenu call like this:

$sts->start_capture();
require(DIR_WS_BOXES . 'dm_categories.php');
$sts->stop_capture('dmbox', 'box');

 

Do you maybe have more than one call to the file? (maybe you have it listed twice in includes/column_left.php for example?)

 

// Create the root category list
function tep_make_cat_dmlist($rootcatid = 0, $maxlevel = 0){

   global $cPath_array, $show_full_tree, $languages_id;

   global $idname_for_menu, $cPath_array, $show_full_tree, $languages_id;

   // Modify category query if not fetching all categories (limit to root cats and selected subcat tree)
	if (!$show_full_tree) {
       $parent_query	= 'AND (c.parent_id = "0"';	

			if (isset($cPath_array)) {

			    $cPath_array_temp = $cPath_array;

			    foreach($cPath_array_temp AS $key => $value) {
					    $parent_query	.= ' OR c.parent_id = "'.$value.'"';
					}

					unset($cPath_array_temp);
			}	

       $parent_query .= ')';				
	} else {
       $parent_query	= '';	
	}		

	$result = tep_db_query('select c.categories_id, cd.categories_name, c.parent_id from ' . TABLE_CATEGORIES . ' c, ' . TABLE_CATEGORIES_DESCRIPTION . ' cd where c.categories_id = cd.categories_id and cd.language_id="' . (int)$languages_id .'" '.$parent_query.'order by sort_order, cd.categories_name');

	while ($row = tep_db_fetch_array($result)) {				
       $table[$row['parent_id']][$row['categories_id']] = $row['categories_name'];
   }

   $output .= tep_make_cat_dmbranch($rootcatid, $table, 0, $maxlevel);

   return $output;
}

 

Code for the above problem. starting at line 209 ending at line 245

~Tracy
 

Link to comment
Share on other sites

This has been covered in a few places in this forum. Do a google search on this forum for this string: $mid->setMenuStructureString($categories_string)

 

ie..type into google search box the following: site:www.oscommerce.com/forums Dynamenu +$mid->setMenuStructureString($categories_string)

 

Is there a possibility to add Home to the begin of Dynamenu?

 

And maybe Contact at the end?

 

Hoping for a good quick respons.

~Tracy
 

Link to comment
Share on other sites

Check out this forum thread:

 

http://www.oscommerce.com/forums/topic/341737-function-ereg-replace-is-deprecated

 

I installed dynamenu earlier successful, however now do I get an error message regarding the ereg_replace function. I found that this function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged. Is it a solution to use the preg_replace function? How does one apply it and upgrade the code? I think this question might be of interest for others to. Help is appreciated. Thanks in advance.

 

Here is the error message I get:

 

Deprecated: Function ereg_replace() is deprecated in \catalog\includes\functions\dynamenu\lib\layersmenu-common.inc.php on line 487 (and 793)

 

in

\catalog\includes\functions\dynamenu\lib\layersmenu-common.inc.php

on line 487

 

$this->menuStructure = ereg_replace (chr (13) , ' ' , $tree_string); // Microsoft Stupidity Suppression

 

 

in

\catalog\includes\functions\dynamenu\lib\layersmenu-common.inc.php

on line 793

 

$this->tree[$cnt] ['parsed_href'] = (ereg_replace('  ', ' ' , $this->tree[$cnt] ['href']) == ' ' ) ?  '#' : $this -> prependedUrl . $this->tree[$cnt] ['href'];

~Tracy
 

Link to comment
Share on other sites

Take it out of the template and put it at the end of catalog/includes/application_bottom.php

(I've never gotten it to work right from the template or footer.php files)

 

Will try that, thanks..

Link to comment
Share on other sites

I would love to, but I have not had to deal with this issue yet. Did you try posting the lines of code that need changing to the other forum post regarding this specific issue?

 

Hello Tracy, thanks for your reply. I am aware of the post, but couldnt solve the problem with it. However if you could deliver a solution it would be appreciated.

Best regards, Adrian

~Tracy
 

Link to comment
Share on other sites

Where in: includes\boxes\dm_categories.php add > $mid->setMenuStructureString(".|Home|index.php|Home|||\n".$categories_string); ?

 

Where to add it so it becomes before the categories. Sorry for my question couldn't find this?

 

I added it here:

 

// Generate menus
$mid->setMenuStructureString(".|Home|index.php|Home|||\n".$categories_string);
$mid->setMenuStructureString($categories_string);
$mid->parseStructureForMenu('catmenu');

 

But my menu is still the same nothing happend?

Edited by kanata_82
Link to comment
Share on other sites

in

\catalog\includes\functions\dynamenu\lib\layersmenu-common.inc.php

on line 487

change

$this->menuStructure = ereg_replace (chr (13) , ' ' , $tree_string); // Microsoft Stupidity Suppression

 

to

$this->menuStructure = preg_replace ('#chr (13)#', ' ' , $tree_string); // Microsoft Stupidity Suppression

 

 

in

\catalog\includes\functions\dynamenu\lib\layersmenu-common.inc.php

on line 793

change

$this->tree[$cnt] ['parsed_href'] = (ereg_replace('  ', ' ' , $this->tree[$cnt] ['href']) == ' ' ) ?  '#' : $this -> prependedUrl . $this->tree[$cnt] ['href'];

 

to

$this->tree[$cnt] ['parsed_href'] = (preg_replace('#  #', ' ' , $this->tree[$cnt] ['href']) == ' ' ) ?  '#' : $this -> prependedUrl . $this->tree[$cnt] ['href'];

 

 

I installed dynamenu earlier successful, however now do I get an error message regarding the ereg_replace function. I found that this function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged. Is it a solution to use the preg_replace function? How does one apply it and upgrade the code? I think this question might be of interest for others to. Help is appreciated. Thanks in advance.

 

Here is the error message I get:

 

Deprecated: Function ereg_replace() is deprecated in \catalog\includes\functions\dynamenu\lib\layersmenu-common.inc.php on line 487 (and 793)

 

in

\catalog\includes\functions\dynamenu\lib\layersmenu-common.inc.php

on line 487

 

$this->menuStructure = ereg_replace (chr (13) , ' ' , $tree_string); // Microsoft Stupidity Suppression

 

 

in

\catalog\includes\functions\dynamenu\lib\layersmenu-common.inc.php

on line 793

 

$this->tree[$cnt] ['parsed_href'] = (ereg_replace('  ', ' ' , $this->tree[$cnt] ['href']) == ' ' ) ?  '#' : $this -> prependedUrl . $this->tree[$cnt] ['href'];

Link to comment
Share on other sites

Has somebody seen this problem with Dynamenu? (I'm using STS)

 

What is the problem here, and how can I fix this?

dynamenu2.jpg

 

This:

$menu_layer_offset = array (-42,104,4);

fixed this problem....blush.gif

Link to comment
Share on other sites

This is the instructions I have for putting it before the menu:

 

$mid->setMenuStructureString(".|Home|index.php|Home|||\n".$categories_string);

 

For after the menu I have this:

 

$mid->setMenuStructureString($categories_string."\n.|Home|index.php|Home|||");

 

Where in: includes\boxes\dm_categories.php add > $mid->setMenuStructureString(".|Home|index.php|Home|||\n".$categories_string); ?

 

Where to add it so it becomes before the categories. Sorry for my question couldn't find this?

 

I added it here:

 

// Generate menus
$mid->setMenuStructureString(".|Home|index.php|Home|||\n".$categories_string);
$mid->setMenuStructureString($categories_string);
$mid->parseStructureForMenu('catmenu');

 

But my menu is still the same nothing happend?

~Tracy
 

Link to comment
Share on other sites

PS - Part of the reason you may have seen nothing happen is that instead of modifying your existing $mid->setMenuStructureString you added another one - you only need one of these so comment the extra one out by putting // in front of it.

 

Where in: includes\boxes\dm_categories.php add > $mid->setMenuStructureString(".|Home|index.php|Home|||\n".$categories_string); ?

 

Where to add it so it becomes before the categories. Sorry for my question couldn't find this?

 

I added it here:

 

// Generate menus
$mid->setMenuStructureString(".|Home|index.php|Home|||\n".$categories_string);
$mid->setMenuStructureString($categories_string);
$mid->parseStructureForMenu('catmenu');

 

But my menu is still the same nothing happend?

~Tracy
 

Link to comment
Share on other sites

I installed and am having 3 problems and really hoping someone can help on both.

 

visit https://www.paintballwarehouseny.com/airsoft-c-148.html and you can see all of the problems (I hope)

 

1. if you hover over Clothing and apparel in the menu you will see that hover goes under the image of the item to the left. How can I get the menu to be on top of anything in the products listing? (I also have Enhanced product listing installed and an having hover over problems with that too where you will see that the hovers of the product images also appear under the original in firefox, but this hover over problem with the menu is in Firefox and IE)

 

2. hover over Guns upgrade and Accessories and you will see the categories box resize a bit larger? any solution to this?

 

3. If you select a category, the active category highlights is a gray color, this is true in the sub categories, even though the stylesheet is a color as shown below

 

.vertitem a:active { /* Font style & color, background menu color of main menu item when clicked */

color: #ffffff;

background-color: #021379;

text-decoration: none;

font-weight: bold;

}

and

 

.vertsubitem a:active { /* Font style & color, background submenu color of submenu item when clicked */

color: #ffff00;

background-color: #666666;

text-decoration: none;

}

 

 

Here's hopeing for a solution!

 

Sue

Edited by designbysue
Link to comment
Share on other sites

PS - Part of the reason you may have seen nothing happen is that instead of modifying your existing $mid->setMenuStructureString you added another one - you only need one of these so comment the extra one out by putting // in front of it.

 

It is working but How i can add the contact us page now then at the end so home is at the begin and contact at the end?

 

1 More thing if I click exampe on "HOME" it is working and opening. BUT it doesn't get a class ACTIVE?

Link to comment
Share on other sites

I installed and am having 3 problems and really hoping someone can help on both.

 

visit https://www.paintballwarehouseny.com/airsoft-c-148.html and you can see all of the problems (I hope)

 

1. if you hover over Clothing and apparel in the menu you will see that hover goes under the image of the item to the left. How can I get the menu to be on top of anything in the products listing? (I also have Enhanced product listing installed and an having hover over problems with that too where you will see that the hovers of the product images also appear under the original in firefox, but this hover over problem with the menu is in Firefox and IE)

 

2. hover over Guns upgrade and Accessories and you will see the categories box resize a bit larger? any solution to this?

 

3. If you select a category, the active category highlights is a gray color, this is true in the sub categories, even though the stylesheet is a color as shown below

 

.vertitem a:active { /* Font style & color, background menu color of main menu item when clicked */

color: #ffffff;

background-color: #021379;

text-decoration: none;

font-weight: bold;

}

and

 

.vertsubitem a:active { /* Font style & color, background submenu color of submenu item when clicked */

color: #ffff00;

background-color: #666666;

text-decoration: none;

}

 

 

Here's hopeing for a solution!

 

Sue

 

 

Found the answer to #1 for those who may need it the solution is to change the stylesheet and add a z-index as follows:

 

.vertsubmenu { /* Behaviour of sub-menu - leave as is for proper operation of submenus */

position: absolute;

left: 0;

top: 0;

visibility: hidden;

z-index:999;

 

Anyone have any input on #2 and #3 - for #2 I could resize the box and will probably do so to get rid of this bug but an actual solution would be much better. And and regards #3 this is really a problem - I have actually searched the site for the gray color (hex numbers) and there is nothing I can find. I can't figure out where the style is that is affecting this (I have changed the new styles added in the contribution)

 

Please

 

Thanks

Sue

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...