¿Necesitas ayuda con phpBB

  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Febrero 8th, 2010, 10:20 pm

Me olvidé de cómo establecer la siguiente matriz de modo que se puede ejecutar en la plantilla
PHP Código: [ Select ]
<?php
$pages = array(
    array(
        'title' =>  'Navigation',
        'pages' =>  array(
                    'U_PAGE'  => $_root_path . 'page_1.php',
                    'T_PAGE'  => 'Page 1',
                    'L_PAGE'  => 'Page 1'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_2.php',
                    'T_PAGE'  => 'Page 2',
                    'L_PAGE'  => 'Page 2'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_3.php',
                    'T_PAGE'  => 'Page 3',
                    'L_PAGE'  => 'Page 3'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_2.php',
                    'T_PAGE'  => 'Page 4',
                    'L_PAGE'  => 'Page 4'
                )
        ),
    array(
        'title' =>  'Navigation',
        'pages' =>  array(
                    'U_PAGE'  => $_root_path . 'page_1.php',
                    'T_PAGE'  => 'Page 1',
                    'L_PAGE'  => 'Page 1'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_2.php',
                    'T_PAGE'  => 'Page 2',
                    'L_PAGE'  => 'Page 2'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_3.php',
                    'T_PAGE'  => 'Page 3',
                    'L_PAGE'  => 'Page 3'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_2.php',
                    'T_PAGE'  => 'Page 4',
                    'L_PAGE'  => 'Page 4'
                )
        ),
    array(
        'title' =>  'Navigation',
        'pages' =>  array(
                    'U_PAGE'  => $_root_path . 'page_1.php',
                    'T_PAGE'  => 'Page 1',
                    'L_PAGE'  => 'Page 1'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_2.php',
                    'T_PAGE'  => 'Page 2',
                    'L_PAGE'  => 'Page 2'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_3.php',
                    'T_PAGE'  => 'Page 3',
                    'L_PAGE'  => 'Page 3'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_2.php',
                    'T_PAGE'  => 'Page 4',
                    'L_PAGE'  => 'Page 4'
                )
        ));
?>
  1. <?php
  2. $pages = array(
  3.     array(
  4.         'title' =>  'Navigation',
  5.         'pages' =>  array(
  6.                     'U_PAGE'  => $_root_path . 'page_1.php',
  7.                     'T_PAGE'  => 'Page 1',
  8.                     'L_PAGE'  => 'Page 1'
  9.                 ),
  10.                     array(
  11.                     'U_PAGE'  => $_root_path . 'page_2.php',
  12.                     'T_PAGE'  => 'Page 2',
  13.                     'L_PAGE'  => 'Page 2'
  14.                 ),
  15.                     array(
  16.                     'U_PAGE'  => $_root_path . 'page_3.php',
  17.                     'T_PAGE'  => 'Page 3',
  18.                     'L_PAGE'  => 'Page 3'
  19.                 ),
  20.                     array(
  21.                     'U_PAGE'  => $_root_path . 'page_2.php',
  22.                     'T_PAGE'  => 'Page 4',
  23.                     'L_PAGE'  => 'Page 4'
  24.                 )
  25.         ),
  26.     array(
  27.         'title' =>  'Navigation',
  28.         'pages' =>  array(
  29.                     'U_PAGE'  => $_root_path . 'page_1.php',
  30.                     'T_PAGE'  => 'Page 1',
  31.                     'L_PAGE'  => 'Page 1'
  32.                 ),
  33.                     array(
  34.                     'U_PAGE'  => $_root_path . 'page_2.php',
  35.                     'T_PAGE'  => 'Page 2',
  36.                     'L_PAGE'  => 'Page 2'
  37.                 ),
  38.                     array(
  39.                     'U_PAGE'  => $_root_path . 'page_3.php',
  40.                     'T_PAGE'  => 'Page 3',
  41.                     'L_PAGE'  => 'Page 3'
  42.                 ),
  43.                     array(
  44.                     'U_PAGE'  => $_root_path . 'page_2.php',
  45.                     'T_PAGE'  => 'Page 4',
  46.                     'L_PAGE'  => 'Page 4'
  47.                 )
  48.         ),
  49.     array(
  50.         'title' =>  'Navigation',
  51.         'pages' =>  array(
  52.                     'U_PAGE'  => $_root_path . 'page_1.php',
  53.                     'T_PAGE'  => 'Page 1',
  54.                     'L_PAGE'  => 'Page 1'
  55.                 ),
  56.                     array(
  57.                     'U_PAGE'  => $_root_path . 'page_2.php',
  58.                     'T_PAGE'  => 'Page 2',
  59.                     'L_PAGE'  => 'Page 2'
  60.                 ),
  61.                     array(
  62.                     'U_PAGE'  => $_root_path . 'page_3.php',
  63.                     'T_PAGE'  => 'Page 3',
  64.                     'L_PAGE'  => 'Page 3'
  65.                 ),
  66.                     array(
  67.                     'U_PAGE'  => $_root_path . 'page_2.php',
  68.                     'T_PAGE'  => 'Page 4',
  69.                     'L_PAGE'  => 'Page 4'
  70.                 )
  71.         ));
  72. ?>

No recuerdo cómo analizar ese tipo de cosas :(

Any pointers? Ive búsquedas de Google y el wiki de phpBB y no salió nada :(
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Febrero 8th, 2010, 10:20 pm

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Registrado: Feb 10, 2004
  • Mensajes: 13455
  • Loc: Florida
  • Status: Offline

Nota Febrero 8th, 2010, 10:38 pm

¿Está buscando assign_block_vars ?
Strong with this one, the sudo is.
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Febrero 8th, 2010, 10:43 pm

Oh wow...el wiki tutorial leí que había lugar estaba vacío .

Gracias.
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Registrado: Feb 10, 2004
  • Mensajes: 13455
  • Loc: Florida
  • Status: Offline

Nota Febrero 8th, 2010, 10:50 pm

Acabo de pasar a recordar el nombre de función, así que tomé un tiro en la oscuridad buscando con Google.
Strong with this one, the sudo is.
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Febrero 8th, 2010, 11:01 pm

Oh, ya veo.

Tengo otro problema. Ive consiguió el siguiente código:
PHP Código: [ Select ]
<?php
$pages = array(
    array(
        'Navigation 1' =>  array(
                    'U_PAGE'  => $_root_path . 'page_1.php',
                    'T_PAGE'  => 'Page 1',
                    'L_PAGE'  => 'Page 1'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_2.php',
                    'T_PAGE'  => 'Page 2',
                    'L_PAGE'  => 'Page 2'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_3.php',
                    'T_PAGE'  => 'Page 3',
                    'L_PAGE'  => 'Page 3'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_4.php',
                    'T_PAGE'  => 'Page 4',
                    'L_PAGE'  => 'Page 4'
                )
        ),
    array(
        'Navigation 2' =>  array(
                    'U_PAGE'  => $_root_path . 'page_5.php',
                    'T_PAGE'  => 'Page 1',
                    'L_PAGE'  => 'Page 1'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_6.php',
                    'T_PAGE'  => 'Page 2',
                    'L_PAGE'  => 'Page 2'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_7.php',
                    'T_PAGE'  => 'Page 3',
                    'L_PAGE'  => 'Page 3'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_8.php',
                    'T_PAGE'  => 'Page 4',
                    'L_PAGE'  => 'Page 4'
                )
        ),
    array(
        'Navigation 3' =>  array(
                    'U_PAGE'  => $_root_path . 'page_9.php',
                    'T_PAGE'  => 'Page 1',
                    'L_PAGE'  => 'Page 1'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_10.php',
                    'T_PAGE'  => 'Page 2',
                    'L_PAGE'  => 'Page 2'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_11.php',
                    'T_PAGE'  => 'Page 3',
                    'L_PAGE'  => 'Page 3'
                ),
                    array(
                    'U_PAGE'  => $_root_path . 'page_12.php',
                    'T_PAGE'  => 'Page 4',
                    'L_PAGE'  => 'Page 4'
                )
        ));
 
foreach ($pages as $category => $page)
{
    $template->assign_block_vars('pages', array(
        'TITLE'    => $category
    ));
 
    foreach ($page as $item)
    {
        $template->assign_block_vars('pages.page', array(
            'U_PAGE'        => $item['U_PAGE'],
            'T_PAGE'        => $item['T_PAGE'],
            'L_PAGE'        => $item['L_PAGE']
        ));
    }
}
?>
  1. <?php
  2. $pages = array(
  3.     array(
  4.         'Navigation 1' =>  array(
  5.                     'U_PAGE'  => $_root_path . 'page_1.php',
  6.                     'T_PAGE'  => 'Page 1',
  7.                     'L_PAGE'  => 'Page 1'
  8.                 ),
  9.                     array(
  10.                     'U_PAGE'  => $_root_path . 'page_2.php',
  11.                     'T_PAGE'  => 'Page 2',
  12.                     'L_PAGE'  => 'Page 2'
  13.                 ),
  14.                     array(
  15.                     'U_PAGE'  => $_root_path . 'page_3.php',
  16.                     'T_PAGE'  => 'Page 3',
  17.                     'L_PAGE'  => 'Page 3'
  18.                 ),
  19.                     array(
  20.                     'U_PAGE'  => $_root_path . 'page_4.php',
  21.                     'T_PAGE'  => 'Page 4',
  22.                     'L_PAGE'  => 'Page 4'
  23.                 )
  24.         ),
  25.     array(
  26.         'Navigation 2' =>  array(
  27.                     'U_PAGE'  => $_root_path . 'page_5.php',
  28.                     'T_PAGE'  => 'Page 1',
  29.                     'L_PAGE'  => 'Page 1'
  30.                 ),
  31.                     array(
  32.                     'U_PAGE'  => $_root_path . 'page_6.php',
  33.                     'T_PAGE'  => 'Page 2',
  34.                     'L_PAGE'  => 'Page 2'
  35.                 ),
  36.                     array(
  37.                     'U_PAGE'  => $_root_path . 'page_7.php',
  38.                     'T_PAGE'  => 'Page 3',
  39.                     'L_PAGE'  => 'Page 3'
  40.                 ),
  41.                     array(
  42.                     'U_PAGE'  => $_root_path . 'page_8.php',
  43.                     'T_PAGE'  => 'Page 4',
  44.                     'L_PAGE'  => 'Page 4'
  45.                 )
  46.         ),
  47.     array(
  48.         'Navigation 3' =>  array(
  49.                     'U_PAGE'  => $_root_path . 'page_9.php',
  50.                     'T_PAGE'  => 'Page 1',
  51.                     'L_PAGE'  => 'Page 1'
  52.                 ),
  53.                     array(
  54.                     'U_PAGE'  => $_root_path . 'page_10.php',
  55.                     'T_PAGE'  => 'Page 2',
  56.                     'L_PAGE'  => 'Page 2'
  57.                 ),
  58.                     array(
  59.                     'U_PAGE'  => $_root_path . 'page_11.php',
  60.                     'T_PAGE'  => 'Page 3',
  61.                     'L_PAGE'  => 'Page 3'
  62.                 ),
  63.                     array(
  64.                     'U_PAGE'  => $_root_path . 'page_12.php',
  65.                     'T_PAGE'  => 'Page 4',
  66.                     'L_PAGE'  => 'Page 4'
  67.                 )
  68.         ));
  69.  
  70. foreach ($pages as $category => $page)
  71. {
  72.     $template->assign_block_vars('pages', array(
  73.         'TITLE'    => $category
  74.     ));
  75.  
  76.     foreach ($page as $item)
  77.     {
  78.         $template->assign_block_vars('pages.page', array(
  79.             'U_PAGE'        => $item['U_PAGE'],
  80.             'T_PAGE'        => $item['T_PAGE'],
  81.             'L_PAGE'        => $item['L_PAGE']
  82.         ));
  83.     }
  84. }
  85. ?>


Y HTML es:
HTML Código: [ Select ]
<!-- BEGIN pages -->
    <li class="head">{pages.TITLE}</li>
    <!-- BEGIN page -->
    <li><a href="{pages.page.U_PAGE}" title="{pages.page.T_PAGE}">{pages.page.L_PAGE}</a></li>
    <!-- END page -->
<!-- END pages -->
 
  1. <!-- BEGIN pages -->
  2.     <li class="head">{pages.TITLE}</li>
  3.     <!-- BEGIN page -->
  4.     <li><a href="{pages.page.U_PAGE}" title="{pages.page.T_PAGE}">{pages.page.L_PAGE}</a></li>
  5.     <!-- END page -->
  6. <!-- END pages -->
  7.  

Se muestra casi todo a la perfección. El problema que tengo con el que reside en pages.TITLE .

En lugar de la Navegación #Veo a 0 y luego 1 y luego 2, como los que están las teclas numéricas. ¿Cómo puedo corregir eso?
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Registrado: Feb 10, 2004
  • Mensajes: 13455
  • Loc: Florida
  • Status: Offline

Nota Febrero 8th, 2010, 11:32 pm

Eso es porque lo que usted se refiere a la categoría con $ en realidad es una clave numérica en este caso. :)

Su serie parece ser un nivel más profundo de lo que debe ser.
Strong with this one, the sudo is.
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Febrero 9th, 2010, 2:31 pm

Ya veo...la siguiente matriz fija el tema y ahora veo lo que tengo que ver.
PHP Código: [ Select ]
$pages = array(
        'Navigation 1' =>  array(
                            array(
                                'U_PAGE'  => $_root_path . 'page_1.php',
                                'T_PAGE'  => 'Page 1',
                                'L_PAGE'  => 'Page 1'
                            ),
                                array(
                                'U_PAGE'  => $_root_path . 'page_2.php',
                                'T_PAGE'  => 'Page 2',
                                'L_PAGE'  => 'Page 2'
                            ),
                                array(
                                'U_PAGE'  => $_root_path . 'page_3.php',
                                'T_PAGE'  => 'Page 3',
                                'L_PAGE'  => 'Page 3'
                            ),
                                array(
                                'U_PAGE'  => $_root_path . 'page_4.php',
                                'T_PAGE'  => 'Page 4',
                                'L_PAGE'  => 'Page 4'
                            )),
        'Navigation 2' =>  array(
                            array(
                                'U_PAGE'  => $_root_path . 'page_5.php',
                                'T_PAGE'  => 'Page 1',
                                'L_PAGE'  => 'Page 1'
                            ),
                                array(
                                'U_PAGE'  => $_root_path . 'page_6.php',
                                'T_PAGE'  => 'Page 2',
                                'L_PAGE'  => 'Page 2'
                            ),
                                array(
                                'U_PAGE'  => $_root_path . 'page_7.php',
                                'T_PAGE'  => 'Page 3',
                                'L_PAGE'  => 'Page 3'
                            ),
                                array(
                                'U_PAGE'  => $_root_path . 'page_8.php',
                                'T_PAGE'  => 'Page 4',
                                'L_PAGE'  => 'Page 4'
                            )),
        'Navigation 3' =>  array(
                            array(
                                'U_PAGE'  => $_root_path . 'page_9.php',
                                'T_PAGE'  => 'Page 1',
                                'L_PAGE'  => 'Page 1'
                            ),
                                array(
                                'U_PAGE'  => $_root_path . 'page_10.php',
                                'T_PAGE'  => 'Page 2',
                                'L_PAGE'  => 'Page 2'
                            ),
                                array(
                                'U_PAGE'  => $_root_path . 'page_11.php',
                                'T_PAGE'  => 'Page 3',
                                'L_PAGE'  => 'Page 3'
                            ),
                                array(
                                'U_PAGE'  => $_root_path . 'page_12.php',
                                'T_PAGE'  => 'Page 4',
                                'L_PAGE'  => 'Page 4'
                            ))
        );
  1. $pages = array(
  2.         'Navigation 1' =>  array(
  3.                             array(
  4.                                 'U_PAGE'  => $_root_path . 'page_1.php',
  5.                                 'T_PAGE'  => 'Page 1',
  6.                                 'L_PAGE'  => 'Page 1'
  7.                             ),
  8.                                 array(
  9.                                 'U_PAGE'  => $_root_path . 'page_2.php',
  10.                                 'T_PAGE'  => 'Page 2',
  11.                                 'L_PAGE'  => 'Page 2'
  12.                             ),
  13.                                 array(
  14.                                 'U_PAGE'  => $_root_path . 'page_3.php',
  15.                                 'T_PAGE'  => 'Page 3',
  16.                                 'L_PAGE'  => 'Page 3'
  17.                             ),
  18.                                 array(
  19.                                 'U_PAGE'  => $_root_path . 'page_4.php',
  20.                                 'T_PAGE'  => 'Page 4',
  21.                                 'L_PAGE'  => 'Page 4'
  22.                             )),
  23.         'Navigation 2' =>  array(
  24.                             array(
  25.                                 'U_PAGE'  => $_root_path . 'page_5.php',
  26.                                 'T_PAGE'  => 'Page 1',
  27.                                 'L_PAGE'  => 'Page 1'
  28.                             ),
  29.                                 array(
  30.                                 'U_PAGE'  => $_root_path . 'page_6.php',
  31.                                 'T_PAGE'  => 'Page 2',
  32.                                 'L_PAGE'  => 'Page 2'
  33.                             ),
  34.                                 array(
  35.                                 'U_PAGE'  => $_root_path . 'page_7.php',
  36.                                 'T_PAGE'  => 'Page 3',
  37.                                 'L_PAGE'  => 'Page 3'
  38.                             ),
  39.                                 array(
  40.                                 'U_PAGE'  => $_root_path . 'page_8.php',
  41.                                 'T_PAGE'  => 'Page 4',
  42.                                 'L_PAGE'  => 'Page 4'
  43.                             )),
  44.         'Navigation 3' =>  array(
  45.                             array(
  46.                                 'U_PAGE'  => $_root_path . 'page_9.php',
  47.                                 'T_PAGE'  => 'Page 1',
  48.                                 'L_PAGE'  => 'Page 1'
  49.                             ),
  50.                                 array(
  51.                                 'U_PAGE'  => $_root_path . 'page_10.php',
  52.                                 'T_PAGE'  => 'Page 2',
  53.                                 'L_PAGE'  => 'Page 2'
  54.                             ),
  55.                                 array(
  56.                                 'U_PAGE'  => $_root_path . 'page_11.php',
  57.                                 'T_PAGE'  => 'Page 3',
  58.                                 'L_PAGE'  => 'Page 3'
  59.                             ),
  60.                                 array(
  61.                                 'U_PAGE'  => $_root_path . 'page_12.php',
  62.                                 'T_PAGE'  => 'Page 4',
  63.                                 'L_PAGE'  => 'Page 4'
  64.                             ))
  65.         );
"Bring forth therefore fruits meet for repentance:" Matthew 3:8

Publicar Información

  • Total de mensajes en este tema: 7 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 102 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC