News:

Join the Facebook Fan Page.

Main Menu

2 drop down menus

Started by Matt.B, July 24, 2010, 07:37:14 PM

Previous topic - Next topic

Matt.B

hi,

i like to make a drop down menu for forum so you would go over forum and calender, members would drop down having trouble that i took calender it had a drop down menu so like gives me an error

forum>
calender>
post
view


'forum' => array(
'title' => isset($txt['tp-forum']) ? $txt['tp-forum'] : 'Forum',
'href' => $scripturl . '?action=forum',
'show' => true,
'sub_buttons' => array(
'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,
),
    '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,
),
),

),


using smf 2.0 rc3 and THEME: inferno from dzinerstudio

mirahalo

try this way:

Code (php) Select
'forum' => array(
'title' => isset($txt['tp-forum']) ? $txt['tp-forum'] : 'Forum',
'href' => $scripturl . '?action=forum',
'show' => true,
'sub_buttons' => array(
'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,
),
),
),

    '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,
),
),

),

),

Matt.B

#2
hi,

thanks for fixing it

),
'forum' => array(
            'title' => isset($txt['tp-forum']) ? $txt['tp-forum'] : 'Forum',
            'href' => $scripturl . '?action=forum',
            'show' => true,
            'sub_buttons' => array(
         '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,
               ),
               ),
               ),
               
            '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,
               ),
            ),

         ),

         ),
'bans' => array(
'title' => 'Bans',
'href' => 'http://www.mywebsite.com',
'show' => true,
'sub_buttons' => array(
'Request/Report Ban' => array(
'title' => 'Request/Report Ban',
'href' => 'http://www.mywebsite.com',
'show' => allowedTo('post'),
),
'Contest Ban' => array(
'title' => 'Contest Ban',
'href' => 'http://www.mywebsite.com',
'show' => allowedTo('post'),
'is_last' => true,
),
),
),
'Stats' => array(
'title' => 'Stats',
'href' => 'http://www.mywebsite.com',
'show' => true,
'sub_buttons' => array(
                ),

                        ),
'Servers' => array(
'title' => 'Servers',
'href' => 'http://www.mywebsite.com',
'show' => true,
'sub_buttons' => array(
),

                ),
'Arcade' => array(
'title' => 'Arcade',
'href' => 'http://www.mywebsite.com',
'show' => true,
'sub_buttons' => array(
),

                        ),
'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']),
),
'poststopics' => array(
'title' => $txt['mc_unapproved_poststopics'],
'href' => $scripturl . '?action=moderate;area=postmod;sa=posts',
'show' => $modSettings['postmod_active'],
),
'attachments' => array(
'title' => $txt['mc_unapproved_attachments'],
'href' => $scripturl . '?action=moderate;area=attachmod;sa=attachments',
'show' => $modSettings['postmod_active'],
),
'reports' => array(
'title' => $txt['mc_reported_posts'],
'href' => $scripturl . '?action=moderate;area=reports',
'show' => true,
'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,
),
),
),
'tpadmin' => array(
'title' => 'TP',
'href' => $scripturl . '?action=tpadmin',
'show' =>  TPcheckAdminAreas(),
'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'],
),
);


// tinyportal //
$buttons['tpadmin']['sub_buttons'] = tp_getbuttons();


i get this error now

Parse error: syntax error, unexpected ';', expecting ')' in /home/mattb/public_html/Sources/Subs.php on line 4126

that code is 4126 php code.

mirahalo

a little typo, try this:



'forum' => array(
'title' => isset($txt['tp-forum']) ? $txt['tp-forum'] : 'Forum',
'href' => $scripturl . '?action=forum',
'show' => true,
'sub_buttons' => array(
'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,
),
),
),

    '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,
),
),

),

),
),



Advertisement: