How to create an image based php mysql menu

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Grout31
Beginner
Beginner
Posts: 8
Joined: Fri Mar 27, 2009 9:34 pm

How to create an image based php mysql menu

Post by Grout31 »

Hello

I am trying to achieve an imaged based menu that is run purely from the mysql database. Is this possible and or has this been done before?

I have read and viewed the sample but it is only in javascript. I loaded the mini_menu.sql thinking it would give me the image sample, but alas i got the basic menu that comes with the download.

I have been able to change the background colours, font etc. But i am also trying to position the menu from within the database and again i cant see where this is done.

Basically i would like an image based menu 20px high and expands 100% screen width, all run from the mysql database.

Am i asking too much or do i need to do alot more learning?

Thanks in advance.

Steve
Grout31
Beginner
Beginner
Posts: 8
Joined: Fri Mar 27, 2009 9:34 pm

Re: How to create an image based php mysql menu

Post by Grout31 »

Is there no answer to this folks?

Has nobody tried this before?

Steve
Grout31
Beginner
Beginner
Posts: 8
Joined: Fri Mar 27, 2009 9:34 pm

Re: How to create an image based php mysql menu

Post by Grout31 »

Please, if this is not possible can someone at least let me know!!

I have asked a reasonable question i think, even if its a no you cant do it would suffice!!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: How to create an image based php mysql menu

Post by Ruth »

Hi,

Well, I just saw this post. I have to tell you up front I do not do anything with sql or data base, however....

I see that in the file called mini_menu.sql up at the top there is a note which says [as an example]

Code: Select all

# Note that if you want to add more menu style properties or menu item properties, just add them to the table.
# For instance, if you want to add tooltips. add a field called tooltips to the menuitems table. 
# It's up to you how you structure the fields, for tooltips we recomend field type TEXT but you could use 
# varchar(255) if the contents of your tooltips will never exceed 255 characters. This can be changed at any time 
# though using your MySQL admin tool
#
Now, there is something down farther called

Code: Select all

# Table structure for table `mm_styles`
and in that area you have a bunch of styles listed, i.e.

Code: Select all

`oncolor` varchar(6) default NULL,
  `onbgcolor` varchar(6) default NULL,
I am assuming that the varchar(6) has to do with how many spaces the color takes, i.e. ffffff etc. So, I would guess that if you wanted an offbgimage and onbgimage then you would add those properties to that mm_styles area. If you are asking about putting an image into each item, that is making each item its own image, then I have to figure you would put those image codes in the mm_items table structure. I would think you would have to add the a field called image, and if you wanted overimage a field for that also in this area

Code: Select all

CREATE TABLE `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`)
) TYPE=MyISAM AUTO_INCREMENT=50 ;
So to answer your question, yes as far as I know it can be done. I suggest that if you need help on this one, you post a question through the online support systems since I don't think that John knows about this type of set up either [but that's a guess] http://milonic.com/support/

:lol: most of this has been a 'guess'

I will also post to Milonic.

Ruth
Grout31
Beginner
Beginner
Posts: 8
Joined: Fri Mar 27, 2009 9:34 pm

Re: How to create an image based php mysql menu

Post by Grout31 »

Thankyou Ruth

I have managed to change the colours, add and remove menu items, but as far as i know you have to make a special database to imput images. Also i haven't found anywhere to change the position.

I look forward to see what Milonic have to say on this matter.

Thankyou again.

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

Re: How to create an image based php mysql menu

Post by Andy »

Have you tried adding the fields to the database and populating with data?

Basically, if you need a menu property that is not already in the database you just need to add the field (matching the menu property name) and add some data.

So, I guess as you want and image you need to add a field called "image" to the menuitems table and insert some data.

This also goes for all other properties whether it's the menustyle, menuitem or menu tables

HTH,
Andy
Grout31
Beginner
Beginner
Posts: 8
Joined: Fri Mar 27, 2009 9:34 pm

Re: How to create an image based php mysql menu

Post by Grout31 »

Thankyou Andy

I have added a image field and am drawing the files from that, i didnt know if some of the examples already had some examples. Doesn't matter as i can play with it to get it right.

I still haven't found a file or field to postion or reposition the menu, sorry am i being really stupid and missing something?

Thanks again

Steve
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: How to create an image based php mysql menu

Post by Ruth »

Hi,

The top and left position, or if you want to make it relative, i.e. position="relative"; these are menu properties. You can find the various properties of the program under the main menu on the the main Milonic site, mouse over the DHTML Menu item and go down to Menu Quick Reference Guides. You will see links for different things, 3 of them have to do with style, menu and item properties, going to those pages you will be able to see all the various properties that go into the various areas. Anyway, the top and left, and position things are menu properties so they would have to be placed in the Create Table, mm_menu area.

I think below my signature there are links to the different properties. Hope this helps. By the way, if you are placing the menu in a relative position, you need to read the info on that. There are links to that also.

Ruth
Post Reply