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: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Wednesday July 18 2012 - 06:07:28

Using PHP to configure the menu


Poster: Willy
Dated: Thursday August 8 2002 - 11:15:34 BST

Hi, i wonder if anyone could help me on that.
I tried to define some menus not in a .js file but using <SCRIPT></SCRIPT> in order to have it done by using PHP, but it seemed like it doesn't work in that way.

In fact, i made it easier and still got nothing :(
I'm trying to use two different .js
Code:
<SCRIPT LANGUAGE=JavaScript1.2 src="/izquierda.js" type=text/javascript></SCRIPT>
<SCRIPT LANGUAGE=JavaScript1.2 src="/menu_array.js" type=text/javascript></SCRIPT>
<SCRIPT LANGUAGE=JavaScript1.2 src="/mmenu.js" type=text/javascript></SCRIPT>

but only the menus defined in menu_array.js are showed, this is izquierda.js:
Code:
addmenu(menu=["secciona",,,90,1,,style3,,"left",effect1,0,0,,,,,,,,,,
,"Calendario","http://www.sportingdevallecas.es/seccion/a/resultados.shtml",,"Calendario de juego y resultados de la temporada en curso",0
,"Plantilla","http://www.sportingdevallecas.es/seccion/a/plantilla.shtml",,"Componentes de la plantilla en esta y otras temporadas",0
,"Historial","http://www.sportingdevallecas.es/seccion/a/historial.shtml",,"Resultados totales temporada a temporada",0
,"Estadísticas","javascript:ventana2(\"estadisticas\",\"a\",\"2001\")",,"Número de partidos jugados, goles, etc.",0
])

addmenu(menu=["seccionb",,,90,1,,style3,,"left",effect1,0,0,,,,,,,,,,
,"Calendario","http://www.sportingdevallecas.es/seccion/b/resultados.shtml",,"Calendario de juego y resultados de la temporada en curso",0
,"Plantilla","http://www.sportingdevallecas.es/seccion/b/plantilla.shtml",,"Componentes de la plantilla en esta y otras temporadas",0
,"Historial","http://www.sportingdevallecas.es/seccion/b/historial.shtml",,"Resultados totales temporada a temporada",0
,"Estadísticas","javascript:ventana2(\"estadisticas\",\"b\",\"2001\")",,"Número de partidos jugados, goles, etc.",0
])

addmenu(menu=["seccionc",,,90,1,,style3,,"left",effect1,0,0,,,,,,,,,,
,"Calendario","http://www.sportingdevallecas.es/seccion/c/resultados.shtml",,"Calendario de juego y resultados de la temporada en curso",0
,"Plantilla","http://www.sportingdevallecas.es/seccion/c/plantilla.shtml",,"Componentes de la plantilla en esta y otras temporadas",0
,"Historial","http://www.sportingdevallecas.es/seccion/c/historial.shtml",,"Resultados totales temporada a temporada",0
,"Estadísticas","javascript:ventana2(\"estadisticas\",\"c\",\"2001\")",,"Número de partidos jugados, goles, etc.",0
])

addmenu(menu=["secciond",,,90,1,,style3,,"left",effect1,0,0,,,,,,,,,,
,"Calendario","http://www.sportingdevallecas.es/seccion/d/resultados.shtml",,"Calendario de juego y resultados de la temporada en curso",0
,"Plantilla","http://www.sportingdevallecas.es/seccion/d/plantilla.shtml",,"Componentes de la plantilla en esta y otras temporadas",0
,"Resultados","http://www.sportingdevallecas.es/seccion/d/historial.shtml",,"Resultados totales temporada a temporada",0
,"Estadísticas","javascript:ventana2(\"estadisticas\",\"d\",\"2001\")",,"Número de partidos jugados, goles, etc.",0
])

addmenu(menu=["seccione",,,90,1,,style3,,"left",effect1,0,0,,,,,,,,,,
,"Calendario","http://www.sportingdevallecas.es/seccion/e/resultados.shtml",,"Calendario de juego y resultados de la temporada en curso",0
,"Plantilla","http://www.sportingdevallecas.es/seccion/e/plantilla.shtml",,"Componentes de la plantilla en esta y otras temporadas",0
,"Historial","http://www.sportingdevallecas.es/seccion/e/historial.shtml",,"Resultados totales temporada a temporada",0
,"Estadísticas","javascript:ventana2(\"estadisticas\",\"e\",\"2001\")",,"Número de partidos jugados, goles, etc.",0
])

addmenu(menu=["izquierda",160,120,130,,,style4,1,"left",,1,0,,,,,,,,,,
,"<img src=/imagenes/secciona.gif border=0 width=112 height=44>","show-menu=secciona","http://www.sportingdevallecas.es/seccion/a/index.shtml","Fútbol - 7 Senior masculino",0
,"<img src=/imagenes/seccionb.gif border=0 width=112 height=44>","show-menu=seccionb","http://www.sportingdevallecas.es/seccion/b/index.shtml","Fútbol - 7 Senior masculino",0
,"<img src=/imagenes/seccionc.gif border=0 width=112 height=44>","show-menu=seccionc","http://www.sportingdevallecas.es/seccion/c/index.shtml","Fútbol - 11 Cadetes masculino",0
,"<img src=/imagenes/secciond.gif border=0 width=112 height=44>","show-menu=secciond","http://www.sportingdevallecas.es/seccion/d/index.shtml","Baloncesto Senior femenino",0
,"<img src=/imagenes/seccione.gif border=0 width=112 height=44>","show-menu=seccione","http://www.sportingdevallecas.es/seccion/e/index.shtml","Hockey sobre patínes en línea Senior mixto (Federación madrileña)",0
])


dumpmenus()

any clues?


Poster: sacha
Dated: Monday September 9 2002 - 18:38:23 BST

Hi,

you can use the standard menu_array.js file, rename it into menu_array.php and add the following php-Code at the very top of the file:

<?php
header('Content-Type: text/javascript;charset=iso-8859-1');
?>

and then the rest of the script. Just replace the array values with your php-variables and include the file in your html page using:
<script language=javascript src="menu_array.php" type=text/javascript></script>

Maybe this makes things easier.

Ciao


Sacha