WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
I am using Deluxe Menu to create an XP Style Tree menu.Can anybody please help me... I realy dont know how to populate the menu from the documents created on the site... I got my own template up and running. My static menu is also working fine...I am trying to get the menu to populate itself like the show_menu2 module.....I am new to PhP and just need to get shown a direction in what I should do or what I should look up to get an answer...PLEASE CAN ANYBODY HELP!!!!
I am using Deluxe Menu to create an XP Style Tree menu.Can anybody please help me... I realy dont know how to populate the menu from the documents created on the site... I got my own template up and running. My static menu is also working fine...I am trying to get the menu to populate itself like the show_menu2 module.....
<?php/*** @version 0.2.0* @date 2008-08-13* @author StefanRSA* @package WebsiteBaker - Module : <no name>* @state @dev***/function getMenuItems() { $jsItems = ''; /** * Select all records from table "menuTable" */ $connection = mysql_connect('localhost','website','website') or die ('No Connection!'); mysql_select_db('wb') or die ('Unable to connect to DB!'); $allItems = mysql_query('SELECT page_title, page_id, parent, level, menu_title, link FROM pages;'); /** * Extract items data from database and build Javascript code for menuItems */ $menuSub=array(); while ($itemData = mysql_fetch_array($allItems)) { if($itemData['page_title']=='PRODUCT DETAIL') { /** * dropdown menu title */ $menuTop[$itemData['page_id']]='["'.$itemData['menu_title'].'","","","","","","","1","",""]'; } elseif ( $itemData['level']==0) { /** * top level menu item */ $menuTop[$itemData['page_id']]='["'.$itemData['menu_title'].'","'.'http://newhost.try/wb/pages'.$itemData['link'].'.php'.'","","","","","","1","",""]'; } elseif( $itemData['level']==1) { /** * sub level menu item */ $menuSub[$itemData['parent']][]="\t".'["|'.$itemData['menu_title'].'","'.'http://newhost.try/wb/pages'.$itemData['link'].'.php'.'","","","","","","0","",""]'; } } foreach( $menuTop AS $menuId=>$menuLinkTop){ $itemArr[]=$menuLinkTop; //add top-level links /** * check for sub menu */ if( array_key_exists($menuId,$menuSub)) { /** * add sub-menu links */ foreach($menuSub[$menuId] AS $menuLinkSub) $itemArr[]=$menuLinkSub; } } /** * join $itemArr together with ,'s and new lines */ $jsItems=implode(",\n",$itemArr); /** * Return Javascript code */ return $jsItems;}?>