#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Location
    Rhyl Wales
    Posts
    1
    Rep Power
    0

    Exclamation Adding buttons to my php menu


    Hello everyone i need some support if anyone can help me i am new to php so bare with me. Anyway i have a php menu which is linked into my SMF forums and i am trying to get this code added which will link to the FAQ section.

    i have removed the urls due to being a new member and it won't let me add them.

    Anyway the code below is my code and under that is the code i want added to the support section of the menu so it sits nicly as a drop down button. I have tried and tried to add it but it keeps failing and i know i am going wrong somewhere.

    The Menu Code

    PHP Code:
    'home' => array(
                    
    'title' => 'home',
                    
    'href' => '',
                    
    'show' => true,
                    
    'sub_buttons' => array(
                        
    'Website main' => array(
                            
    'title' => 'Main',
                            
    'href' => '',
                            
    'show' => true,
                        ),
                        
    'forum home' => array(
                            
    'title' => 'Forum index',
                            
    'href' => '',
                            
    'show' => true, ), ),



                
                
                ),
                
    'admin' => array(
                    
    'title' => $txt['admin'],
                    
    'href' => $scripturl '?action=admin',
                    
    'show' => $context['allow_admin'],
                    
    'sub_buttons' => array(
                        
    'featuresettings' => array(
                            
    'title' => $txt['modSettings_title'],
                            
    'href' => $scripturl '?action=admin;area=featuresettings',
                            
    'show' => allowedTo('admin_forum'),
                        ),
                        
    'packages' => array(
                            
    'title' => $txt['package'],
                            
    'href' => $scripturl '?action=admin;area=packages',
                            
    'show' => allowedTo('admin_forum'),
                        ),
                        
    'errorlog' => array(
                            
    'title' => $txt['errlog'],
                            
    'href' => $scripturl '?action=admin;area=logs;sa=errorlog;desc',
                            
    'show' => allowedTo('admin_forum') && !empty($modSettings['enableErrorLogging']),
                        ),
                        
    'permissions' => array(
                            
    'title' => $txt['edit_permissions'],
                            
    'href' => $scripturl '?action=admin;area=permissions',
                            
    'show' => allowedTo('manage_permissions'),
                            
    'is_last' => true,
                        ),
                    ),
                ),
                
    'moderate' => array(
                    
    'title' => $txt['moderate'],
                    
    'href' => $scripturl '?action=moderate',
                    
    'show' => $context['allow_moderation_center'],
                    
    'sub_buttons' => array(
                        
    'modlog' => array(
                            
    'title' => $txt['modlog_view'],
                            
    'href' => $scripturl '?action=moderate;area=modlog',
                            
    'show' => !empty($modSettings['modlog_enabled']) && !empty($user_info['mod_cache']) && $user_info['mod_cache']['bq'] != '0=1',
                        ),
                        
    'poststopics' => array(
                            
    'title' => $txt['mc_unapproved_poststopics'],
                            
    'href' => $scripturl '?action=moderate;area=postmod;sa=posts',
                            
    'show' => $modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']),
                        ),
                        
    'attachments' => array(
                            
    'title' => $txt['mc_unapproved_attachments'],
                            
    'href' => $scripturl '?action=moderate;area=attachmod;sa=attachments',
                            
    'show' => $modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']),
                        ),
                        
    'reports' => array(
                            
    'title' => $txt['mc_reported_posts'],
                            
    'href' => $scripturl '?action=moderate;area=reports',
                            
    'show' => !empty($user_info['mod_cache']) && $user_info['mod_cache']['bq'] != '0=1',
                            
    'is_last' => true,
                        ),
                    ),
                ),
                
    'profile' => array(
                    
    'title' => $txt['profile'],
                    
    'href' => $scripturl '?action=profile',
                    
    'show' => $context['allow_edit_profile'],
                    
    'sub_buttons' => array(
                        
    'summary' => array(
                            
    'title' => $txt['summary'],
                            
    'href' => $scripturl '?action=profile',
                            
    'show' => true,
                        ),
                        
    'account' => array(
                            
    'title' => $txt['account'],
                            
    'href' => $scripturl '?action=profile;area=account',
                            
    'show' => allowedTo(array('profile_identity_any''profile_identity_own''manage_membergroups')),
                        ),
                        
    'profile' => array(
                            
    'title' => $txt['forumprofile'],
                            
    'href' => $scripturl '?action=profile;area=forumprofile',
                            
    'show' => allowedTo(array('profile_extra_any''profile_extra_own')),
                            
    'is_last' => true,
                        ),
                    ),
                ),
                
    'pm' => array(
                    
    'title' => $txt['pm_short'],
                    
    'href' => $scripturl '?action=pm',
                    
    'show' => $context['allow_pm'],
                    
    'sub_buttons' => array(
                        
    'pm_read' => array(
                            
    'title' => $txt['pm_menu_read'],
                            
    'href' => $scripturl '?action=pm',
                            
    'show' => allowedTo('pm_read'),
                        ),
                        
    'pm_send' => array(
                            
    'title' => $txt['pm_menu_send'],
                            
    'href' => $scripturl '?action=pm;sa=send',
                            
    'show' => allowedTo('pm_send'),
                            
    'is_last' => true,
                        ),
                    ),
                ),
                
    'calendar' => array(
                    
    'title' => $txt['calendar'],
                    
    'href' => $scripturl '?action=calendar',
                    
    'show' => $context['allow_calendar'],
                    
    'sub_buttons' => array(
                        
    'view' => array(
                            
    'title' => $txt['calendar_menu'],
                            
    'href' => $scripturl '?action=calendar',
                            
    'show' => allowedTo('calendar_post'),
                        ),
                        
    'post' => array(
                            
    'title' => $txt['calendar_post_event'],
                            
    'href' => $scripturl '?action=calendar;sa=post',
                            
    'show' => allowedTo('calendar_post'),
                            
    'is_last' => true,
                        ),
                    ),
                ),
    'Radio' => array(
                    
    'title' => 'Radio',
                    
    'href' => '',
                    
    'show' => true,
                    
    'sub_buttons' => array(
                        
    'Keep it Radio' => array(
                            
    'title' => 'Keep it Radio',
                            
    'href' => '',
                            
    'show' => true,
                        ),
                        
    'Other Radio' => array(
                            
    'title' => 'Other Radio',
                            
    'href' => '',
                            
    'show' => true,

    ),
                    ),
                ),

    'Links' => array(
                    
    'title' => 'Links',
                    
    'href' => '',
                    
    'show' => true,
                    
    'sub_buttons' => array(
                        
    'Various Links' => array(
                            
    'title' => 'Various Links',
                            
    'href' => '',
                            
    'show' => true,

                    

                        ),
                    ),
                ),

                
    // Aeva Media changes
                
    'media' => array(
                    
    'title' => (isset($txt['aeva_gallery']) ? $txt['aeva_gallery'] : 'Media') . (!allowedTo('aeva_access_unseen') || empty($user_info['aeva_unseen']) || $user_info['aeva_unseen'] == -'' ' [<b>' $user_info['aeva_unseen'] . '</b>]'),
                    
    'href' => $scripturl '?action=media',
                    
    'show' => allowedTo('aeva_access'),
                    
    'sub_buttons' => !allowedTo('aeva_access_unseen') || empty($user_info['aeva_unseen']) || $user_info['aeva_unseen'] == -? array() : array(
                        
    'aeva_home' => array(
                            
    'title' => $txt['aeva_home'],
                            
    'href' => $scripturl '?action=media',
                            
    'show' => true,
                        ),
                        
    'aeva_unseen' => array(
                            
    'title' => $txt['aeva_unseen'],
                            
    'href' => $scripturl '?action=media;sa=unseen',
                            
    'show' => true,
                            
    'is_last' => true,
                        ),
                    ),
                ),
                
    // End Aeva Media changes
                
    'mlist' => array(
                    
    'title' => $txt['members_title'],
                    
    'href' => $scripturl '?action=mlist',
                    
    'show' => $context['allow_memberlist'],
                    
    'sub_buttons' => array(
                        
    'mlist_view' => array(
                            
    'title' => $txt['mlist_menu_view'],
                            
    'href' => $scripturl '?action=mlist',
                            
    'show' => true,
                        ),
                        
    'mlist_search' => array(
                            
    'title' => $txt['mlist_search'],
                            
    'href' => $scripturl '?action=mlist;sa=search',
                            
    'show' => true,
                            
    'is_last' => true,
                        ),
    ),
    ),

    'Shops' => array(
                    
    'title' => 'Shops',
                    
    'href' => '',
                    
    'show' => true,
                    
    'sub_buttons' => array(
                        
                
    'Other Shops' => array(
                    
    'title' => 'Online Shops',
                    
    'href' => '',
                    
    'show' => true,
                    
    'sub_buttons' => array(
                    ),
    ),
                    ),
                ),

    'support' => array(
                    
    'title' => 'support',
                    
    'href' => '',
                    
    'show' => true,
                    
    'sub_buttons' => array(
                        
    'Info' => array(
                            
    'title' => 'Info',
                            
    'href' => '',
                            
    'show' => true,
                        ),
                
    'help' => array(
                    
    'title' => $txt['help'],
                    
    'href' => $scripturl '?action=help',
                    
    'show' => true,
                    
    'sub_buttons' => array(
                    ),
    ),
                
    'Donate' => array(
                    
    'title' => 'Donate',
                    
    'href' => '',
                    
    'show' => true,
                    
    'sub_buttons' => array(
                    ),
    ),
                           
    'contact' => array(
                    
    'title' => 'Contact',
                    
    'href' => '',
                    
    'show' => true,
                    
    'sub_buttons' => array(
                    ),
    ),
                
    'What we Support' => array(
                    
    'title' => 'What we support',
                    
    'href' => '',
                    
    'show' => true,
                    
    'sub_buttons' => array(
    ),
    ),

    'search' => array(
                    
    'title' => $txt['search'],
                    
    'href' => $scripturl '?action=search',
                    
    'show' => $context['allow_search'],
                    
    'sub_buttons' => array(

                    ),
    ),
                                     ),
                             
                ),
            
    'login' => array(
                    
    'title' => $txt['login'],
                    
    'href' => $scripturl '?action=login',
                    
    'show' => $user_info['is_guest'],
                    
    'sub_buttons' => array(
                    ),
                ),
                
    'register' => array(
                    
    'title' => $txt['register'],
                    
    'href' => $scripturl '?action=register',
                    
    'show' => $user_info['is_guest'],
                    
    'sub_buttons' => array(
                    ),
                    
    'is_last' => !$context['right_to_left'],
                ),
                
    'logout' => array(
                    
    'title' => $txt['logout'],
                    
    'href' => $scripturl '?action=logout;%1$s=%2$s',
                    
    'show' => !$user_info['is_guest'],
                    
    'sub_buttons' => array(
                    ),
                    
    'is_last' => !$context['right_to_left'],
                ),
            ); 
    what i want adding

    PHP Code:
    'faq' => array(
                
    'title' => self::$faq->get('title_main''Text'),
                
    'href' => $scripturl '?action=faq',
                
    'show' => allowedTo('faqperview'),
                
    'sub_buttons' => array(
                    
    'faqmod_admin' => array(
                        
    'title' => self::$faq->get('manage''Text'),
                        
    'href' => $scripturl '?action=faq;sa=manage',
                        
    'show' => allowedTo('faqperedit'),
                        
    'sub_buttons' => array(
                            
    'faqmod_add' => array(
                                
    'title' => self::$faq->get('add_send''Text'),
                                
    'href' => $scripturl '?action=faq;sa=add',
                                
    'show' => allowedTo('faqperedit'),
                            ),
                        ),
                    ),
                    
    'faqmod_category' => array(
                        
    'title' => self::$faq->get('manage_category''Text'),
                        
    'href' => $scripturl '?action=faq;sa=managecat',
                        
    'show' => allowedTo('faqperedit'),
                        
    'sub_buttons' => array(
                            
    'faqmod_add' => array(
                                
    'title' => self::$faq->get('addcat_send''Text'),
                                
    'href' => $scripturl '?action=faq;sa=addcat',
                                
    'show' => allowedTo('faqperedit'),
                            ),
                        ),
                    ),
                ),
            ) 
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,496
    Rep Power
    594
    It keeps failing because something is wrong. That is about the best answer I can give based on what you posted.

    All you show is a bunch of multidimensional arrays and nothing about how you generate the HTML. In addition "it keeps failing" tells us absolutely nothing.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    677
    Rep Power
    7
    If I caught this right, it appears u r adding 3 sets of 3 items. To narrow this down is easy. Just type 1 set in at a time to narrow to a set, then only 1 line at a time to at least norrow your issue to a single line/statement.

IMN logo majestic logo threadwatch logo seochat tools logo