Customizing SMF > Modifications and Packages
6 Custom buttons / tabs and menu's (upto 4)
Inti31:
Have a look to the <file name="$sourcedir/ManageSettings.php"> in the 6custombuttons4.xml is included in the package
--- Code: --- //Custom Buttons - Johncccccc
//Button 1
$txt['button1'],
array('check', 'enable_custombuttons_1'),
array('text', 'label_custombuttons_1'), array('text', 'url_custombuttons_1'),
//Subs for button 1 - 8
array('text', 'label_subcustombuttons1_1'), array('text', 'url_subcustombuttons1_1'),
array('text', 'label_subcustombuttons1_2'), array('text', 'url_subcustombuttons1_2'),
array('text', 'label_subcustombuttons1_3'), array('text', 'url_subcustombuttons1_3'),
array('text', 'label_subcustombuttons1_4'), array('text', 'url_subcustombuttons1_4'),
array('text', 'label_subcustombuttons1_5'), array('text', 'url_subcustombuttons1_5'),
array('text', 'label_subcustombuttons1_6'), array('text', 'url_subcustombuttons1_6'),
array('text', 'label_subcustombuttons1_7'), array('text', 'url_subcustombuttons1_7'),
array('text', 'label_subcustombuttons1_8'), array('text', 'url_subcustombuttons1_8'),
--- End code ---
then see <file name="$sourcedir/Subs.php">
--- Code: --- 'custom1' => array(
'title' => !empty ($modSettings['label_custombuttons_1']) ? $modSettings['label_custombuttons_1'] : $txt['cb_default_1'],
'href' => !empty ($modSettings['url_custombuttons_1']) ? $modSettings['url_custombuttons_1'] : $scripturl,
'show' => $context['allow_custom_button1'] && !empty ($modSettings['enable_custombuttons_1']) ? true : false,
'sub_buttons' => array(
'subbutton1' => array(
'title' => !empty ($modSettings['label_subcustombuttons1_1']) ? $modSettings['label_subcustombuttons1_1'] : '',
'href' => !empty ($modSettings['url_subcustombuttons1_1']) ? $modSettings['url_subcustombuttons1_1'] : $scripturl,
'show' => !empty ($modSettings['label_subcustombuttons1_1']) ? true : false
),
'subbutton2' => array(
'title' => !empty ($modSettings['label_subcustombuttons1_2']) ? $modSettings['label_subcustombuttons1_2'] : '',
'href' => !empty ($modSettings['url_subcustombuttons1_2']) ? $modSettings['url_subcustombuttons1_2'] : $scripturl,
'show' => !empty ($modSettings['label_subcustombuttons1_2']) ? true : false
),
'subbutton3' => array(
'title' => !empty ($modSettings['label_subcustombuttons1_3']) ? $modSettings['label_subcustombuttons1_3'] : '',
'href' => !empty ($modSettings['url_subcustombuttons1_3']) ? $modSettings['url_subcustombuttons1_3'] : $scripturl,
'show' => !empty ($modSettings['label_subcustombuttons1_3']) ? true : false
),
'subbutton4' => array(
'title' => !empty ($modSettings['label_subcustombuttons1_4']) ? $modSettings['label_subcustombuttons1_4'] : '',
'href' => !empty ($modSettings['url_subcustombuttons1_4']) ? $modSettings['url_subcustombuttons1_4'] : $scripturl,
'show' => !empty ($modSettings['label_subcustombuttons1_4']) ? true : false
),
'subbutton5' => array(
'title' => !empty ($modSettings['label_subcustombuttons1_5']) ? $modSettings['label_subcustombuttons1_5'] : '',
'href' => !empty ($modSettings['url_subcustombuttons1_5']) ? $modSettings['url_subcustombuttons1_5'] : $scripturl,
'show' => !empty ($modSettings['label_subcustombuttons1_5']) ? true : false
),
'subbutton6' => array(
'title' => !empty ($modSettings['label_subcustombuttons1_6']) ? $modSettings['label_subcustombuttons1_6'] : '',
'href' => !empty ($modSettings['url_subcustombuttons1_6']) ? $modSettings['url_subcustombuttons1_6'] : $scripturl,
'show' => !empty ($modSettings['label_subcustombuttons1_6']) ? true : false
),
'subbutton7' => array(
'title' => !empty ($modSettings['label_subcustombuttons1_7']) ? $modSettings['label_subcustombuttons1_7'] : '',
'href' => !empty ($modSettings['url_subcustombuttons1_7']) ? $modSettings['url_subcustombuttons1_7'] : $scripturl,
'show' => !empty ($modSettings['label_subcustombuttons1_7']) ? true : false
),
'subbutton8' => array(
'title' => !empty ($modSettings['label_subcustombuttons1_8']) ? $modSettings['label_subcustombuttons1_8'] : '',
'href' => !empty ($modSettings['url_subcustombuttons1_8']) ? $modSettings['url_subcustombuttons1_8'] : $scripturl,
'show' => !empty ($modSettings['label_subcustombuttons1_8']) ? true : false
),
),
),
--- End code ---
at least: you need the language strings this section
<file name="$themedir/languages/Modifications.yourlanguage(-utf8).php">
--- Code: --- //Sub button 5
$txt['label_subcustombuttons1_5'] = '5th sub custom title';
$txt['url_subcustombuttons1_5'] = 'URL for 5th sub custom title';
//Sub button 6
$txt['label_subcustombuttons1_6'] = '6th sub custom title';
$txt['url_subcustombuttons1_6'] = 'URL for 6th sub custom title';
//Sub button 7
$txt['label_subcustombuttons1_7'] = '7th sub custom title';
$txt['url_subcustombuttons1_7'] = 'URL for 7th sub custom title';
//Sub button 8
$txt['label_subcustombuttons1_8'] = '8th sub custom title';
$txt['url_subcustombuttons1_8'] = 'URL for 8th sub custom title';
//End of button 1 and its sub menu items
--- End code ---
cheers Inti31
trekkie2444:
I'm guessing I have to enter the URLs myself in that last code block you put?
Inti31:
no, the urls you have to set in the admin area http:\\yourforum.url\index.php?action=admin;area=modsettings;sa=custombuttons;
Sweetwater:
Is there any upgrade in the pipeline for SMF2.0.2
I used this mod before upgrading, was very useful.
Thanks for any replies
Old Fossil:
--- Quote from: Sweetwater on June 17, 2012, 10:03:43 AM ---Is there any upgrade in the pipeline for SMF2.0.2
I used this mod before upgrading, was very useful.
Thanks for any replies
--- End quote ---
No need to wait.
The mod works perfectly on 2.0.2
Have a look @ the Mod Emulate link in my signature.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version