menue mit untermenues

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • menue mit untermenues

    hallo forum

    ich habe in einem navigationsscript einige änderungen vorgenommen
    um die untermenues nur auszuklappen, wenn der entsprechende menuepunkt ausgewählt ist
    dies wird durch den wert der "aid" geregelt,
    welcher über die url übergeben wird
    also aid=4 == untermenue von punkt4 anzeigen

    natürlich soll das untermenue auch stehen bleiben, wenn man auf einen dessen punkte klickt
    dafür gibt es "pid" (parent_id), welche das dazugehörige menue ausgibt
    also pid=4 == untermenue von punkt4 anzeigen

    so weit die theorie...

    hier mal der code:
    PHP-Code:

    $article_id 
    = ( isset($HTTP_POST_VARS['aid']) ) ? 
    intval($HTTP_POST_VARS['aid']) : ( ( isset($HTTP_GET_VARS['aid']) )
     ? 
    intval($HTTP_GET_VARS['aid']) : );
    $parent_id = ( isset($HTTP_POST_VARS['pid']) ) ? 
    intval($HTTP_POST_VARS['pid']) : ( ( isset($HTTP_GET_VARS['pid']) ) 
    intval($HTTP_GET_VARS['pid']) : );

    //
    // Output page to template
    //
    $template->assign_vars(array(
        
    'L_NAVIGATION' => $lang['Navigation'],
        
    'L_SUBMIT_ARTICLE' => $lang['Submit_article']
        )
    );

    $template->set_filenames(array(
        
    'navigation' => 'cms_articles_navigate.tpl'
        
    )
    );


    if( 
    $chapter_id )
    {
        
    $is_auth = array();
        
    $is_auth cms_auth($chapter_id$userdata);
        if( 
    $is_auth['a_new'] )
        {
            
    $template->assign_block_vars('switch_submit', array(
                
    'U_SUBMIT_ARTICLE' => append_sid("cms_post_article.$phpEx?mode=new&cid=
    $chapter_id")
                )
            );
        }
    }


    for( 
    $i 0$i count($parent_chapter_row); $i++ )
    {
        
    $parent_chapter_id $parent_chapter_row[$i]['chapter_id'];
        
    $parent_chapter_name 
    $parent_chapter_row[$i]['chapter_name'];

        if( 
    $is_auth_parents[$parent_chapter_id]['a_view'] )
        {
            
    $template->assign_block_vars('chapterrow', array(
                
    'CHAPTER_NAME' => $parent_chapter_name,

                
    'U_VIEW_CHAPTER' => append_sid("portal.$phpEx?aid=$parent_chapter_id")
                )
            );

        if( 
    $article_id == $parent_chapter_row[$i]['chapter_id'] or 
    $parent_id == $parent_chapter_row[$i]['chapter_parent_id']) 
    // hab ich eingefügt 
                        
    {
            for( 
    $j 0$j count($child_chapter_row); $j++ )
            {
                
    $child_chapter_id $child_chapter_row[$j]['chapter_id'];
                
    $child_chapter_name $child_chapter_row[$j]['chapter_name'];

                if( 
    $is_auth_children[$child_chapter_id]['a_view'] )
                {
                
                    if( 
    $child_chapter_row[$j]['chapter_parent_id'] == $parent_chapter_id )
                    {

                        
    $template->assign_block_vars('chapterrow.subchapterrow', array(
                            
    'CHAPTER_NAME' => $child_chapter_name,

                            
    'U_VIEW_CHAPTER' => append_sid("portal.$phpEx?aid=
    $child_chapter_id?pid=$parent_chapter_id")
                            )
                        );
                        }
                    }
                }
            }
        }
    }

    $template->assign_var_from_handle('ARTICLES_NAV''navigation');

    ?> 
    ist nicht alles, aber das wesentliche...

    und hier das ergebnis:
    http://mona-davinci.de/phpbb/portal.php

    nur "bands" und "mackatree" haben schon inhalte und funfkionieren

    vielleicht hab ich ja auch nur einen ganz dummen fehler gemacht...

    kolja
    Zuletzt geändert von kolja82; 09.12.2006, 20:57.

  • #2
    Re: menue mit untermenues

    Bitte Regeln lesen, Code umbrechen.
    I don't believe in rebirth. Actually, I never did in my whole lives.

    Kommentar


    • #3
      ok gemacht,
      sorry ich dachte das bei euch im forum der code ein geklappt wird

      jetzt hoffe ich auf einen guten tipp

      kolja

      Kommentar

      Lädt...
      X