Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Article Manager v1.0


RobAnderson

Recommended Posts

I have installed Article Manager v1.5 and there are no error messages but there is nothing showing in the admin section for Article Manager. I have double-checked everything and I haven't made any mistakes with the install, can anyone please help?

 

Regards,

 

 

 

Graham.

Link to comment
Share on other sites

Hi Guys

 

I have installed the contribution with the latest updates but im still having a problem.

 

I can't see any of the articles in my site.

 

I can add articles, authors & topics no problem in my admin section. I have also checked and all the info is in the database but it doesn't want to display on the web site.

 

Im using mySql5 and i have loaded the fixed files but still no luck.

 

Any ideas?

Link to comment
Share on other sites

Have you placed your articles inside topics? Articles that don't belong to any topic will not be shown. Do you have infoboxes for articles and authors in one of your column?

Link to comment
Share on other sites

Hi,

 

I have installed Article Manager 1.5 with admin and made the changes for mySQL 5 to fix some of the mistakes.

 

I now can NOT get the Cross-Sell Articles to Products in admin (page articles_xsell.php ) to work.

 

It shows the table, I click on Add / Remove by the article find which ones I want then click on the

Click here to sort the products associated with this article.

Note: this needs to be done every time a product is added or deleted.

 

And no products show up.

 

Any advise and guidence to get this to work would be great :)

 

Thank you for your time

Link to comment
Share on other sites

ok, I have found out that the data is not being written to the articles_xsell table as when I enter data in that table manually, it then will show articles linked.

 

Can someone help me to get this code to work?

Link to comment
Share on other sites

  • 2 weeks later...
ok, I have found out that the data is not being written to the articles_xsell table as when I enter data in that table manually, it then will show articles linked.

 

Can someone help me to get this code to work?

 

I have a somehwat-similar issue - the table gets updated however the only way I can delete the the links is to remove them from database... Also every time I browse the product category, try add/remove a new product... looks like it doubles the amount of product links. Has anyone experienced the similar behavior?

 

- Cheers,

Georgee

Link to comment
Share on other sites

New code for use with dynamic_sitemap.php

 

Simply add this to catalog/dynamic_sitemap.php where ever you want it to appear.

 

 

<?php

//ARTICLE MANAGER START

echo '<ul class="sitemap">';

echo '<li><a href="' . tep_href_link(FILENAME_ARTICLES, '',

 

'NONSSL') . '">' . BOX_ALL_ARTICLES . '</a></li>' . "";

$topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " .

 

TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)

 

$topic_links[$i] . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)

 

$languages_id . "' order by sort_order, td.topics_name");

if (tep_db_num_rows($topics_query) > 0) {

$row = 0;

while ($topics = tep_db_fetch_array($topics_query)) {

$row++;

echo '<li><a href="' . tep_href_link(FILENAME_ARTICLES, 'topics_id=' . $topics

 

['topics_id']) . '">' . $topics['topics_name'] . '</a></li>' . "";

}

}

echo '</ul>';

//ARTICLE MANAGER END

?>

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

Hi Guys

 

I have installed the contribution with the latest updates but im still having a problem.

 

I can't see any of the articles in my site.

 

I can add articles, authors & topics no problem in my admin section. I have also checked and all the info is in the database but it doesn't want to display on the web site.

 

Im using mySql5 and i have loaded the fixed files but still no luck.

 

Any ideas?

 

I have the same problem here. nothing appears on the site.

In the box left it tells me there are 2 articles ande they are in the database but when I click on it there is no articles showing.

Link to comment
Share on other sites

I have the same problem here. nothing appears on the site.

In the box left it tells me there are 2 articles ande they are in the database but when I click on it there is no articles showing.

Same problem here, install went fine, everything in the admin works, I create an article and on the front page it shows all the links, authors etc., but when I click on them it will not show the article. It will show everything else (such as top and bottom and left and right columns but just white space where the article is supposed to be.) Any ideas for this?

Link to comment
Share on other sites

Tell a Friend feature

 

I have installed the Tell a Friend for Non-Product Contrib. Does anyone else have this contrib installed and edited the php file so that it will work with the Article Manager Tell a Friend?

 

If so, can ypu post the edits that you did to make both contribs work?

 

Any answer on this?

 

I'm trying to figure this out now.

If you already have please let me know.

Edited by Dhananjaya

I have moved on from oscommerce to magento and no longer monitoring this site.

Link to comment
Share on other sites

  • 2 weeks later...

ok - here's my attempt at trying to make the Articles Manager menu the same as the dynamenu. i'v replaced all category instances with topic instances.

 

it works, sorta..... its displaying both menu's - but the menu behaviour is completely whack now.

 

example - if i click on an Article category - it opens up - but it also opens up the Products category, most categories on either wont open at all - so it seems like its opening up the categories with same ID - even though they use different id names in both files.

 

can anyone please help me with this - tell me what i am doing wrong?

 

pls - i'm not a developer - but i am trying... :blush:

 

<?php
/*
 $Id: dm_categories.php,v 1.00 2006/05/07 01:13:58 nate_02631 Exp $

 Ties the store category menu into the PHP Layers Menu library, allowing display
of categories as DTHML drop-down or fly-out menus, collapsable tree-style menus
or horizontal/vertical indented plain menus.

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2006 Nate Welch [url="http://www.natewelch.com"]http://www.natewelch.com[/url]

 Released under the GNU General Public License
*/

// BEGIN Configuration Options

 // Set the value below corresponding to the type of menu you want to render
// 0 = Horizontal Drop-down; 1 = Vertical Flyout; 2 = Tree Menu;
// 3 = Plain Horizontal Menu; 4 = Plain Vertical Menu
// Include the appropriate stylesheet in your store stylesheet, and if rendering
// types '0' or '1', you must also echo (output) the "menu footer" variable
// in your store footer as described in the readme (or submenus won't work)
$menu_type = 2;

 // Set to false to display the menu output only. Set to true to display in
// a regular box. The former is useful for better integrating the menu with your layout.
$show_dmart_as_box = true;				

 // Set to 'true' to assign TITLE tags to each of the menu's items, 'false' to leave blank
$menu_use_titles = true;	

 // Name of the icon file to be used preceding menu items. Leave blank for no icons.
// NOTE: Does not apply to plain style menus. Icon should be in the /images directory
$menu_icon_file = '';

// Width and height of icons used in menus (does not apply to plain menus).
$menu_icon_width = 16;
$menu_icon_height = 16;

 // Set the graphic to be used for the forward arrow and down arrow images used in 
// drop-down and fly-out menus. Images must reside in your catalog's /images directory
$menu_fwdarrowimg  = 'forward-arrow.png';		
 $menu_downarrowimg = 'down-arrow.png';		

// 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,
// more suitable for plain-style menus 
$show_full_tree = true;		

// For tree menus, set to true to have only nodes corresponding to the current category path
// expanded. If set to false, the tree menu will retain expanded/collapse nodes the user has
// selected (as well as expanding any for categories they've entered)
$menu_tree_current_path = true;				

 // Set the three numerical values below to adjust the offset of submenus in
 // horizontal drop-down and vertical fly-out menus. Values adjust the following (in order)
 // Top Offset: # of pixels from top border of previous menu the submenu appears
 // Right Offset: # of pixels from right border of previous menu the submenu appears
 // Left Offset: # of pixels from left border of previous menu the submenu appears
 // if the submenu pops to left (i.e. if window border is reached).  Negative values are allowed.
 $menu_layer_offset = array (0,4,4);	

// Show icons on tree menus? If set to false, only expand/collapse icons and connecting lines are shown
$GLOBALS['dm_tree_folder_icons'] = true;

// This is the HTML that you would like to appear before/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.	For example if not including in a box in the
// default osC template, you would need opening/closing <tr><td> tags...
$before_nobox_html = '';
 $after_nobox_html = '';

// Use this option if you have a *lot* of subcategories in a DHTML style menu and your
// submenus won't fit on the page.  Set $divide_subarts to the max # of subcategories you want
// 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_subarts = 0;	

// 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_subarts_text = 'more...';	

// 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_dmart_as_box) {
   echo '<tr><td>';
   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_ARTICLES);
   new infoBoxHeading($info_box_contents, true, false);					
}

// Generate the menu data output (uses configuration options above)
$articles_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($articles_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();
       $articles_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();
       $articles_menu = $mid->getMenu('artmenu');
			$GLOBALS['dmfooter'] = $mid->getFooter();												
       break;
   case 2:  // Tree menu
	    $articles_menu = $mid->newTreeMenu('artmenu');
       break;
   case 3:  // Horizontal plain menu
       $mid->setPlainMenuTpl('layersmenu-horizontal_plain_menu.ihtml');		
       $articles_menu = $mid->newHorizontalPlainMenu('artmenu');							
       break;
   case 4:  // Vertical plain menu
       $mid->setPlainMenuTpl('layersmenu-plain_menu.ihtml');		
       $articles_menu = $mid->newPlainMenu('artmenu');						
       break;	 	 
}	
// Output list inside a box if specified, otherwise just output unordered list
if ($show_dmart_as_box) {
   $info_box_contents = array();
   $info_box_contents[] = array('text' => $articles_menu);
   new infoBox($info_box_contents);
	echo '</td></tr>';	
} else {
	echo $before_nobox_html;	
   echo $articles_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_subarts, $divide_subarts_text;

	$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_ARTICLE_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_subcat_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_subcat_count = 1;
					$lvl_adjust ++;
			}

       $output .= str_repeat(".", $level+$lvl_adjust).'|'.$val.'|'.tep_href_link(FILENAME_DEFAULT, $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;
}	

?>

Link to comment
Share on other sites

I hope someone can help me with something. I installed Articles v1.5_1 today. And any page that has anything to do with articles is wreaking havoc with my infoboxes in column_left.php. I don't use column_right.

 

This is what the shopping cart and categories boxes look like in every other page of my website.

 

normalbox.gif

 

When I go to mysite.com/articles.php, it's centering the text in every single one of my infoboxes, like this:

 

articlesbox.gif

 

If you notice, it's also moving the breadcrumb trail in the header navigation to the center, as well. ???

 

And I don't know what that funky little black line is next to the end of the header navigation bar.

 

What file is doing this and how do I fix it? I have this installed in a test site, as well, and I did create an article there and the article results are all centered onscreen, too. Looks like this thing is just...centering everything, period. How to correct it?

Link to comment
Share on other sites

Hi,

as far as i can remember, I had similar issue which I fixed by replacing the following on every php file that comes with the articles package

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

 

with

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

 

You can see it in action: http://www.petsready.com

 

Cheers,

George

 

I hope someone can help me with something. I installed Articles v1.5_1 today. And any page that has anything to do with articles is wreaking havoc with my infoboxes in column_left.php. I don't use column_right.

 

This is what the shopping cart and categories boxes look like in every other page of my website.

 

normalbox.gif

 

When I go to mysite.com/articles.php, it's centering the text in every single one of my infoboxes, like this:

 

articlesbox.gif

 

If you notice, it's also moving the breadcrumb trail in the header navigation to the center, as well. ???

 

And I don't know what that funky little black line is next to the end of the header navigation bar.

 

What file is doing this and how do I fix it? I have this installed in a test site, as well, and I did create an article there and the article results are all centered onscreen, too. Looks like this thing is just...centering everything, period. How to correct it?

Link to comment
Share on other sites

Thank You very much, George!

 

Actually, I've been messing around with catalog>stylesheet.css and managed to straighten out my infoboxes and the header navigation bar by inserting a simple little:

 

text-align: left;

 

into .infoboxContents and TR.headernavigation

 

I just did what you suggested for one file, catalog>articles.php and now everything is appearing the way I want it to on that page. It's late and I'm tired, but I will make that edit to all of those new files tomorrow.

 

I've been sitting here thinking....I really shouldn't HAVE to do this, should I? Make edits in the stylesheet? I never saw anything like this happen before with the other contribs I've installed. No contrib should be reorganizing the way my infoboxes and my header navigation appear onscreen, should they? Nothing ever did before this.

 

I dunno...I don't like this business of files in the contrib being linked to some other website. I've never seen anything like it. Thank You again for posting!

Link to comment
Share on other sites

Um.. hope you figured it out by now.. but did you actually add that article to a topic? if its outside a topic.. I dont think it will appear anywhere but the admin console

 

 

Cheers,

George

 

Same problem here, install went fine, everything in the admin works, I create an article and on the front page it shows all the links, authors etc., but when I click on them it will not show the article. It will show everything else (such as top and bottom and left and right columns but just white space where the article is supposed to be.) Any ideas for this?
Link to comment
Share on other sites

Anyone has an infoblock which would list latest articles from predefined topics with a short description for each article?

 

Thnx,

George

Edited by georgec
Link to comment
Share on other sites

i wonder why we dont have a infobox with a tree menu of topic and articles

 

also i dont understand why we dont make a hack of the categories/products way of working in osc

and jsut duplicate all php file and tables renaming the word and variable of categories end products to topices and articles for instance

then all infobox would be usable jsut changing the same way the call to tables and variable names

MS2

Link to comment
Share on other sites

I haven't created any new articles in my 'live' site, yet. I was too busy trying to figure out what was going on with the text formatting problem here, there and everywhere.

 

I did install this in my 'test' site today, and my article...underneath a created topic, is showing just fine. Just...the formatting issue.

 

When I look at this:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

 

Is that actually linking my website to something else?

Link to comment
Share on other sites

i wonder why we dont have a infobox with a tree menu of topic and articles

 

also i dont understand why we dont make a hack of the categories/products way of working in osc

and jsut duplicate all php file and tables renaming the word and variable of categories end products to topices and articles for instance

then all infobox would be usable jsut changing the same way the call to tables and variable names

 

 

Um.. I think that's what it is in its core... and it works great!

Link to comment
Share on other sites

Hi Guys,

 

Just wondering how the best way to go about changing the article listing, at the minute it displays as such:

 

Article Name by: Article Author Topic: My Topics

 

I was wondering if anyone has tackled article manager to make it look similar to say a knowledge base where the topic categories are listed with the number of articles in brackets and couple of articles underneath the topic name.

 

Maybe this already works out of the box and I am just blind lol

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

i saw someone asking for the menu in Tree style - well - i'm trying to get it to work DynaMenu style - i'v adapted the DynaMenu code to pull the topics navigation - and it works - it pulls it out - builds it right - but when you click on the topic link it does not open up the topic.

i dont know how to get it to work - i'm not a developer - i tried though.... maybe someone else can get it to work?

 

<?php
/*
 $Id: dm_categories.php,v 1.00 2006/05/07 01:13:58 nate_02631 Exp $

 Ties the store category menu into the PHP Layers Menu library, allowing display
of categories as DTHML drop-down or fly-out menus, collapsable tree-style menus
or horizontal/vertical indented plain menus.

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2006 Nate Welch [url="http://www.natewelch.com"]http://www.natewelch.com[/url]

 Released under the GNU General Public License
*/

// BEGIN Configuration Options

 // Set the value below corresponding to the type of menu you want to render
// 0 = Horizontal Drop-down; 1 = Vertical Flyout; 2 = Tree Menu;
// 3 = Plain Horizontal Menu; 4 = Plain Vertical Menu
// Include the appropriate stylesheet in your store stylesheet, and if rendering
// types '0' or '1', you must also echo (output) the "menu footer" variable
// in your store footer as described in the readme (or submenus won't work)
$menu_type = 2;

 // Set to false to display the menu output only. Set to true to display in
// a regular box. The former is useful for better integrating the menu with your layout.
$show_dmart_as_box = true;				

 // Set to 'true' to assign TITLE tags to each of the menu's items, 'false' to leave blank
$menu_use_titles = true;	

 // Name of the icon file to be used preceding menu items. Leave blank for no icons.
// NOTE: Does not apply to plain style menus. Icon should be in the /images directory
$menu_icon_file = '';

// Width and height of icons used in menus (does not apply to plain menus).
$menu_icon_width = 16;
$menu_icon_height = 16;

 // Set the graphic to be used for the forward arrow and down arrow images used in 
// drop-down and fly-out menus. Images must reside in your catalog's /images directory
$menu_fwdarrowimg  = 'forward-arrow.png';		
 $menu_downarrowimg = 'down-arrow.png';		

// 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,
// more suitable for plain-style menus 
$show_full_tree = true;		

// For tree menus, set to true to have only nodes corresponding to the current category path
// expanded. If set to false, the tree menu will retain expanded/collapse nodes the user has
// selected (as well as expanding any for categories they've entered)
$menu_tree_current_path = true;				

 // Set the three numerical values below to adjust the offset of submenus in
 // horizontal drop-down and vertical fly-out menus. Values adjust the following (in order)
 // Top Offset: # of pixels from top border of previous menu the submenu appears
 // Right Offset: # of pixels from right border of previous menu the submenu appears
 // Left Offset: # of pixels from left border of previous menu the submenu appears
 // if the submenu pops to left (i.e. if window border is reached).  Negative values are allowed.
 $menu_layer_offset = array (0,4,4);	

// Show icons on tree menus? If set to false, only expand/collapse icons and connecting lines are shown
$GLOBALS['dm_tree_folder_icons'] = true;

// This is the HTML that you would like to appear before/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.	For example if not including in a box in the
// default osC template, you would need opening/closing <tr><td> tags...
$before_nobox_html = '';
 $after_nobox_html = '';

// Use this option if you have a *lot* of subcategories in a DHTML style menu and your
// submenus won't fit on the page.  Set $divide_subarts to the max # of subcategories you want
// 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_subarts = 0;	

// 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_subarts_text = 'more...';	

// 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_dmart_as_box) {
   echo '<tr><td>';
   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_ARTICLES);
   new infoBoxHeading($info_box_contents, true, false);					
}

// Generate the menu data output (uses configuration options above)
$articles_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($articles_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();
       $articles_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();
       $articles_menu = $mid->getMenu('artmenu');
			$GLOBALS['dmfooter'] = $mid->getFooter();												
       break;
   case 2:  // Tree menu
	    $articles_menu = $mid->newTreeMenu('artmenu');
       break;
   case 3:  // Horizontal plain menu
       $mid->setPlainMenuTpl('layersmenu-horizontal_plain_menu.ihtml');		
       $articles_menu = $mid->newHorizontalPlainMenu('artmenu');							
       break;
   case 4:  // Vertical plain menu
       $mid->setPlainMenuTpl('layersmenu-plain_menu.ihtml');		
       $articles_menu = $mid->newPlainMenu('artmenu');						
       break;	 	 
}	
// Output list inside a box if specified, otherwise just output unordered list
if ($show_dmart_as_box) {
   $info_box_contents = array();
   $info_box_contents[] = array('text' => $articles_menu);
   new infoBox($info_box_contents);
	echo '</td></tr>';	
} else {
	echo $before_nobox_html;	
   echo $articles_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_subarts, $divide_subarts_text;

	$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_ARTICLE_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_subcat_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_subcat_count = 1;
					$lvl_adjust ++;
			}

       $output .= str_repeat(".", $level+$lvl_adjust).'|'.$val.'|'.tep_href_link(FILENAME_DEFAULT, $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;
}	

?>

Link to comment
Share on other sites

phalen for the dynameny box :

 

- the name of topic are well shown

but as for the link if it can give some clue the link for the same topic in old menu box and dynamenu are really not hte sames:

 

 

i did a comparaison of the categories dynamenu code and your code and all seems logical except that categories use the index.php file that as specific functions within

taht is maybe not the case of article_info.php

 

hope it can give you ideas :blush:

 

if found the line that make a call to the index instead of the article_info

 

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

n";

 

should be :

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

Edited by azer

MS2

Link to comment
Share on other sites

thanks azer - i'll give it a try and see if it works! really appreciate the help!

 

if this works i'll post the code on the contributions page with kudo's to u & ofcourse DynaMenu folks!

 

phalen for the dynameny box :

 

- the name of topic are well shown

but as for the link if it can give some clue the link for the same topic in old menu box and dynamenu are really not hte sames:

i did a comparaison of the categories dynamenu code and your code and all seems logical except that categories use the index.php file that as specific functions within

taht is maybe not the case of article_info.php

 

hope it can give you ideas :blush:

 

if found the line that make a call to the index instead of the article_info

 

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

n";

 

should be :

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

Link to comment
Share on other sites

ok - it works - i just had to change the article_info.php to articles.php - now when i click on the link it pulls the right page & info.

 

just the two menu's on the same page dont work well together.

 

you cant open the subs when both the categories & articles menu is on the same page. it almost functions like the standard osc navigation when both are running.

 

on its own, it works 100% - but running with categories dynamenu it doesnt.

 

any suggestions?

 

thanks azer - i'll give it a try and see if it works! really appreciate the help!

 

if this works i'll post the code on the contributions page with kudo's to u & ofcourse DynaMenu folks!

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