I have to say that the default theme curve of SMF 2.0 is more beautiful than the previous theme! However, his main menu (Tab) button seems a little more, so now let's customize it.
Let's take a look at the main menu before customization:
Home Page, help, search, management, monitoring center, personal data, my messages, members, logout
Now let's get started with modification!
FTP path:/sources/subs. php
Find this line://
All the buttons we can possible want and then some, try pulling the final list of buttons from cache first
The following code is displayed:'home'
=> array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),
'search' => array(
'title' => $txt['search'],
'href' => $scripturl . '?action=search',
'show' => $context['allow_search'],
'sub_buttons' => array(
),
),
Here, home, help, and search correspond to the homepage, help, and search buttons on the main menu. You only need to add them according to their format and order.
For example, home
'Home' => array (// This 'home' is the button name and is not displayed on the interface.
'Title' => $ TXT ['home'], // The displayed text can use global variables or strings.
'Href '=> $ scripturl, // This is the URL to which
'Show' => true, // if it is set to true, the button is displayed. If it is set to false, the button is hidden.
'Sub _ Buttons' => array (// 'sub _ Buttons' is left blank here. If you need a drop-down menu, you need to fill in the content in array ().
),
'Is _ last' => $ context ['right _ to_left '],
),
Modify the drop-down menu (sub_buttons:
Check the code of the 'ps' button:'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,
),
),
),
In 'sub _ Buttons' => array (), the sub-menu code entered in the brackets is the same as the code format of the normal menu. Therefore, you only need to fill in the brackets of 'sub _ Buttons' => array () to implement the sub-menu function.