Need 3 MYSQL Menus on one page

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Sivaeb
Beginner
Beginner
Posts: 7
Joined: Sat Dec 12, 2009 5:01 pm

Need 3 MYSQL Menus on one page

Post by Sivaeb »

I was looking at the use of menus in Header, Right and Left columns of three column page. But have not figured out how to use the Verticals and have header and left menus repeat the same data while the right is different. Can this be done?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Need 3 MYSQL Menus on one page

Post by Ruth »

Yes, it can. Unfortunately, I don't do data base menus, however, I can tell you how to set up 3 different menus on one page from the same file. With Milonic menu, you can create a main menu just by putting in alwaysvisible=1; Given that you said, columns, I have to assume you are placing each of these menus in a div, so you'd put the horizontal main menu in the header div, the vertical left menu in the left div and the vertical right menu in the right div. These menus would need to have their own names, and be set to alwaysvisible, and also to position="relative"; if you are putting them in the divs. If you are setting them absolutely based on the top and left positions, then you can just set them to alwaysvisible=1; top=whatever; left=whatever; and so on. At the top of this help forum there is a post for how to place menus relatively.

Hope this helps

Ruth
Sivaeb
Beginner
Beginner
Posts: 7
Joined: Sat Dec 12, 2009 5:01 pm

Re: Need 3 MYSQL Menus on one page

Post by Sivaeb »

Thanks Ruth. I was about to give up but found that turning off the orientation with a 0 in the Database did the Vertical Menu and a 1 the Horizontal. I will play a little more before purchase but am happy so far. I just need to figure out the Right to left submenu Placements for the right column.
Sivaeb
Beginner
Beginner
Posts: 7
Joined: Sat Dec 12, 2009 5:01 pm

Re: Need 3 MYSQL Menus on one page

Post by Sivaeb »

By the way I used to live in Grand Terrace Riverside and Colton. But I am in Oregon now.
Sivaeb
Beginner
Beginner
Posts: 7
Joined: Sat Dec 12, 2009 5:01 pm

Re: Need 3 MYSQL Menus on one page

Post by Sivaeb »

Hey Ruth can you put a shout out to Andy. I am having problems with the Right To Left setup for Php/Mysql set up. Thanks Robert
Sivaeb
Beginner
Beginner
Posts: 7
Joined: Sat Dec 12, 2009 5:01 pm

Re: Need 3 MYSQL Menus on one page

Post by Sivaeb »

Got the right to left figured out but can not get my head around displaying multiple menus from Mysql database. TABLE/DIV - RELATIVE Positioned Menus - read before posting
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Need 3 MYSQL Menus on one page

Post by Ruth »

Hi,

I've posted this to Milonic, since I don't even know how to display one menu from a database, I can't help you on displaying more than one. Andy is usually pretty quick with an answer.

Ruth
Sivaeb
Beginner
Beginner
Posts: 7
Joined: Sat Dec 12, 2009 5:01 pm

Re: Need 3 MYSQL Menus on one page

Post by Sivaeb »

Thanks Ruth, I am only a peon just beginning to delve into this world of PHP and Mysql and Java Script. But Andy has put together some wonderful code to do a lot with so little. Robert
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Re: Need 3 MYSQL Menus on one page

Post by Andy »

Hi,

In order to create multiple menus; it should just be a matter of adding more menus to the project and set each main menus alwaysvisible flag to true

Please note that ANY menu, style or menu item variable can be added to the database tables. Let's say you wanted to add a property of position to the database to set the menus position to "relative" you would add a field called position to the menu table and then populate it - The menu should be smart enough to see it and use it.

HTH,
Andy
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Re: Need 3 MYSQL Menus on one page

Post by Andy »

Does this helps:

Code: Select all

<html>
<head>
<title>Milonic DHTML Menu from MySQL Database using PHP Functions</title>
<head>
<body>

<?php

	include("mm_config.php");  // This file contains all of the user editable parameters
	include("mm_phpmenu.php"); // This is the file containing all of the PHP functions

	buildMySQLMenu(1); // This line builds the menu from MySQL data tables.

?>
<br><br><br><br>

<table border=1>
	<tr>
		<td>
			<?php 
				buildMySQLMenu(2); // This line builds the menu from MySQL data tables.
			?>
		</td>
	</tr>
</table>
</body>
</html>


Here is the data:

Code: Select all

-- phpMyAdmin SQL Dump
-- version 3.2.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 05, 2010 at 11:24 AM
-- Server version: 5.1.39
-- PHP Version: 5.3.0

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `mysql_menu`
--

-- --------------------------------------------------------

--
-- Table structure for table `mm_items`
--

CREATE TABLE IF NOT EXISTS `mm_items` (
  `itemid` int(11) NOT NULL AUTO_INCREMENT,
  `menuid` int(11) NOT NULL DEFAULT '0',
  `text` text,
  `url` varchar(255) DEFAULT NULL,
  `showmenu` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`itemid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=53 ;

--
-- Dumping data for table `mm_items`
--

INSERT INTO `mm_items` (`itemid`, `menuid`, `text`, `url`, `showmenu`) VALUES
(1, 1, 'MILONIC', 'http://www.milonic.com', NULL),
(2, 1, 'Sample Menus', NULL, 'Menu Samples'),
(3, 1, 'About Milonic', NULL, 'About Milonic'),
(4, 1, 'Partners', NULL, 'Partners'),
(5, 1, 'Links', NULL, 'Links'),
(6, 2, 'Horizontal Navigational Menu', NULL, NULL),
(7, 2, 'Vertical Navigational Menu', '/menusample2.php', NULL),
(8, 2, 'All Horizontal Menus', '/menusample25.php', NULL),
(9, 2, 'Using the popup function Fixed Position', '/menusample3.php', NULL),
(10, 2, 'Using the popup Positioned by Images', 'menusample24.php', NULL),
(11, 2, 'Image Map Sample', 'menusample4.php', NULL),
(12, 2, 'Multiple Styles', 'menusample5.php', NULL),
(13, 2, 'Menus and Tool Tips', 'menusample6.php', NULL),
(14, 2, 'Multiple Colored Menus', 'menusample7.php', NULL),
(15, 2, 'Menu Items as Headers', 'menusample8.php', NULL),
(16, 2, 'Windows XP Style Menus', 'menusample12.php', NULL),
(17, 2, 'Windows 98 Style Menus', 'menusample13.php', NULL),
(18, 2, 'Relative Positioning (Table Bound)', 'menusample9.php', NULL),
(19, 2, 'Follow Scrolling', 'menusample10.php', NULL),
(20, 2, 'Opening Windows & Frames', 'menusample11.php', NULL),
(21, 2, 'Hiding DIVs when displaying menus', 'menusample14.php', NULL),
(22, 2, 'Activating MouseOver & MouseOut Functions', 'menusample15.php', NULL),
(23, 2, 'Dynamic Dragable Menus', 'menusample22.php', NULL),
(24, 2, 'Positioning with screenposition & offsets', 'menusample23.php', NULL),
(25, 2, '100% Width Span Menu', 'menusample26.php', NULL),
(26, 2, 'Context Right Click Menu', 'menusample27.php', NULL),
(27, 2, 'Static Images Sample', 'menusample16.php', NULL),
(28, 2, 'Rollover/swap Images', 'menusample17.php', NULL),
(29, 2, 'Menus built from images', 'menusample18.php', NULL),
(30, 2, 'Images as Menu Backgrounds', 'menusample19.php', NULL),
(31, 2, 'Background Menu Item Images', 'menusample20.php', NULL),
(32, 3, 'Product Purchasing Page', 'http://www.milonic.com/cbuy.php', NULL),
(33, 3, 'Contact Us', 'http://www.milonic.com/contactus.php', NULL),
(34, 3, 'Newsletter Subscription', 'http://www.milonic.com/newsletter.php', NULL),
(35, 3, 'FAQ', 'http://www.milonic.com/menufaq.php', NULL),
(36, 3, 'Discussion Forum', 'http://www.milonic.com/forum/', NULL),
(37, 3, 'Software License Agreement', 'http://www.milonic.com/license.php', NULL),
(38, 3, 'Privacy Policy', 'http://www.milonic.com/privacy.php', NULL),
(39, 4, '(aq) Web Hosting', 'http://www.a-q.co.uk/', NULL),
(40, 4, 'SMS 2 Email', 'http://www.sms2email.com/', NULL),
(41, 4, 'WebSmith', 'http://www.websmith.com/', NULL),
(42, 5, 'Apache Web Server', 'http://www.apache.org/', NULL),
(43, 5, 'MySQL Database Server', 'http://ww.mysql.com/', NULL),
(44, 5, 'PHP - Development', 'http://www.php.net/', NULL),
(45, 5, 'phpBB Web Forum System', 'http://www.phpbb.net/', NULL),
(46, 5, 'Anti Spam Tools', '', 'antispam'),
(47, 6, 'Spam Cop', 'http://www.spamcop.net/', NULL),
(48, 6, 'Mime Defang', 'http://www.mimedefang.org/', NULL),
(49, 6, 'Spam Assassin', 'http://www.spamassassin.org/', NULL),
(50, 7, 'Menu 2 Main Item 1', NULL, 'sub 2'),
(51, 8, 'Menu 2 - Sub Menu 1 - Item 1', NULL, NULL),
(52, 9, 'test', NULL, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `mm_menus`
--

CREATE TABLE IF NOT EXISTS `mm_menus` (
  `menuid` int(11) NOT NULL AUTO_INCREMENT,
  `projectid` int(11) NOT NULL DEFAULT '0',
  `styleid` int(11) NOT NULL DEFAULT '0',
  `name` varchar(40) NOT NULL DEFAULT '',
  `alwaysvisible` tinyint(1) DEFAULT NULL,
  `orientation` tinyint(1) DEFAULT NULL,
  `overflow` varchar(20) DEFAULT NULL,
  `position` varchar(20) NOT NULL,
  PRIMARY KEY (`menuid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;

--
-- Dumping data for table `mm_menus`
--

INSERT INTO `mm_menus` (`menuid`, `projectid`, `styleid`, `name`, `alwaysvisible`, `orientation`, `overflow`, `position`) VALUES
(1, 1, 1, 'Main Menu', 1, 1, NULL, ''),
(2, 1, 1, 'Menu Samples', NULL, NULL, 'scroll', ''),
(3, 1, 1, 'About Milonic', NULL, NULL, NULL, ''),
(4, 1, 1, 'Partners', NULL, NULL, NULL, ''),
(5, 1, 1, 'Links', NULL, NULL, NULL, ''),
(6, 1, 1, 'AntiSpam', NULL, NULL, NULL, ''),
(7, 2, 1, 'Main menu 2', 1, 1, NULL, 'relative'),
(8, 2, 1, 'sub 2', NULL, NULL, NULL, ''),
(9, 2, 1, 'sub 3', NULL, NULL, NULL, '');

-- --------------------------------------------------------

--
-- Table structure for table `mm_projects`
--

CREATE TABLE IF NOT EXISTS `mm_projects` (
  `projectid` int(11) NOT NULL AUTO_INCREMENT,
  `menuCloseDelay` int(11) NOT NULL DEFAULT '500',
  `menuOpenDelay` int(11) NOT NULL DEFAULT '150',
  `subOffsetTop` tinyint(1) NOT NULL DEFAULT '0',
  `subOffsetLeft` tinyint(1) NOT NULL DEFAULT '0',
  `name` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`projectid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `mm_projects`
--

INSERT INTO `mm_projects` (`projectid`, `menuCloseDelay`, `menuOpenDelay`, `subOffsetTop`, `subOffsetLeft`, `name`) VALUES
(1, 500, 150, 2, -3, 'Minimalist Menu'),
(2, 500, 150, 0, 0, 'Menu 2');

-- --------------------------------------------------------

--
-- Table structure for table `mm_styles`
--

CREATE TABLE IF NOT EXISTS `mm_styles` (
  `styleid` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(40) NOT NULL DEFAULT '',
  `oncolor` varchar(6) DEFAULT NULL,
  `onbgcolor` varchar(6) DEFAULT NULL,
  `offcolor` varchar(6) DEFAULT NULL,
  `offbgcolor` varchar(6) DEFAULT NULL,
  `padding` tinyint(4) DEFAULT NULL,
  `separatorsize` tinyint(4) DEFAULT NULL,
  `borderwidth` tinyint(4) DEFAULT NULL,
  `fontfamily` varchar(25) DEFAULT NULL,
  `fontsize` varchar(6) DEFAULT NULL,
  PRIMARY KEY (`styleid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `mm_styles`
--

INSERT INTO `mm_styles` (`styleid`, `name`, `oncolor`, `onbgcolor`, `offcolor`, `offbgcolor`, `padding`, `separatorsize`, `borderwidth`, `fontfamily`, `fontsize`) VALUES
(1, 'miniStyle', 'FFFFFF', '4F8EB6', '000000', 'FFFFFF', 3, 1, 1, 'verdana', '10px');
Basically, you create a new project record and then attach the menus and menu items to the project.

HTH,
Andy
Post Reply