Advertisement:

Navigation

SMF Mod Site

Mod Name:
Menu without limit level
Created By:
davidhs
Type:
Feature Enhancement
First Created:
February 16, 2010, 08:51:54 AM
Last Modified:
September 26, 2015, 08:33:54 AM
Latest Version:
1.0.11
Compatible With:
2.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.0.10, 2.0.11
Total Downloads:
3675

Download this mod

MenuWithoutLimitLevel_1.0.7.tar.gz (3kB) [284]
MenuWithoutLimitLevel_1.0.8.tar.gz (2kB) [190]
MenuWithoutLimitLevel_1.0.9.tar.gz (3kB) [133]
MenuWithoutLimitLevel_1.0.10.tar.gz (3kB) [191]
MenuWithoutLimitLevel_1.0.11.tar.gz (3kB) [528]
Manual Install Instructions for SMF

Description:

Menu without limit level

ABOUT...

Menu without limit level, 1.0.11
© 2010-2015 by davidhs


This work is licensed under a Creative Commons Attribution 3.0 Unported License.

DESCRIPTION

Adds the possibility that the top menu of the forum has any number of levels.

Modifies:
  • Code which defines the menu to allow any number of levels.
  • Default theme to show up to 10 levels (main menu and 9 levels of submenus) because of CSS.


EXAMPLE

To create this menu, similar to the image,

Quote
Menu multi-level
  • Submenu 1 - level 1
    • Submenu 1.1 - level 2
      • Submenu 1.1.1 - level 3
      • Submenu 1.1.2 - level 3
    • Submenu 1.2 - level 2
      • Submenu 1.2.1 - level 3
      • Submenu 1.2.2 - level 3
    • Submenu 1.3 - level 2
  • Submenu 2 - level 1
    • Submenu 2.1 - level 2
    • Submenu 2.1 - level 2

can modify the file Sources/Subs.php

Quote
In function setupMenuContext() add code
Code: [Select]
'm0' => array(
'title' => 'Menu multi-level',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm1' => array(
'title' => 'Submenu 1 - level 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm11' => array(
'title' => 'Submenu 1.1 - level 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm111' => array(
'title' => 'Submenu 1.1.1 - level 3',
'href' => '',
'show' => true,
),
'm112' => array(
'title' => 'Submenu 1.1.2 - level 3',
'href' => '',
'show' => true,
),
),
),
'm12' => array(
'title' => 'Submenu 1.2 - level 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm121' => array(
'title' => 'Submenu 1.2.1 - level 3',
'href' => '',
'show' => true,
),
'm122' => array(
'title' => 'Submenu 1.2.2 - level 3',
'href' => '',
'show' => true,
),
),
),
'm13' => array(
'title' => 'Submenu 1.3 - level 2',
'href' => '',
'show' => true,
),
),
),
'm2' => array(
'title' => 'Submenu 2 - level 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm21' => array(
'title' => 'Submenu 2.1 - level 2',
'href' => '',
'show' => true,
),
'm22' => array(
'title' => 'Submenu 2.2 - level 2',
'href' => '',
'show' => true,
),
),
),
),
),

or use integration hooks

Quote
1. Create the file Sources/Subs-MenuMultiLevel.php with content
Code: [Select]
<?php

if (!defined('SMF'))
die('Hacking attempt...');

function 
menu_multi_level($buttons)
{
$buttons2 $buttons;
$buttons = array();
foreach ($buttons2 as $i => $b)
{
$buttons[$i] = $b;
if ('home' == $i)
{
'm0' => array(
'title' => 'Menu multi-level',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm1' => array(
'title' => 'Submenu 1 - level 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm11' => array(
'title' => 'Submenu 1.1 - level 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm111' => array(
'title' => 'Submenu 1.1.1 - level 3',
'href' => '',
'show' => true,
),
'm112' => array(
'title' => 'Submenu 1.1.2 - level 3',
'href' => '',
'show' => true,
),
),
),

'm12' => array(
'title' => 'Submenu 1.2 - level 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm121' => array(
'title' => 'Submenu 1.2.1 - level 3',
'href' => '',
'show' => true,
),
'm122' => array(
'title' => 'Submenu 1.2.2 - level 3',
'href' => '',
'show' => true,
),
),
),

'm13' => array(
'title' => 'Submenu 1.3 - level 2',
'href' => '',
'show' => true,
),
),
),

'm2' => array(
'title' => 'Submenu 2 - level 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm21' => array(
'title' => 'Submenu 2.1 - level 2',
'href' => '',
'show' => true,
),
'm22' => array(
'title' => 'Submenu 2.2 - level 2',
'href' => '',
'show' => true,
),
),
),

),
);

}
}

}

?>

2. In file Sources/Load.php, find
Code: [Select]
// Integration is cool.
if (defined('SMF_INTEGRATION_SETTINGS'))
{
$integration_settings = unserialize(SMF_INTEGRATION_SETTINGS);
foreach ($integration_settings as $hook => $function)
add_integration_function($hook, $function, false);
}
and add after
Code: [Select]
add_integration_function('integrate_menu_buttons', 'menu_multi_level', false);
add_integration_function('integrate_pre_include', '$boarddir/Sources/Subs-MenuMultiLevel.php', false);

SMF COMPATIBILITY

  • SMF 2.0 to 2.0.11.

DOWNLOAD

Link to MOD

MANUAL INSTALLATION

See http://wiki.simplemachines.org/smf/Manual_installation_of_mods

SUPPORT AND COMMENTS

In English: http://www.simplemachines.org/community/index.php?topic=369595.0
In Spanish: http://www.simplemachines.org/community/index.php?topic=367071.0

CHANGE LOG

Code: [Select]
Legend:   ! Fixed   + Added   - Removed   * Changed   @ Note

1.0.11  2014-01-24
------------------
! Error in source code.
+ SMF compatibility: 2.0.7.

1.0.10  2013-10-24
------------------
+ SMF compatibility: 2.0.6.

1.0.9   2013-08-18
------------------
@ This work is licensed under a Creative Commons Attribution 3.0 Unported License http://creativecommons.org/licenses/by/3.0/
+ SMF compatibility: 2.0.5.

1.0.8   2013-04-09
------------------
+ SMF compatibility: 2.0.4.
- SMF compatibility: Support to RC versions.

1.0.7   2012-12-22
------------------
+ SMF compatibility: 2.0.3.

1.0.6   2011-12-24
------------------
! Some modifications of index.css of theme are not neccesary.
+ SMF compatibility: 2.0.2.

1.0.5   2011-09-20
------------------
+ SMF compatibility: 2.0.1.

1.0.4   2011-06-18
------------------
+ SMF compatibility: 2.0.

1.0.3   2011-02-13
------------------
+ SMF compatibility: 2.0 RC5.

1.0.2   2010-11-04
------------------
+ SMF compatibility: 2.0 RC4.

1.0.1   2010-03-10
------------------
! In 2.0 RC2, levels 4 and more show and hide at a time.
+ SMF compatibility: 2.0 RC3.

1.0     2010-03-08
------------------
+ SMF compatibility: 2.0 RC2.
+ Themes: default.