Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

"Dynamenu" for osCommerce


Recommended Posts

This contribution is working great for me.

 

I just have one issue. My flyout sits behind .swf images on my index page. My images are included in my includes/languages/english/index.php along with my text. The flyout sits on top on the text and jpegs/png etc but not .swf.

 

Does anyone have any ideas?

 

www.hydro-organicsuk.co.uk

Link to comment
Share on other sites

This contribution is working great for me.

 

I just have one issue. My flyout sits behind .swf images on my index page. My images are included in my includes/languages/english/index.php along with my text. The flyout sits on top on the text and jpegs/png etc but not .swf.

 

Does anyone have any ideas?

 

www.hydro-organicsuk.co.uk

Flash images are always on top. The only cure is to convert your .swf to another format.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 2 weeks later...

Hello there,

 

I need to make a custom title attributes for each of the category links, instead of the default which is the category name.

So I created this field categories_title_attr in the categories_description table.

Now I need to incorporate the contents of this field into the title attribute for the links.

 

Any help is greatly appreciated.

 

Here is the code of dm_categories.php in my installation

 

________________________________

<?php

/*

$Id: ul_categories.php,v 1.00 2006/04/30 01:13:58 nate_02631 Exp $

 

Outputs the store category list as a proper unordered list, opening up

possibilities to use CSS to style as drop-down/flyout, collapsable or

other menu types.

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2006 Nate Welch http://www.natewelch.com

 

Released under the GNU General Public License

*/

 

// BEGIN Configuration options

 

// Set to false to display the unordered list only. Set to true to display in

// a regular box. The former is useful for better integrating the menu with your layout.

$show_ulcats_as_box = false;

 

// Indicates whether or not to render your entire category list or just the root categories

// and the currently selected submenu tree. Rendering the full list is useful for dynamic menu

// generation where you want the user to have instant access to all categories. The other option

// is the default oSC behaviour, when the subcats aren't available until the parent is clicked.

$show_full_tree = false;

 

// This is the CSS *ID* you want to assign to the UL (unordered list) containing

// your category menu. Used in conjuction with the CSS list you create for the menu.

// This value cannot be blank.

$idname_for_menu = 'navlist';

 

// This is the *CLASSNAME* you want to tag a LI to indicate the selected category.

// The currently selected category (and its parents, if any) will be tagged with

// this class. Modify your stylesheet as appropriate. Leave blank or set to false to not assign a class.

$classname_for_selected = 'selected';

 

// This is the *CLASSNAME* you want to tag a LI to indicate a category has subcategores.

// Modify your stylesheet to draw an indicator to show the users that subcategories are

// available. Leave blank or set to false to not assign a class.

$classname_for_parent = false;

 

// This is the HTML that you would like to appear before your categories menu if *not*

// displaying in a standard "box". This is useful for reconciling tables or clearing

// floats, depending on your layout needs.

$before_nobox_html = '';

 

// This is the HTML that you would like to appear after your categories menu if *not*

// displaying in a standard "box". This is useful for reconciling tables or clearing

// floats, depending on your layout needs.

// $after_nobox_html = '<div style="clear: both;">';

 

 

// END Configuration options

 

// Global Variables

$GLOBALS['this_level'] = 0;

 

// Initialize HTML and info_box class if displaying inside a box

if ($show_ulcats_as_box) {

echo '<tr><td>';

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

new infoBoxHeading($info_box_contents, true, false);

}

 

// Generate a bulleted list (uses configuration options above)

$categories_string = tep_make_cat_ullist();

 

// Output list inside a box if specified, otherwise just output unordered list

if ($show_ulcats_as_box) {

$info_box_contents = array();

$info_box_contents[] = array('text' => $categories_string);

new infoBox($info_box_contents);

echo '</td></tr>';

} else {

echo $before_nobox_html;

echo $categories_string;

echo $after_nobox_html;

}

 

 

// Create the root unordered list

function tep_make_cat_ullist($rootcatid = 0, $maxlevel = 0){

 

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

//COMMENT BELOW TO SHOW ONLY TOP CATEGORIES

/* 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);

} */

//END COMMENT FOR SHOW TOP CATEGORIES

 

$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 .= '<ul id="'.$idname_for_menu.'">';

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

 

// Close off nested lists

for ($nest = 0; $nest <= $GLOBALS['this_level']; $nest++) {

$output .= '<!-- <li><img src="images/bulleted_short.gif"></li> --></ul>';

}

 

return $output;

}

 

// Create the branches of the unordered list

function tep_make_cat_ulbranch($parcat, $table, $level, $maxlevel) {

 

global $cPath_array, $classname_for_selected, $classname_for_parent;

 

$list = $table[$parcat];

 

while(list($key,$val) = each($list)){

 

if ($GLOBALS['this_level'] != $level) {

 

if ($GLOBALS['this_level'] < $level) {

$output .= "\n".'<ul>';

} else {

for ($nest = 1; $nest <= ($GLOBALS['this_level'] - $level); $nest++) {

$output .= '</ul></li>'."\n";

}

/*

if ($GLOBALS['this_level'] -1 == $level)

$output .= '</ul></li>'."\n";

elseif ($GLOBALS['this_level'] -2 == $level)

$output .= '</ul></li></ul></li>'."\n";

elseif ($GLOBALS['this_level'] -3 == $level)

$output .= '</ul></li></ul></li></ul></li>'."\n";

elseif ($GLOBALS['this_level'] -4 == $level)

$output .= '</ul></li></ul></li></ul></li></ul></li>'."\n";

*/

}

 

$GLOBALS['this_level'] = $level;

}

 

if (isset($cPath_array) && in_array($key, $cPath_array) && $classname_for_selected) {

$this_cat_class = $classname_for_selected . ' ';

} else {

$this_cat_class = '';

}

 

$output .= '<li class="'.$this_cat_class.'cat_lev_'.$level.'"><a class="link_lev_' .$level.'" href="';

 

if (!$level) {

unset($GLOBALS['cPath_set']);

$GLOBALS['cPath_set'][0] = $key;

$cPath_new = 'cPath=' . $key;

 

} else {

$GLOBALS['cPath_set'][$level] = $key;

$cPath_new = 'cPath=' . implode("_", array_slice($GLOBALS['cPath_set'], 0, ($level+1)));

}

 

if (tep_has_category_subcategories($key) && $classname_for_parent) {

$this_parent_class = ' class="'.$classname_for_parent.'"';

} else {

$this_parent_class = '';

}

 

$output .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '"'.$this_parent_class.'title="' . ucwords(strtolower($val)) . '">'.$val;

 

if (SHOW_COUNTS == 'true') {

$products_in_category = tep_count_products_in_category($key);

if ($products_in_category > 0) {

$output .= ' ' .'</a>'. '(' . $products_in_category . ')';

}

}

 

$output .= ''. '</a></li>'."\n";

 

if (!tep_has_category_subcategories($key)) {

$output .= ''."";

}

 

if ((isset($table[$key])) AND (($maxlevel > $level + 1) OR ($maxlevel == '0'))) {

$output .= tep_make_cat_ulbranch($key,$table,$level + 1,$maxlevel);

}

 

} // End while loop

 

return $output;

}

 

?>

Link to comment
Share on other sites

Hello people

 

What I try to do is to get a second dynamenu on my site, to display the different article topics that come from the article manager contribution. There are some related osts in this forum, some years back already: here, here and here

 

Based on the box dm_categories.php, I created a second one called dm_articles.php. Changing various things in there I succeed to have the second box to display all my articles in the same way as categories.

 

All menu types (tree plain flyout etc) work well on the same page except the case I want to have 2xflyout or 2xdropdown or 1xflyout and 1xdropndown. In case of 2 flyouts the first flyout do not react at all the second one shows the output like it would be the output of the first one. In case of 2 dropdowns the first one is dead but the second one works ! Same thing if having the first as flyout and the second as dropdown

 

I suspect that something is going wrong when the moment comes to place the "footers"into the global. Looking at the source of my page, I see that there is always the second menu is getting mentioned, not a single line for the first one, no wonder that only the second work.

 

My file "dm_articles.php" looks so far like thid

// END Configuration Options


// Misc setting to make folder icon clickable to expand tree menu nodes
$GLOBALS['dm_tree_titleclick'] = true;	

// Initialize HTML and info_box class if displaying inside a box
if ($show_artdmcats_as_box) {
   echo '<tr><td>';
   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);
   new infoBoxHeading($info_box_contents, true, false);					
}

// Generate the menu data output (uses configuration options above)
$topics_string = tep_make_art_dmlist();

// Include required libraries based on menu type
require_once 'includes/functions/dynamenu/lib/PHPLIB.php';
require_once 'includes/functions/dynamenu/lib/layersmenu-common.inc.php';

if ($menu_type < 2) { // Setup for DHTML style menus

   ?>
       <script language="JavaScript" type="text/javascript">
           <!--
               <?php require_once 'includes/functions/dynamenu/libjs/layersmenu-browser_detection.js'; ?>
           // -->
       </script>
       <script language="JavaScript" type="text/javascript" src="includes/functions/dynamenu/libjs/layersmenu-library.js"></script>
       <script language="JavaScript" type="text/javascript" src="includes/functions/dynamenu/libjs/layersmenu.js"></script>
   <?php

   require_once 'includes/functions/dynamenu/lib/layersmenu.inc.php';
   $mid = new LayersMenu($menu_layer_offset[0],$menu_layer_offset[1],$menu_layer_offset[2],1);

} elseif ($menu_type > 2) { // Setup for plain style menus

   require_once 'includes/functions/dynamenu/lib/plainmenu.inc.php';
   $mid = new PlainMenu();

} else {  // Setup for tree style menus

	?>
       <script language="JavaScript" type="text/javascript">
           <!--
               <?php require_once 'includes/functions/dynamenu/libjs/layersmenu-browser_detection.js'; ?>

							<?php

							   if ($menu_tree_current_path) {
								     echo "\n".'var menu_tree_current_path = true';   		   
								 } else {
								     echo "\n".'var menu_tree_current_path = false'; 									 
								 }

							?>
       // -->
       </script>
       <script language="JavaScript" type="text/javascript" src="includes/functions/dynamenu/libjs/layerstreemenu-cookies.js"></script>
   <?php

       require_once 'includes/functions/dynamenu/lib/treemenu.inc.php';
       $mid = new TreeMenu();

}

// Set menu config variables
$mid->setDirroot('./');
$mid->setLibjsdir('./includes/functions/dynamenu/libjs/');

if ($menu_type !=2) {
   $mid->setTpldir('./includes/functions/dynamenu/templates/');
}

$mid->setImgdir('./images/');
$mid->setImgwww('images/');
$mid->setIcondir('./images/');
$mid->setIconwww('images/');
$mid->setIconsize($menu_icon_width, $menu_icon_height);

// Generate menus
$mid->setMenuStructureString($topics_string);
$mid->parseStructureForMenu('artmenu');

switch ($menu_type) {
   case 0: // Horizontal drop-down
       $mid->setDownArrowImg($menu_downarrowimg);
       $mid->setForwardArrowImg($menu_fwdarrowimg);
       $mid->setHorizontalMenuTpl('layersmenu-horizontal_menu.ihtml');						
       $mid->setSubMenuTpl('layersmenu-horiz_sub_menu.ihtml');							
		  $mid->newHorizontalMenu('artmenu');	
			$mid->printHeader();
       $topics_menu = $mid->getMenu('artmenu');
			$GLOBALS['dmfooter'] = $mid->getFooter();								
       break;
   case 1:  // Vertical fly-out
       $mid->setDownArrowImg($menu_downarrowimg);
       $mid->setForwardArrowImg($menu_fwdarrowimg);
       $mid->setVerticalMenuTpl('layersmenu-vertical_menu.ihtml');				
       $mid->setSubMenuTpl('layersmenu-vert_sub_menu.ihtml');							
			$mid->newVerticalMenu('artmenu');
			$mid->printHeader();
       $topics_menu = $mid->getMenu('artmenu');
			$GLOBALS['dmfooter'] = $mid->getFooter();												
       break;
   case 2:  // Tree menu
	    $topics_menu = $mid->newTreeMenu('artmenu');
       break;
   case 3:  // Horizontal plain menu
       $mid->setPlainMenuTpl('layersmenu-horizontal_plain_menu.ihtml');		
       $topics_menu = $mid->newHorizontalPlainMenu('artmenu');							
       break;
   case 4:  // Vertical plain menu
       $mid->setPlainMenuTpl('layersmenu-plain_menu.ihtml');		
       $topics_menu = $mid->newPlainMenu('artmenu');						
       break;	 	 
}	


// Output list inside a box if specified, otherwise just output unordered list
if ($show_artdmcats_as_box) {
   $info_box_contents = array();
   $info_box_contents[] = array('text' => $topics_menu);
   new infoBox($info_box_contents);
	echo '</td></tr>';	
} else {
	echo $before_nobox_html;	
   echo $topics_menu;
	echo $after_nobox_html;
}

// Create the root category list
function tep_make_art_dmlist($rootartid = 0, $maxlevel = 0){

   global $tPath_array, $show_full_tree, $languages_id;

   global $idname_for_menu, $tPath_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 (t.parent_id = "0"';	

			if (isset($tPath_array)) {

			    $tPath_array_temp = $tPath_array;

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

					unset($tPath_array_temp);
			}	

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

	$result = tep_db_query('select t.topics_id, td.topics_name, t.parent_id from ' . TABLE_TOPICS . ' t, ' . TABLE_TOPICS_DESCRIPTION . ' td where t.topics_id = td.topics_id and td.language_id="' . (int)$languages_id .'" '.$parent_query.'order by sort_order, td.topics_name');

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

   $output .= tep_make_art_dmbranch($rootartid, $table, 0, $maxlevel);

   return $output;
}

// Create the branches off the category list
function tep_make_art_dmbranch($parcat, $table, $level, $maxlevel) {

   global $tPath_array, $menu_use_titles, $menu_icon_file, $divide_subcats, $divide_subcats_text, $pic;

	$lvl_adjust = 1;

   $list = $table[$parcat];

   // Build data for menu
	while(list($key,$val) = each($list)){

			if (isset($tPath_array) && in_array($key, $tPath_array)) {
           $this_expanded = '1';
           $this_selected = 'dmselected';						
       } else {
           $this_expanded = '';
           $this_selected = '';									
	    }	

       if (!$level) {
			    unset($GLOBALS['tPath_set']);
					$GLOBALS['tPath_set'][0] = $key;
           $tPath_new = 'tPath=' . $key;

       } else {
					$GLOBALS['tPath_set'][$level] = $key;		
           $tPath_new = 'tPath=' . implode("_", array_slice($GLOBALS['tPath_set'], 0, ($level+1)));

					$this_subcat_count++;
       }

			if ($menu_use_titles) {
			    $this_title = $val;
			} else {
			    $this_title = '';				
			}				

       if (SHOW_COUNTS == 'true') {
           $articles_in_topic = tep_count_articles_in_topic($key);
           if ($articles_in_topic > 0) {
               $val .= ' (' . $articles_in_topic . ')';
           }
       }


			// Output for file to be parsed by PHP Layers Menu
			// Each line (terminated by a newline "\n" is a pipe delimited string with the following fields:
			// [dots]|[text]|[link]|[title]|[icon]|[target]|[expanded]
			// dots - number of dots signifies the level of the link '.' root level items, '..' first submenu, etc....
			// text - text for link; title - tooltip for link; icon - icon for link; target - "dmselected" CSS class if item is selected
			// expanded - signifies if the node is expanded or collapsed by default (applies only to tree style menus)

			// Add "more" submenu if dividing subcategories
			if ($this_subart_count > $divide_subarts && $divide_subarts) {
           $output .= str_repeat(".", $level+$lvl_adjust).'|'.$divide_subarts_text.'||'.$this_title.'|'.$menu_icon_file.'|'.$this_selected.'|'.$this_expanded."\n";							 
			    $this_subart_count = 1;
					$lvl_adjust ++;
			}

       $output .= str_repeat(".", $level+$lvl_adjust).'|'.$val.'|'.tep_href_link(FILENAME_ARTICLES, $tPath_new).'|'.$this_title.'|'.$menu_icon_file.'|'.$this_selected.'|'.$this_expanded."\n";				 


       if ((isset($table[$key])) AND (($maxlevel > $level + 1) OR ($maxlevel == '0'))) {
           $output .= tep_make_art_dmbranch($key,$table,$level + $lvl_adjust,$maxlevel);
       }

	} // End while loop

   return $output;
}	

?>

 

Any idea about what to do is welcome

 

EDIT: I don't know why my code looks like commented out here, in real it is not

Edited by multimixer
Link to comment
Share on other sites

I haven't run two on the same page before - but someone who uses STS v4+ did and they posted it to the PowerPack downloads area here: http://www.oscommerce.com/community/contributions,4456 Even if you don't have STS installed, you may be able to review their code and see how they did the two dynamenus :blush:

 

Hello people

 

What I try to do is to get a second dynamenu on my site, to display the different article topics that come from the article manager contribution. There are some related osts in this forum, some years back already: here, here and here

 

Based on the box dm_categories.php, I created a second one called dm_articles.php. Changing various things in there I succeed to have the second box to display all my articles in the same way as categories.

 

All menu types (tree plain flyout etc) work well on the same page except the case I want to have 2xflyout or 2xdropdown or 1xflyout and 1xdropndown. In case of 2 flyouts the first flyout do not react at all the second one shows the output like it would be the output of the first one. In case of 2 dropdowns the first one is dead but the second one works ! Same thing if having the first as flyout and the second as dropdown

 

I suspect that something is going wrong when the moment comes to place the "footers"into the global. Looking at the source of my page, I see that there is always the second menu is getting mentioned, not a single line for the first one, no wonder that only the second work.

 

My file "dm_articles.php" looks so far like thid

 

 

Any idea about what to do is welcome

 

EDIT: I don't know why my code looks like commented out here, in real it is not

~Tracy
 

Link to comment
Share on other sites

I am trying to add a feature in the includes/boxes/dm_categories.php file that will allow me to divide the products (not just the subcats)

 

So - I have this code at the top of the file:

// to display.  The menu will show a "more..." link and display the remaining subcategories
// under that selection. Leave at "0" to not divide your subcategories.
$divide_subcats = 0;	
$divide_pic = 10;

// The text you want to display to indicate more subcategories are available
// This can be set a string or to a language constant you define.
$divide_subcats_text = 'more...';
$divide_pic_text = 'more...';	

 

and at the bottom of the file:

				// Add "more" submenu if dividing subcategories
			if ($this_subcat_count > $divide_subcats && $divide_subcats) {
           $output .= str_repeat(".", $level+$lvl_adjust).'|'.$divide_subcats_text.'||'.$this_title.'|'.$menu_icon_file.'|'.$this_selected.'|'.$this_expanded."\n";							 
			    $this_subcat_count = 1;
					$lvl_adjust ++;
					$lvl_adjust2 ++;
			}

       $output .= str_repeat(".", $level+$lvl_adjust).'|'.$val.'|'.tep_href_link(FILENAME_DEFAULT, $cPath_new).'|'.$this_title.'|'.$menu_icon_file.'|'.$this_selected.'|'.$this_expanded."\n";							 

//BOF product listing
$_products_in_category_array = $pic->getProductsInCategory($key);

// returns false if no products in the category
   if ($_products_in_category_array != false) {
       $products_in_category_array = $_products_in_category_array;

foreach ($products_in_category_array as $array_key => $products_in_category) {

$product_id_h = 'products_id='.$products_in_category ['products_id'];
$product_name_h = $products_in_category ['products_name'];

if ($GLOBALS['products_id'] == $products_in_category ['products_id']) {
$that_expanded = '1';
$that_selected = 'dmselected';
} else {
$that_expanded = '';
$that_selected = '';
}

if ($menu_use_titles) {
$that_title = $product_name_h;
} else {
$that_title = '';
}


// Add "more" submenu if dividing subcategories
		$pcount = count($products_in_category,0);
           if ($pcount > divide_pic && divide_pic ) {
           $output .= str_repeat(".", $lvl_adjust2).'|'.$divide_pic_text.'||'.$product_name_h.'|'.tep_href_link(FILENAME_PRODUCT_INFO, $product_id_h).'|'.$that_title.'|'.$menu_icon_file.'|'.$that_selected.'|'.$that_expanded."\n";							 
			    $pcount = 1;
					$lvl_adjust2 ++;
			}

$output .= str_repeat(".", $lvl_adjust2).'|'.$product_name_h.'|'.tep_href_link(FILENAME_PRODUCT_INFO, $product_id_h).'|'.$that_title.'|'.$menu_icon_file.'|'.$that_selected.'|'.$that_expanded."\n";
}// end if ($_products_in_category_array != false)
} //EOF product listing

       if ((isset($table[$key])) AND (($maxlevel > $level + 1) OR ($maxlevel == '0'))) {
           $output .= tep_make_cat_dmbranch($key,$table,$level + $lvl_adjust,$maxlevel);
       }

	} // End while loop

   return $output;
}	

 

The problem I am having is that it is taking an eternity to count the products in each category, and then it is returning a listing like this:

category ->

subcategory ->

0 ->

Product name ->

0 ->

Product name ->

0 ->

Product name ->

 

 

etc.... - instead of returning a list of 10 products and then a "more..." link. So I have a few questions :blink:

 

Where are the 0's coming from? Why is it returning only one product per level? Why does it take it so long to count?

 

Anybody have any ideas on what I'm doing wrong here? I have been banging my head on the wall (so-to-speak) for hours on this. I've tried changing where I have the "$pcount = count($products_in_category,0);" on the page (and even what I've referenced to count), and I've tried with and without the ",0" after the $products_in_category bit. I either get no results whatsoever (so things aren't being counted) or I get the above issue. I'm definitely scratching my head here :huh:

 

Thanks in advance for anyone who can help :)

~Tracy
 

Link to comment
Share on other sites

This contribution works well for me exceptone little niggle.

 

My boxes have a width set to 121px. But the width of my dm_categories box seems to be governed by the length of the category names.

 

ie. If I have a category named

"ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"

the dm_categories box will be that long. It doesnt wrap the text to fit in a 121px box. I did try throwing in <br> (ie. cccccccccc<br>cccccccccccccc<br> etc) but the category names are used in more than just the categories box so isn't really a work around.

 

Can anyone help me wrap text in dm_categories?

 

Many Thanks

Link to comment
Share on other sites

You can use the wordwrap() function to limit the category names to a given number of characters. You may need to experiment with the number a bit to get the right width.

 

Regards

Jim

Edited by kymation

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I am using STS and trying to install this on a live store. It worked on my dev server, but on the live site, I am get the following error:

 

 

LayersMenu Error: setDirroot: ./ is not a directory.

Halted.

 

I get this error when I add this code to my sts_user_code.php file per the instructions from How to get Dynamenu to work with STSv4x

By: Bill Kellum

 

$sts->start_capture();

require(DIR_WS_BOXES . 'dm_categories.php');

$sts->stop_capture('dmbox', 'box');

 

Can somebody help me figure out how I can eliminate this error?

 

Thanks,

Janet

Link to comment
Share on other sites

I get this error when I add this code to my sts_user_code.php file per the instructions from How to get Dynamenu to work with STSv4x

 

You need to do 2 things to get it working with STS

 

1) In file includes/modules/sts_inc/sts_column_left.php , find this line

  $sts->restart_capture ('manufacturerbox', 'box');

add under it this:

  require(DIR_WS_BOXES . 'dm_categories.php');
 $sts->restart_capture('dmbox', 'box'); // Get Dynamenu Category box

so that the code there looks like this

// Get manufacturer box from db or cache  
 if ((USE_CACHE == 'true') && empty($SID)) {
   echo tep_cache_manufacturers_box();
 } else {
   include(DIR_WS_BOXES . 'manufacturers.php');
 }
 $sts->restart_capture ('manufacturerbox', 'box');

 require(DIR_WS_BOXES . 'dm_categories.php');
 $sts->restart_capture('dmbox', 'box'); // Get Dynamenu Category box


 require(DIR_WS_BOXES . 'whats_new.php');
 $sts->restart_capture ('whatsnewbox', 'box'); // Get What's new box

 

2) go to file includes/application_bottom.php and at the very end add this

  // Output the footer for Dynamenu for osCommerce
   echo $GLOBALS['dmfooter'];

After this it must be just one line containing this

?>

Link to comment
Share on other sites

You can use the wordwrap() function to limit the category names to a given number of characters. You may need to experiment with the number a bit to get the right width.

 

Regards

Jim

 

 

Many Thanks Jim,

 

The examples on the page you linked to are easy enough to follow but where it fits into my site is a bit much for me really. Ive waded through dm_categories.php for about an hour and I cant work out which bit defines the category name.

Link to comment
Share on other sites

You need to do 2 things to get it working with STS

 

1) In file includes/modules/sts_inc/sts_column_left.php , find this line

  $sts->restart_capture ('manufacturerbox', 'box');

add under it this:

  require(DIR_WS_BOXES . 'dm_categories.php');
 $sts->restart_capture('dmbox', 'box'); // Get Dynamenu Category box

so that the code there looks like this

// Get manufacturer box from db or cache  
 if ((USE_CACHE == 'true') && empty($SID)) {
   echo tep_cache_manufacturers_box();
 } else {
   include(DIR_WS_BOXES . 'manufacturers.php');
 }
 $sts->restart_capture ('manufacturerbox', 'box');

 require(DIR_WS_BOXES . 'dm_categories.php');
 $sts->restart_capture('dmbox', 'box'); // Get Dynamenu Category box


 require(DIR_WS_BOXES . 'whats_new.php');
 $sts->restart_capture ('whatsnewbox', 'box'); // Get What's new box

 

2) go to file includes/application_bottom.php and at the very end add this

  // Output the footer for Dynamenu for osCommerce
   echo $GLOBALS['dmfooter'];

After this it must be just one line containing this

?>

I tried putting the code there, and the page ignored it... When I set this up on the dev site, I put the code with the rest of my includes in the sts_user_code.php file as such:

 

$sts->start_capture();

require(DIR_WS_INCLUDES . 'boxes/dm_categories.php');

$sts->stop_capture('dmbox', 'box');

 

I have tried putting the footer code in application_bottom.php and in my STS footer box...

 

The error shows up when I upload the sts_user_code.php file and this is the error I get:

 

LayersMenu Error: setDirroot: ./ is not a directory.

Halted.

 

Can it be something in layersmenu-common.inc.php where the error initiates?

 

function setDirrootCommon($dirroot)

{

if (!is_dir($dirroot)) {

$this->error("setDirroot: $dirroot is not a directory.");

return false;

}

if (substr($dirroot, -1) != '/') {

$dirroot .= '/';

}

$oldlength = strlen($this->dirroot);

$foobar = strpos($this->libjsdir, $this->dirroot);

if (!($foobar === false || $foobar != 0)) {

$this->libjsdir = $dirroot . substr($this->libjsdir, $oldlength);

}

$foobar = strpos($this->imgdir, $this->dirroot);

if (!($foobar === false || $foobar != 0)) {

$this->imgdir = $dirroot . substr($this->imgdir, $oldlength);

}

$foobar = strpos($this->icondir, $this->dirroot);

if (!($foobar === false || $foobar != 0)) {

$this->icondir = $dirroot . substr($this->icondir, $oldlength);

}

$foobar = strpos($this->tpldir, $this->dirroot);

if (!($foobar === false || $foobar != 0)) {

$this->tpldir = $dirroot . substr($this->tpldir, $oldlength);

}

$this->dirroot = $dirroot;

return true;

}

Link to comment
Share on other sites

Many Thanks Jim,

 

The examples on the page you linked to are easy enough to follow but where it fits into my site is a bit much for me really. Ive waded through dm_categories.php for about an hour and I cant work out which bit defines the category name.

It's retrieved by the SQL query (lines 298-308 in the copy I have.) You could modify the result in line 311:

 

      $table[$row['parent_id']][$row['categories_id']] = $row['categories_name'];

change to

 

      $table[$row['parent_id']][$row['categories_id']] = wordwrap($row['categories_name'], 30, "<br>\n", true);

or something like that. I'm doing this from memory, and that code is untested, so beware of bugs.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

HI,

 

I am having troubles with the Dyamenu in the os commerce site I am developing. All working fine except the positioning of the submenus seems to be way off, to the right even with variables set to 0,

 

I have the os commerce site inside a container and think this may be the issue as the submenu's are in the correct position when I remove the container.

 

take a look

 

www.collectables.ie/catalog

 

andy advice would be greatly appreciated !!

 

Thanks

 

Liam

Link to comment
Share on other sites

Hi,

Does anybody know where I can download the latest version of Dynamenu? The latest download is just a text file and the only download which looks like the full version is the last one (right at the bottom). Do I have to install that one, then download all the others to fix bugs (there quite a few now)?

Or is there a 'complete' one with all the necessary bugs fixed?

 

Thanks in advance

Link to comment
Share on other sites

Really like the looks of your site does this take a lot of PHP coding to the out of the box stuff you get with the

normal osCommerce install? I'm just starting out and was actually looking for examples of subscription type stores with not much luck. I've started by using the admin tool to createsome sort of catalog but it looks very generic after looking at yours.

Thanks for the reply - if you page back a bit, you'll see my discussions of what I've tried - beginning with my first effort at a stripped-down install, continuing with various other experiments, including illustrative screen captures.

 

Though the method I'm working with right now is only one of various that succeeded within the limitations I describe (no flyout on second vertical menu), and not necessarily the cleanest, I've left it as is pending a serious effort to fix the problem. I have looked athrough the PostNuke stuff and also at the developer documentation, which it least got me as far as putting up the second menu and using a text file to provide links, but which nowhere provided a precise example I could work from.

 

I have re-named the second menu, and have tried various experiments involving the libraries and alternate naming conventions.

 

You can view what I've done at CK MacLeod Collectibles at ckmac.com. Moved from the prior "catalog" directory to "root" in preparation for our opening any minute now. Home page has the menus centrally located, subsequent pages (still being last-min designed) will have the second menu in right or left column.

 

Thanks in advance - and thanks again for the original contribution: if I didn't like this menu A LOT, I wouldn't be working with it at 75% effectiveness.

 

Colin

 

(By the way, on the off-chance you're interested in this kind of thing I'm selling, I'm very favorable to giving discounts to developers whose contributions I've used. I hope it's not improper to making the offer here. And feel free to e-mail me directly.)

Link to comment
Share on other sites

Hello all,

 

I've some weird bug,

 

Horizontal dropdown in a box works:

	$menu_type = 0;
$show_dmcats_as_box = true;	

 

this works, fly-out works:

	$menu_type = 1;
$show_dmcats_as_box = false;	

 

But this doesn't, no drop-down showing:

	$menu_type = 0;
$show_dmcats_as_box = false;	

 

Working with [Dynamenu (May 27, 2006) and STSv4.5.8], from Bill Kelum on a clean install,

and with the STS fix from jbennette 27 Mar 2009.

 

Tried searching this forum, probably missed the solution. :(

Link to comment
Share on other sites

Haven't come across this issue before - but my first question would be whether or not you have any code setup to show in the $before_nobox_html = ''; $after_nobox_html = ''; section of dm_categories.php

 

Hello all,

 

I've some weird bug,

 

Horizontal dropdown in a box works:

	$menu_type = 0;
$show_dmcats_as_box = true;	

 

this works, fly-out works:

	$menu_type = 1;
$show_dmcats_as_box = false;	

 

But this doesn't, no drop-down showing:

	$menu_type = 0;
$show_dmcats_as_box = false;	

 

Working with [Dynamenu (May 27, 2006) and STSv4.5.8], from Bill Kelum on a clean install,

and with the STS fix from jbennette 27 Mar 2009.

 

Tried searching this forum, probably missed the solution. :(

~Tracy
 

Link to comment
Share on other sites

hi all

 

dynamenu is great thanks

 

please can someone help me with the CSS sheet template for i would like to put the menu in this format, i understand CSS and use dreamweaver

 

the problem i have got i can't get the lines to betwen the boxed to show up as per photo

menu-clip.jpg

 

please can someone help with the template layout andd show me how to get started

 

all the best

All the best

&

Kind Regards

 

Richard Armstrong AKA Ciscoeuk

 

all help greatly apprecated

Link to comment
Share on other sites

I think what you need to look at is the CSS for the dynamenu (if I'm understanding what you want to do correctly). You can edit the CSS in dreamweaver if you like. I think you want to set your border (for a line between the boxes it is actually just the outside line of one of the boxes). Hope that helps.

 

hi all

 

dynamenu is great thanks

 

please can someone help me with the CSS sheet template for i would like to put the menu in this format, i understand CSS and use dreamweaver

 

the problem i have got i can't get the lines to betwen the boxed to show up as per photo

menu-clip.jpg

 

please can someone help with the template layout andd show me how to get started

 

all the best

~Tracy
 

Link to comment
Share on other sites

  • 3 weeks later...

Hi there,

 

First of all thanks for this contrib, it's one of the best in oscommerce IMHO.

 

I'd like to create a Vertical fly-out Menu as shown on this site: http://www.wolff-blockhaus.de/

It's a mix between the VertMenu and the TreeMenu menu-types from the Dynamenu contribution: the first level categories are shown as "headers", the second level categeries are shown as well (or "expanded" as in the TreeMenu) below the "headers". Any further levels are supposed to "fly-out" in a recursive manner, just as in the VertMenu.

 

I've taken a look at the code and it doesn't seem to be a simple matter to create such a "mixed" menu-type from the already defined TreeMenu and VertMenu types.

 

Any hints or tips how this could be achieved are greatly appreciated.

 

Thanks in advance!

Link to comment
Share on other sites

  • 2 weeks later...

I've hit a challenge I'm not sure I can figure out - LOL

 

I helped with creating the "Product in Dynamenu" contribution add-on - but I can't seem to find how to setup the "split menu" type feature in the products listing. It is a sub menu - but it doesn't seem to work to just split the sub menus, I think I need to change something in the addition of the products as sub menus. Any thoughts on how to do this?

~Tracy
 

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