Simple Machines Community Forum

SMF Support => Español (Spanish) => Language Specific Support => Modificaciones (Mods) => Topic started by: davidhs on February 21, 2010, 02:11:50 PM

Title: MOD Menu without limit level
Post by: davidhs on February 21, 2010, 02:11:50 PM
Menu without limit level

ACERCA DE...

Menu without limit level, 3.0
Menú superior sin límite de niveles.
© 2010-2021 por davidhs

(https://creativecommons.org/licenses/by/3.0/deed.es_ES)
Esta obra está bajo una licencia de Creative Commons Reconocimiento 3.0 Unported (https://creativecommons.org/licenses/by/3.0/deed.es_ES).

DESCRIPCIÓN

Añade la posibilidad de que el menú superior del foro tenga cualquier número de niveles.

Modifica:

Además permite cambiar la estructura del menu en el panel de administración, utilizando código PHP.

EJEMPLO

Para crear este menú,
QuoteMenu multi-level

  • Submenu 1 - level 1

    • Submenu 1.1 - level 2

      • Submenu 1.1.1 - level 3
      • Submenu 1.1.2 - level 3
    • Submenu 1.2 - level 2

      • Submenu 1.2.1 - level 3
      • Submenu 1.2.2 - level 3
    • Submenu 1.3 - level 2
  • Submenu 2 - level 1

    • Submenu 2.1 - level 2
    • Submenu 2.1 - level 2

el código PHP es este:
$buttons2 = $buttons;
$buttons = array();
foreach ($buttons2 as $i => $b)
{
$buttons[$i] = $b;
if ('home' == $i)
{
$buttons['m0'] = array(
'title' => 'Menu multi-level',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm1' => array(
'title' => 'Submenu 1 - level 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm11' => array(
'title' => 'Submenu 1.1 - level 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm111' => array(
'title' => 'Submenu 1.1.1 - level 3',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm1111' => array(
'title' => 'Submenu 1.1.1.1 - level 4',
'href' => '',
'show' => true,
),
'm1112' => array(
'title' => 'Submenu 1.1.1.2 - level 4',
'href' => '',
'show' => true,
),
),
),
'm112' => array(
'title' => 'Submenu 1.1.2 - level 3',
'href' => '',
'show' => true,
),
),
),

'm12' => array(
'title' => 'Submenu 1.2 - level 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm121' => array(
'title' => 'Submenu 1.2.1 - level 3',
'href' => '',
'show' => true,
),
'm122' => array(
'title' => 'Submenu 1.2.2 - level 3',
'href' => '',
'show' => true,
),
),
),

'm13' => array(
'title' => 'Submenu 1.3 - level 2',
'href' => '',
'show' => true,
),
),
),

'm2' => array(
'title' => 'Submenu 2 - level 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm21' => array(
'title' => 'Submenu 2.1 - level 2',
'href' => '',
'show' => true,
),
'm22' => array(
'title' => 'Submenu 2.2 - level 2',
'href' => '',
'show' => true,
),
),
),

),
);

}
}


COMPATIBILIDAD SMF


IDIOMAS


DESCARGA

Enlace al MOD (https://custom.simplemachines.org/mods/index.php?mod=2454).

INSTALACIÓN MANUAL

Véase https://wiki.simplemachines.org/smf/Manual_installation_of_mods

COLABORA CON ESTE MOD

Esta obra está bajo una licencia de Creative Commons Reconocimiento 3.0 Unported (https://creativecommons.org/licenses/by/3.0/deed.es_ES).

Eres libre de compartir y adaptar este MOD. Además puedes colaborar de diversas formas:

REGISTRO DE CAMBIOS

Leyenda:   ! Corregido   + Añadido   - Eliminado   * Cambiado   @ Nota

3.0     17/02/2021
------------------
@ En versiones anteriores el menú se modificaba en un fichero (llamado Subs-MenuWithoutLimitLevel-Menu.php desde la versión 2.0, y con cualquier nombre en versiones anteriores). Ahora el menú se modifica desde el panel de administración. Debe copiar el contenido del fichero en el campo del panel, y eliminar el fichero.
+ Panel de administración.
+ Permite cambiar la estructura del menu en el panel de administración, utilizando código PHP.
+ La Búsqueda Rápida del Centro de Administración SMF busca en las variables de configuración del MOD.
+ SMF compatibility: 2.0.16-2.0.18 y 2.1 RC3.
+ Idiomas: english, english-utf8, english_british, english_british-utf8, spanish_es, spanish_es-utf8, spanish_latin, spanish_latin-utf8.

2.0.1   09/04/2019
------------------
+ Compatibilidad SMF: 2.1 RC1 a RC2.

2.0     20/12/2017
------------------
@ En versiones anteriores eran necesarios cambios manuales en el fichero Sources/Load.php. Ya no son necesarios y deben deshacerse.
@ En versiones anteriores el fichero PHP donde se modifica el menú podía tener cualquier nombre. Ahora tiene que llamarse Subs-MenuWithoutLimitLevel-Menu.php. Si existe con otro nombre debe renombrarse. Y la función tiene que llamarse mwllMenuButtons.
* Utiliza integration hooks.
+ Compatibilidad SMF: 2.0.8-2.0.15 y 2.1 Beta 3.

1.0.11  24/01/2014
------------------
! Error en el código fuente.
+ Compatibilidad SMF: 2.0.7.

1.0.10  24/10/2013
------------------
+ Compatibilidad SMF: 2.0.6.

1.0.9   18/08/2013
------------------
@ Esta obra está bajo una licencia de Creative Commons Reconocimiento 3.0 Unported https://creativecommons.org/licenses/by/3.0/deed.es_ES
+ Compatibilidad SMF: 2.0.5.

1.0.8   09/04/2013
------------------
+ Compatibilidad SMF: 2.0.4.
- Compatibilidad SMF: Soporte a las versiones RC.

1.0.7   22/12/2012
------------------
+ Compatibilidad SMF: 2.0.3.

1.0.6   24/12/2011
------------------
! Algunas modificaciones del index.css del tema no son necesarias.
+ Compatibilidad SMF: 2.0.2.

1.0.5   20/09/2011
------------------
+ Compatibilidad SMF: 2.0.1.

1.0.4   18/06/2011
------------------
+ Compatibilidad SMF: 2.0.

1.0.3   13/02/2011
------------------
+ Compatibilidad SMF: 2.0 RC5.

1.0.2   04/11/2010
------------------
+ Compatibilidad SMF: 2.0 RC4.

1.0.1   10/03/2010
------------------
! En 2.0 RC2, los niveles 4 en adelante se mostraban y ocultaban a la vez.
+ Compatibilidad SMF: 2.0 RC3.

1.0     08/03/2010
------------------
+ Compatibilidad SMF: 2.0 RC2.
+ Temas: default.
Title: Re: MOD MenuWithoutLimitLevel (Menú superior sin límite de niveles)
Post by: arielvissig on February 22, 2010, 06:45:28 AM
Exelente...podrias poder el parse por favor....

Y como se agregan submenus??

Gracias
Title: Re: MOD MenuWithoutLimitLevel (Menú superior sin límite de niveles)
Post by: davidhs on February 22, 2010, 01:01:57 PM
¿A qué te refieres con lo del "parse"?

Para añadir submenús edita el Sources/Subs.php donde se define el menú (función setupMenuContext()). Ahora puedes poner 'sub_buttons' => array() hasta cualquier nivel (antes también podías pero solo se mostraba el primer y segundo nivel.

P.ej para crear el menú:

Nivel 0

añade:

'menu0' => array(
'title' => 'Nivel 0',
'href' => '',
'show' => true,
'sub_buttons' => array(
'menu1' => array(
'title' => 'Nivel 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'menu11' => array(
'title' => 'Nivel 1.1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'menu111' => array(
'title' => 'Nivel 1.1.1',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu112' => array(
'title' => 'Nivel 1.1.2',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
),
),
'menu12' => array(
'title' => 'Nivel 1.2',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
),
),
'menu2' => array(
'title' => 'Nivel 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
),
),
Title: Re: MOD MenuWithoutLimitLevel (Menú superior sin límite de niveles)
Post by: vicram10 on February 22, 2010, 01:03:44 PM
Quote from: davidhs on February 22, 2010, 01:01:57 PM
¿A qué te refieres con lo del "parse"?

Tutorial para Instalar Manualmente
Title: Re: MOD MenuWithoutLimitLevel (Menú superior sin límite de niveles)
Post by: davidhs on February 22, 2010, 01:09:52 PM
Aún no lo tengo hecho  :-[, pero lo pondré.
Title: Re: MOD MenuWithoutLimitLevel (Menú superior sin límite de niveles)
Post by: arielvissig on February 22, 2010, 03:50:13 PM
Gracias...,muy bueno...
Title: Re: MOD MenuWithoutLimitLevel (Menú superior sin límite de niveles)
Post by: davidhs on March 06, 2010, 11:17:50 AM
He hecho cambios en el package-info.xml, pero el MOD funciona igual.
Title: Re: MOD MenuWithoutLimitLevel (Menú superior sin límite de niveles)
Post by: davidhs on March 08, 2010, 04:48:08 PM
Tras unos cambios, el MOD ha sido aprobado http://custom.simplemachines.org/mods/index.php?mod=2454
Title: Re: MOD MenuWithoutLimitLevel (Menú superior sin límite de niveles)
Post by: Ginolatex on March 09, 2010, 04:32:39 PM
Fantástico, justo andaba buscando algo así!!!!!  ;D

En cuanto se vea el Parse lo pongo es uso.


Saludos.
Title: Re: MOD MenuWithoutLimitLevel 1.0.1 (SMF 2.0 RC2, 2.0 RC3)
Post by: davidhs on March 10, 2010, 01:45:40 PM
Quote from: Ginolatex on March 09, 2010, 04:32:39 PM
En cuanto se vea el Parse lo pongo es uso.

Si te refieres a la instalación manual, no voy a hacer tutorial por que ya existe uno general en http://docs.simplemachines.org/index.php?topic=402

Ahora admite SMF 2.0 RC3.
Title: Re: MOD MenuWithoutLimitLevel 1.0.1 (SMF 2.0 RC2, 2.0 RC3)
Post by: zutzu on March 10, 2010, 02:52:34 PM
Quote from: Ginolatex on March 09, 2010, 04:32:39 PM
Fantástico, justo andaba buscando algo así!!!!!  ;D
En cuanto se vea el Parse lo pongo es uso.
Saludos.

el parse ya esta

http://custom.simplemachines.org/mods/index.php?action=parse;mod=2454;attach=137264;smf_version=2.0_RC2


-- Gracias por el mod, muy útil ;)
Title: Re: MOD MenuWithoutLimitLevel 1.0.1 (SMF 2.0 RC2, 2.0 RC3)
Post by: davidhs on March 11, 2010, 06:18:02 AM
No sabía que eso era el "parse". No lo hago yo, lo hace la web.
Title: Re: MOD MenuWithoutLimitLevel 1.0.1 (SMF 2.0 RC2, 2.0 RC3)
Post by: Ginolatex on March 11, 2010, 10:05:49 AM
Ahora si. Muchas gracias a los dos. Como decia, me viene que ni pintado.


Un saludo.
Title: Re: MOD MenuWithoutLimitLevel 1.0.1 (SMF 2.0 RC2, 2.0 RC3)
Post by: enik on March 11, 2010, 01:05:08 PM
Buen mod lo acavo de mirar en la seccion .

ciao.
Title: Re: MOD MenuWithoutLimitLevel 1.0.1 (SMF 2.0 RC2, 2.0 RC3)
Post by: Ginolatex on March 11, 2010, 02:29:57 PM
Alguién me puede enseñar dónde fallo, me funciona si no uso la parte del submenú 331, algo hago mal pero ni idea de que!!!!

'menu0' => array(
'title' => 'Nivel 0',
'href' => '',
'show' => true,
'sub_buttons' => array(
'menu1' => array(
'title' => 'Nivel 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
     'menu11' => array(
'title' => 'Nivel 1.1',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu12' => array(
'title' => 'Nivel 1.2',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu13' => array(
'title' => 'Nivel 1.3',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu14' => array(
'title' => 'Nivel 1.4',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu15' => array(
'title' => 'Nivel 1.5',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu16' => array(
'title' => 'Nivel 1.6',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu17' => array(
'title' => 'Nivel 1.7',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu18' => array(
'title' => 'Nivel 1.8',
'href' => '',
'show' => true,
'sub_buttons' => array(

),
),
),
),
'menu2' => array(
'title' => '2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'menu21' => array(
'title' => '2.1',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu22' => array(
'title' => '2.2',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu23' => array(
'title' => '2.3',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu24' => array(
'title' => '2.4',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu25' => array(
'title' => '2.5',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu26' => array(
'title' => '2.6',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu27' => array(
'title' => '2.7',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu28' => array(
'title' => '2.8',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
),
),
'menu3' => array(
'title' => '3',
'href' => '',
'show' => true,
'sub_buttons' => array(
   'menu31' => array(
'title' => '3.1',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu32' => array(
'title' => '3.2',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu33' => array(
'title' => '3.3',
'href' => '',
'show' => true,
'sub_buttons' => array(
'menu331' => array(
'title' => 'Nivel 3.3.1',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu332' => array(
'title' => 'Nivel 3.3.2',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
),
),
'menu4' => array(
'title' => '4',
'href' => '',
'show' => true,
'sub_buttons' => array(
'menu41' => array(
'title' => '4.1',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu42' => array(
'title' => '4.2',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu43' => array(
'title' => '4.3',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu44' => array(
'title' => '4.4',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu45' => array(
'title' => '4.5',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu46' => array(
'title' => '4.6',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu47' => array(
'title' => '4.7',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
),
),
'menu5' => array(
'title' => '5',
'href' => '',
'show' => true,
'sub_buttons' => array(

),
),
),
),


sin esto de fabula:

                                                                               ),
),
'menu33' => array(
'title' => '3.3',
'href' => '',
'show' => true,
'sub_buttons' => array(
'menu331' => array(
'title' => 'Nivel 3.3.1',
'href' => '',
'show' => true,
'sub_buttons' => array(
),
),
'menu332' => array(
'title' => 'Nivel 3.3.2',
'href' => '',
'show' => true,
'sub_buttons' => array(



Saludos.
Title: Re: MOD MenuWithoutLimitLevel 1.0.1 (SMF 2.0 RC2, 2.0 RC3)
Post by: davidhs on March 12, 2010, 09:01:04 AM
Quote from: Ginolatex on March 11, 2010, 02:29:57 PM
Alguién me puede enseñar dónde fallo, me funciona si no uso la parte del submenú 331, algo hago mal pero ni idea de que!!!!

Te faltan por cerrar dos paréntesis, entre el nivel 332 y el 4
                           'menu332' => array(
                              'title' => 'Nivel 3.3.2',
                              'href' => '',
                              'show' => true,
                              'sub_buttons' => array(
                              ),),
                              ),
                           ),
                        ),
                     ),
               'menu4' => array(
Title: Re: MOD MenuWithoutLimitLevel 1.0.1 (SMF 2.0 RC2, 2.0 RC3)
Post by: Ginolatex on March 12, 2010, 10:10:31 AM
Uhh, muchas gracias, si estaba ahí el error, tanto darle vueltas al final me hice un taco.
Repito, muy agradecido por todo por el mod y por la ayuda.


Saludos.
Title: Re: MOD Menu without limit level, 1.0.2 (SMF 2.0 RC2 a RC4)
Post by: davidhs on November 13, 2010, 09:02:55 AM
Nueva versión:

1.0.2   04/11/2010
------------------
+ Compatibilidad SMF: Añade 2.0 RC4.
Title: Re: MOD Menu without limit level, 1.0.2 (SMF 2.0 RC2 a RC4)
Post by: enik on November 13, 2010, 10:10:03 AM
Perfecto buen mod  ;)
Title: Re: MOD Menu without limit level, 1.0.3 (SMF 2.0 RC2-RC5)
Post by: davidhs on February 13, 2011, 03:24:52 PM
Nueva versión:

1.0.3   13/02/2011
------------------
+ Compatibilidad SMF: Añade 2.0 RC5.
Title: Re: MOD Menu without limit level, 1.0.4 (SMF 2.0 RC2-2.0)
Post by: davidhs on June 21, 2011, 08:56:50 AM
Nueva versión:

1.0.4   18/06/2011
------------------
+ Compatibilidad SMF: Añade 2.0.
Title: Re: MOD Menu without limit level, 1.0.5 (SMF 2.0 RC2-2.0.1)
Post by: davidhs on September 21, 2011, 02:03:13 PM
Nueva versión:

1.0.5   20/09/2011
------------------
+ Compatibilidad SMF: Añade 2.0.1.
Title: Re: MOD Menu without limit level, 1.0.6 (SMF 2.0 RC2-2.0.2)
Post by: davidhs on December 25, 2011, 02:31:55 PM
Nueva versión:
1.0.6   24/12/2011
------------------
! Algunas modificaciones del index.css del tema no son necesarias.
+ Compatibilidad SMF: Añade 2.0.2.
Title: Re: MOD Menu without limit level, 1.0.7 (SMF 2.0 RC2-2.0.3)
Post by: davidhs on December 22, 2012, 06:11:04 AM
Nueva versión:
1.0.7   22/12/2012
------------------
+ Compatibilidad SMF: Añade 2.0.3.
Title: Re: MOD Menu without limit level, 1.0.8 (SMF 2.0-2.0.4)
Post by: davidhs on April 09, 2013, 03:31:45 PM
Nueva versión:
1.0.8   09/04/2013
------------------
+ Compatibilidad SMF: Añade 2.0.4.
- Compatibilidad SMF: Elimina el soporte a las versiones RC.
Title: Re: MOD Menu without limit level, 1.0.9 (SMF 2.0-2.0.5)
Post by: davidhs on August 19, 2013, 07:52:23 AM
Nueva versión:
1.0.9   18/08/2013
------------------
@ Esta obra está bajo una licencia de Creative Commons Reconocimiento 3.0 Unported http://creativecommons.org/licenses/by/3.0/deed.es_ES
+ Compatibilidad SMF: Añade 2.0.5.
Title: Re: MOD Menu without limit level, 1.0.10 (SMF 2.0-2.0.6)
Post by: davidhs on October 24, 2013, 11:58:05 AM
Nueva versión:
1.0.10  24/10/2013
------------------
+ Compatibilidad SMF: 2.0.6.
Title: Re: MOD Menu without limit level, 1.0.11 (SMF 2.0-2.0.7)
Post by: davidhs on January 25, 2014, 08:36:11 AM
Nueva versión:
1.0.11  24/01/2014
------------------
! Error en el código fuente.
+ Compatibilidad SMF: 2.0.7.
Title: Re: MOD Menu without limit level, 1.0.11 (SMF 2.0-2.0.8)
Post by: davidhs on June 24, 2014, 08:55:12 AM
Compatible con SMF 2.0.8.
Title: Re: MOD Menu without limit level, 1.0.11 (SMF 2.0-2.0.9)
Post by: davidhs on October 06, 2014, 07:58:56 AM
Compatible con SMF 2.0.9.
Title: Re: MOD Menu without limit level, 1.0.11 (SMF 2.0-2.0.9)
Post by: davidhs on May 23, 2015, 12:12:51 PM
Compatible con SMF 2.0.10.
Title: Re: MOD Menu without limit level
Post by: Antes on August 18, 2015, 01:52:28 PM
Done.
Title: Re: MOD Menu without limit level
Post by: davidhs on September 26, 2015, 08:39:14 AM
Compatible con SMF 2.0.11.
Title: Re: MOD Menu without limit level
Post by: davidhs on October 12, 2016, 09:25:50 AM
Compatible con SMF 2.0.12.
Title: Re: MOD Menu without limit level
Post by: jhonsks on January 12, 2017, 12:28:05 AM
amigo hola que tal tengo un problema a la hora de instalar la mod, me sale un aviso y aun asi lo instale pero se me elimino todo y solo me quedo el logo de la pagina, luego abajo del aviso donde dice prueba fallida segui los pasos que me indica y al editar el subs.php al terminar me sale que MenuWithoutLimitLevel no existe y solo sale ese aviso mas el foro sale todo blanco , luego en lo de Who.php sale bien todo uso la version smf 2.0.11 y theme love use la ultima version de tu mod el 1.0.11 te adjunto los codigos y mi subs.php y el Who.php y una imagen para que me digas que esta mal. Saludos :)

http://juegosonline.890m.com/



Encontrar:
function setupMenuContext()
{
global $context, $modSettings, $user_info, $txt, $scripturl;

Añadir despues:
// BEGIN MOD MenuWithoutLimitLevel
loadTemplate('MenuWithoutLimitLevel');
// END MOD MenuWithoutLimitLevel

Encontrar:
'mods' => array(

Añadir despues:
// BEGIN MOD MenuWithoutLimitLevel
'<a href="http://custom.simplemachines.org/mods/index.php?mod=2454" target="_blank" class="new_win">Menu without limit level</a>, 1.0.11 &copy; 2010-2014, davidhs',
// END MOD MenuWithoutLimitLevel
Title: Re: MOD Menu without limit level
Post by: davidhs on January 12, 2017, 01:42:29 PM
Este mod funciona en el tema por defecto y en los basados en él. No sé si es el caso de tu tema.

Un consejo: Si un mod da errores al instalarlo, mejor no instalarlo. ;)

De todas formas, como ya lo instalaste voy a ver si consigo que te vaya...

Adjunto los ficheros corregidos, reemplazalos en tu foro:
- Subs.php. Las dos modificaciones que debería haber hecho no estaban hechas.
- who.php. Tienes un mod que añade un código "Activity_Bar_Who()" y descoloca algo el código del fichero, por eso no instalaba aquí.

Si sólo dió error en estos ficheros, debería funcionar (y desinstalar sin errores).

Una vez corregidos los ficheros anteriores, para crear un menú de más de dos niveles tienes que hacerlo de forma manual, según el ejemplo del primer mensaje de este hilo (utilizando integration hooks en lugar de modificar el menú en el Subs.php).
Title: Re: MOD Menu without limit level
Post by: davidhs on January 12, 2017, 03:57:36 PM
Compatible con SMF 2.0.13.
Title: Re: MOD Menu without limit level
Post by: jhonsks on January 12, 2017, 04:58:43 PM
amigo ya lo instale como dijiste y no hay fallos  :), pero como hago para agregar los menus y sub menus y claro editar con los nombres q quiero ya revise la administracion y no hay alguna opcion para la mod  :-\
Title: Re: MOD Menu without limit level
Post by: davidhs on January 12, 2017, 05:32:12 PM
Quote from: jhonsks on January 12, 2017, 04:58:43 PM
amigo ya lo instale como dijiste y no hay fallos  :),
Me alegro. Si actualizas a SMF 2.0.13 el mod no cambia, no necesita actualizarse.

Quote from: jhonsks on January 12, 2017, 04:58:43 PM
pero como hago para agregar los menus y sub menus y claro editar con los nombres q quiero ya revise la administracion y no hay alguna opcion para la mod  :-\
No hay zona de administración del mod. Tienes que seguir el ejemplo del primer post:
1. crear el fichero Sources/Subs-MenuMultiLevel.php con los nuevos menús que quieras tener, y
2. añadir las dos líneas al fichero Sources/Load.php.

En el fichero Sources/Subs-MenuMultiLevel.php lo que escribas dentro de la función menu_multi_level() depende de lo que quieras hacer. Si tienes dudas puedes escribir aquí (si crees que será útil para otros), o me das por MP, la estructura de menús que quieres y te digo lo que debe contener el fichero.
Title: Re: MOD Menu without limit level
Post by: jhonsks on January 12, 2017, 06:04:00 PM
hize exactamente todo lo que dijiste y al final me salio esto




una duda 'title'  es para el titulo y 'href' es para las url verdad?
            
Title: Re: MOD Menu without limit level
Post by: davidhs on January 13, 2017, 06:04:36 AM
Quote from: jhonsks on January 12, 2017, 06:04:00 PM
hize exactamente todo lo que dijiste y al final me salio esto
Hay algo mal escrito en el fichero Subs-MenuMultiLevel.php. Adjuntalo y lo miro.

Quote from: jhonsks on January 12, 2017, 06:04:00 PM
una duda 'title'  es para el titulo y 'href' es para las url verdad?
Sí.
Title: Re: MOD Menu without limit level
Post by: jhonsks on January 13, 2017, 08:17:40 AM
ok te lo adjunto

Title: Re: MOD Menu without limit level
Post by: davidhs on January 13, 2017, 09:14:12 AM
Hay un error en el ejemplo, en la línea 15 de ese fichero.

En el hilo de soporte en inglés lo he corregido pero aquí no puedo modificar el mensaje. Pongo aquí el código correcto.

Quote from: davidhs on February 21, 2010, 02:11:50 PM
1. Crear el fichero Sources/Subs-MenuMultiLevel.php con el contenido
<?php

if (!defined('SMF'))
die('Hacking attempt...');

function 
menu_multi_level($buttons)
{
$buttons2 $buttons;
$buttons = array();
foreach ($buttons2 as $i => $b)
{
$buttons[$i] = $b;
if ('home' == $i)
{
$buttons['m0'] = array(
'title' => 'Menu multi-level',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm1' => array(
'title' => 'Submenu 1 - level 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm11' => array(
'title' => 'Submenu 1.1 - level 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm111' => array(
'title' => 'Submenu 1.1.1 - level 3',
'href' => '',
'show' => true,
),
'm112' => array(
'title' => 'Submenu 1.1.2 - level 3',
'href' => '',
'show' => true,
),
),
),

'm12' => array(
'title' => 'Submenu 1.2 - level 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm121' => array(
'title' => 'Submenu 1.2.1 - level 3',
'href' => '',
'show' => true,
),
'm122' => array(
'title' => 'Submenu 1.2.2 - level 3',
'href' => '',
'show' => true,
),
),
),

'm13' => array(
'title' => 'Submenu 1.3 - level 2',
'href' => '',
'show' => true,
),
),
),

'm2' => array(
'title' => 'Submenu 2 - level 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm21' => array(
'title' => 'Submenu 2.1 - level 2',
'href' => '',
'show' => true,
),
'm22' => array(
'title' => 'Submenu 2.2 - level 2',
'href' => '',
'show' => true,
),
),
),

),
);

}
}

}

?>


2. En el fichero Sources/Load.php, encontrar
// Integration is cool.
if (defined('SMF_INTEGRATION_SETTINGS'))
{
$integration_settings = unserialize(SMF_INTEGRATION_SETTINGS);
foreach ($integration_settings as $hook => $function)
add_integration_function($hook, $function, false);
}

y añadir después
add_integration_function('integrate_menu_buttons', 'menu_multi_level', false);
add_integration_function('integrate_pre_include', '$boarddir/Sources/Subs-MenuMultiLevel.php', false);

Title: Re: MOD Menu without limit level
Post by: jhonsks on January 13, 2017, 10:16:36 AM
se abrio el foro si pero todo sigue como antes osea no se agrego los menus y menos los sub-menus y he echo todo los pasos que me dijostes a que se debe ? :-\

http://juegosonline.890m.com/index.php
Title: Re: MOD Menu without limit level
Post by: davidhs on January 13, 2017, 01:55:26 PM
Quote from: jhonsks on January 13, 2017, 10:16:36 AM
se abrio el foro si pero todo sigue como antes osea no se agrego los menus y menos los sub-menus y he echo todo los pasos que me dijostes a que se debe ? :-\

http://juegosonline.890m.com/index.php
Es raro... aunque no abriese todos niveles de submenús sí debería añadir el elemento Menu multi-level después de Inicio.

No creo que sea cosas de permisos... mira si Sources/Subs-MenuMultiLevel.php tiene permisos 777 (si no sabes como hacerlo creo que no merece la pena seguir por ahí...)

¿Se ha creado algún error en el registro de errores del foro?

Vamos a probar si al menos crea un menú de primer nivel al final. En el fichero Sources/Subs-MenuMultiLevel.php reemplaza
function menu_multi_level($buttons)
por
function menu_multi_level($buttons)
{
$buttons['m0'] = array(
'title' => 'Nuevo Menu',
'href' => '',
'show' => true,
'sub_buttons' => array(),
);
}

function menu_multi_level2($buttons)


Esto debería añadir un elemento Nuevo Menu, sin submenús, al final de tu menú.
Title: Re: MOD Menu without limit level
Post by: jhonsks on January 13, 2017, 07:44:20 PM
ya lo agregue y nada amigo q extraño no se estropeo nada pero no se agrega nada tampoco  :-\
Title: Re: MOD Menu without limit level
Post by: davidhs on January 14, 2017, 06:44:50 AM
Pon el tema por defecto a ver si ahí si se vé el nuevo elemento de menú (puede que tu tema utilice/lea el menú de otra forma).

Si no va tampoco, no se que más probar... tendría que ver los ficheros en tu servidor...
Title: Re: MOD Menu without limit level
Post by: jhonsks on January 15, 2017, 07:43:17 AM
nada mi amigo te mandare via ftp su acceso para que veas el error y asi poder solucionar este caso  :)
Title: Re: MOD Menu without limit level
Post by: davidhs on January 16, 2017, 12:26:17 PM
Había otro error en el ejemplo, el parátretro de la función debe pasarse por referencia:
menu_multi_level(&$buttons)

Pongo aquí el código correcto.

Quote from: davidhs on February 21, 2010, 02:11:50 PM
1. Crear el fichero Sources/Subs-MenuMultiLevel.php con el contenido
<?php

if (!defined('SMF'))
die('Hacking attempt...');

function 
menu_multi_level(&$buttons)
{
$buttons2 $buttons;
$buttons = array();
foreach ($buttons2 as $i => $b)
{
$buttons[$i] = $b;
if ('home' == $i)
{
$buttons['m0'] = array(
'title' => 'Menu multi-level',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm1' => array(
'title' => 'Submenu 1 - level 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm11' => array(
'title' => 'Submenu 1.1 - level 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm111' => array(
'title' => 'Submenu 1.1.1 - level 3',
'href' => '',
'show' => true,
),
'm112' => array(
'title' => 'Submenu 1.1.2 - level 3',
'href' => '',
'show' => true,
),
),
),

'm12' => array(
'title' => 'Submenu 1.2 - level 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm121' => array(
'title' => 'Submenu 1.2.1 - level 3',
'href' => '',
'show' => true,
),
'm122' => array(
'title' => 'Submenu 1.2.2 - level 3',
'href' => '',
'show' => true,
),
),
),

'm13' => array(
'title' => 'Submenu 1.3 - level 2',
'href' => '',
'show' => true,
),
),
),

'm2' => array(
'title' => 'Submenu 2 - level 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm21' => array(
'title' => 'Submenu 2.1 - level 2',
'href' => '',
'show' => true,
),
'm22' => array(
'title' => 'Submenu 2.2 - level 2',
'href' => '',
'show' => true,
),
),
),

),
);

}
}

}

?>


2. En el fichero Sources/Load.php, encontrar
// Integration is cool.
if (defined('SMF_INTEGRATION_SETTINGS'))
{
$integration_settings = unserialize(SMF_INTEGRATION_SETTINGS);
foreach ($integration_settings as $hook => $function)
add_integration_function($hook, $function, false);
}

y añadir después
add_integration_function('integrate_menu_buttons', 'menu_multi_level', false);
add_integration_function('integrate_pre_include', '$boarddir/Sources/Subs-MenuMultiLevel.php', false);

Title: Re: MOD Menu without limit level
Post by: jhonsks on January 16, 2017, 08:23:26 PM
excelente todo salio perfecto  ;) con esto ya si alguien tiene una duda pues con esto ya se va toda inquietud  :laugh:

te agradesco mucho mi amigaso davidhs un abraso a distancia  ;)
Title: Re: MOD Menu without limit level
Post by: -Rock Lee- on January 16, 2017, 08:34:53 PM
Creo no haber probado este mod... lo voy a instalar en un smf limpio para probar, muy buen trabajo @davidhs gracias por tanto.


Saludos!
Title: Re: MOD Menu without limit level
Post by: davidhs on November 25, 2017, 12:22:22 PM
Compatible con SMF 2.0.14 y 2.0.15.
Title: Re: MOD Menu without limit level
Post by: davidhs on December 23, 2017, 08:45:37 AM
Nueva versión:
2.0     20/12/2017
------------------
@ En versiones anteriores eran necesarios cambios manuales en el fichero Sources/Load.php. Ya no son necesarios y deben deshacerse.
@ En versiones anteriores el fichero PHP donde se modifica el menú podía tener cualquier nombre. Ahora tiene que llamarse Subs-MenuWithoutLimitLevel-Menu.php. Si existe con otro nombre debe renombrarse. Y la función tiene que llamarse mwllMenuButtons.
* Uses integration hooks.
+ Compatibilidad SMF: 2.0.8-2.0.15 y 2.1 Beta 3.





He hecho un cambio importante y ahora el mod utiliza integration hooks (ya no hay que modificar el menú en Subs.php ni hacer cambios en Load.php). Pero hay que renombrar el fichero y la función que modifica el menú, según se indica en el registro de cambios.
Title: Re: MOD Menu without limit level
Post by: -Rock Lee- on February 12, 2018, 08:30:22 PM
@davidhs use mucho este mod en verdad ahora me toco actualizarlo en la pagina donde lo tenia, me alegra oir que ahora usa hooks :D


Saludos!
Title: Re: MOD Menu without limit level
Post by: davidhs on April 12, 2019, 12:30:08 PM
Nueva versión:
2.0.1   09/04/2019
------------------
+ Compatibilidad SMF: 2.1 RC1 a RC2.
Title: Re: MOD Menu without limit level
Post by: davidhs on March 05, 2020, 03:49:35 PM
Compatible con SMF 2.0.16 y 2.0.17.
Title: Re: MOD Menu without limit level
Post by: davidhs on February 17, 2021, 04:45:01 PM
Nueva versión:
3.0     17/02/2021
------------------
@ En versiones anteriores el menú se modificaba en un fichero (llamado Subs-MenuWithoutLimitLevel-Menu.php desde la versión 2.0, y con cualquier nombre en versiones anteriores). Ahora el menú se modifica desde el panel de administración. Debe copiar el contenido del fichero en el campo del panel, y eliminar el fichero.
+ Panel de administración.
+ Permite cambiar la estructura del menu en el panel de administración, utilizando código PHP.
+ La Búsqueda Rápida del Centro de Administración SMF busca en las variables de configuración del MOD.
+ SMF compatibility: 2.0.16-2.0.18 y 2.1 RC3.
+ Idiomas: english, english-utf8, english_british, english_british-utf8, spanish_es, spanish_es-utf8, spanish_latin, spanish_latin-utf8.
Title: Re: MOD Menu without limit level
Post by: davidhs on February 21, 2021, 07:53:50 AM
Sobre el cuadro de texto del panel de administración donde escribir el código PHP, en la serie SMF 2.0.x se muestra muy estrecho, y en la serie SMF 2.1.x demasiado ancho.

Para solucionarlo añadiré un código en la próxima actualización, cuando haya un cambio importante. De momento podéis hacerlo vosotros, no impedirá desinstalar el mod más adelante. Hay que modificar el fichero Sources/Admin-MenuWithoutLimitLevel.php.

Para la serie 2.0.x:
Code (Añadir en la línea 51) Select
$context['html_headers'] .= '
<style type="text/css">
textarea#mwll_code { width: 90%; }
</style>';

Para la serie 2.1 Beta x:
Code (Añadir en la línea 57) Select
addInlineCss('
textarea#mwll_code { width: 90%; }');

Para la serie 2.1 RCx:
Code (Añadir en la línea 64) Select
addInlineCss('
textarea#mwll_code { width: 90%; }');