Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:29

Problems with PHP/MySQL menu


Poster: AnnA[FN]
Dated: Saturday May 8 2004 - 12:35:44 BST

Build dynamicly generated menu, based on PHP and MySQL. Got some interesting problems. Probabaly doing something wrong.

1) main file
<SCRIPT language=JavaScript src="../js/milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=../js/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=../js/mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="../templates/menu_data.php" type=text/javascript></SCRIPT>

2) menu_data.php
Include on the top (need for some functions i use later)
<? include('../include/inc_template.php'); ?>
Than definitions such as
_menuCloseDelay=200
_menuOpenDelay=150
_subOffsetTop=5
_subOffsetLeft=-10
...

after follows menu
with(milonic=new menuname("apdrtev")){
style=menuStyle;
overflow="scroll";
<?
$parent=getIDbyIntName('apdrtev');
$apdrtev=$sql->get_arr("select * from obj where parent='".$parent."' and status=1 and (lang=$lang or lang=0) and name<>'---separator---' and type=1 order by ord");
$cnt=$sql->count;
if($cnt!=0){
for($i=0;$i<$cnt;$i++){
echo 'aI("text='.$apdrtev[$i]['name'].';")';
}
}
?>
}

drawMenus();

My file after processing look like (seems without line brakes):
_menuCloseDelay=200 _menuOpenDelay=150 _subOffsetTop=5 _subOffsetLeft=-10 with(AllImagesStyle=new mm_style()){ bordercolor="#000000"; borderstyle="solid"; padding=0; fontstyle="normal"; fontweight="normal"; pointer="hand"; } with(menuStyle=new mm_style()){ onbgcolor="#0D55BB"; oncolor="#F9B700"; offbgcolor="#0D55BB"; offcolor="#FFFFFF"; bordercolor="#FFFFFF"; padding=2; fontstyle="normal"; fontfamily="Verdana, Tahoma, Arial"; separatorcolor="#FFFFFF"; separatorsize=1; fontsize=10; fontweight="bold"; } with(milonic=new menuname("apdrtev")){ style=menuStyle; overflow="scroll"; aI("text=Ģimenes apdrošināšana;")aI("text=Transporta apdrošināšana;")aI("text=Īpašuma apdrošināša;")aI("text=Civiltiesiskās atbildības apdrošināšana;")aI("text=Ceļojumu apdrošināšana;")aI("text=Veselības apdrošināšana;")aI("text=Apdrošināšana nelaimes gadījumiem;")aI("text=Dzīvības apdrošināšana;")} drawMenus();

But im getting some errors:
OnMouseOver - that _menuCloseDelay is undefined. And menu isnt showing.

If i cut out these 4 definitions after include and put these lines as simple javascript before *.js files in main.php, than error isnt showing, but menu still isnt showing.

Please, help with any clues.


Poster: Maz
Dated: Saturday May 8 2004 - 14:37:59 BST

Don't use the dots on your script paths for js, only the slash /
Does that solve it?

maz


Poster: AnnA[FN]
Dated: Monday May 10 2004 - 6:29:28 BST

Slashes I cant use. Switched to absolute URL. And all is OK.

Thanks for hint!