News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Menu without limit level

Started by davidhs, March 08, 2010, 03:47:03 PM

Previous topic - Next topic

handy1

Now I understand what is the problem. It's not the colour. Buttons background is transparent...that makes messy, because long button list goes over forum categories.

So how I can make it no transparent :-\

davidhs

Quote from: handy1 on January 06, 2014, 10:59:13 AM
Now I understand what is the problem. It's not the colour. Buttons background is transparent...that makes messy, because long button list goes over forum categories.

So how I can make it no transparent :-\
Perhaps, on CSS
background-color: ...

handy1

#62
It's good background up to 9 buttons, but after 10---> it's transparent and hard to read.

- Stretch your background image?
- Some code like "repeat"?


E: No time to wait answer so I tried it. You gave image .png for me and I stretched it 3 times longer and now it works.

davidhs

I think the rule
.dropmenu li li.additional_items
{
background-color: #fff;
}

is for this.

handy1

Now I've two menu ready.

My site

But I can't work with third level buttons. I don't know why it doesn't work. I copied this topic first posts code what include third level buttons (right?) and used it.

If someone could write test code for me example:

Menu name: TEST
LEVEL 1: TEST1
LEVEL 2: TEST2
LEVEL 3: TEST3

So I can try it tomorrow..

Thanks ;)

davidhs

Quote from: handy1 on January 09, 2014, 03:08:17 PM
Now I've two menu ready.

My site

But I can't work with third level buttons. I don't know why it doesn't work. I copied this topic first posts code what include third level buttons (right?) and used it.

If someone could write test code for me example:

Menu name: TEST
LEVEL 1: TEST1
LEVEL 2: TEST2
LEVEL 3: TEST3

So I can try it tomorrow..

Thanks ;)

You forum is SMF 2.0.6 and you can use integration hooks. Do this:
Quote from: davidhs on March 08, 2010, 03:47:03 PM
Quote1. Create the file Sources/Subs-MenuMultiLevel.php with content
<?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
// 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
add_integration_function('integrate_menu_buttons', 'menu_multi_level', false);
add_integration_function('integrate_pre_include', '$boarddir/Sources/Subs-MenuMultiLevel.php', false);

davidhs

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



MyTime

I'v tried too use the parse version for the install of this mod and it brought me too a page of codes, I tried too install the codes, but it did not seem too work, any tips or advice?

davidhs

Quote from: CannabisGamerClub on November 07, 2014, 01:58:55 AM
I'v tried too use the parse version for the install of this mod and it brought me too a page of codes, I tried too install the codes, but it did not seem too work, any tips or advice?
I do not understand your problem. Can you not install it on your forum? What is your version of SMF? This mod can be install on default theme (and perhaps others themes).

MyTime

getting these in the console but idk if its related too the problem, When I go to add a page, i click internal or external but it doesn't give me the option too add the link for the button, wont let me add the button.

Failed to load resource: the server responded with a status of 404 (Not Found) http://forum.cannabisgamerclub.com/Themes/zGames/css/menu_css/main.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://forum.cannabisgamerclub.com/Themes/zGames/scripts/menu_scripts/main.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://forum.cannabisgamerclub.com/Themes/zGames/images/slide/slider6.jpg
Uncaught ReferenceError: addButtonJS is not defined index.php?action=admin;area=menueditor;sa=add;e7953d8c0=fbcb8a11436c1967dc018d9bfeab674e:115
Failed to load resource: the server responded with a status of 404 (Not Found) http://forum.cannabisgamerclub.com/Themes/zGames/css/menu_css/main.css

davidhs

Quote from: CannabisGamerClub on November 22, 2014, 03:20:58 AM
getting these in the console but idk if its related too the problem, When I go to add a page, i click internal or external but it doesn't give me the option too add the link for the button, wont let me add the button.

Failed to load resource: the server responded with a status of 404 (Not Found) http://forum.cannabisgamerclub.com/Themes/zGames/css/menu_css/main.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://forum.cannabisgamerclub.com/Themes/zGames/scripts/menu_scripts/main.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://forum.cannabisgamerclub.com/Themes/zGames/images/slide/slider6.jpg
Uncaught ReferenceError: addButtonJS is not defined index.php?action=admin;area=menueditor;sa=add;e7953d8c0=fbcb8a11436c1967dc018d9bfeab674e:115
Failed to load resource: the server responded with a status of 404 (Not Found) http://forum.cannabisgamerclub.com/Themes/zGames/css/menu_css/main.css
I am sorry, I do not understand the problem. This mod not add JavaScript (like addButtonJS). Perhaps you have installed other mod and my mod do not work with this... I do not know...

If you can, put images of screen with steps.

MyTime

#73
Did you want steps of the install?
I did some of the problem I get

davidhs

I install "Menu Editor Lite" mod http://custom.simplemachines.org/mods/index.php?mod=3310 in my test forum and these mods are incompatible :( You can not install both in your forum.

"Menu Editor Lite" mod allow easy edit menu buttom, but only two levels.

"Menu without limit level" mod allow multi level. In first post of this topic http://www.simplemachines.org/community/index.php?topic=369595.0 you can see an example for edit menu button using PHP code.

davidhs

To moderators: Text to move to first post
QuoteSubject:
QuoteMenu without limit level, 1.0.11 (SMF 2.0-2.0.10)
Body:
Quote
Link to Mod




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,

QuoteMenu 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

QuoteIn function setupMenuContext() add code
'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

Quote1. Create the file Sources/Subs-MenuMultiLevel.php with content
<?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
// 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
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.10.

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

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.





Compatible with SMF 2.0.10.

DenDen60

I receive this message when I installed the latest version on 2.0.10


Execute Modification./Themes/core/index.template.phpTest failed

1.Replace./Themes/core/index.template.phpTest failed

Execute Modification./Themes/core/css/index.cssTest failed

1.Replace./Themes/core/css/index.cssTest failed

2.Replace./Themes/core/css/index.cssTest failed

I do have a two MODs installed:

EZportal
Footer Menu

and use the default theme for SMF

DenDen60

I installed one on a SMF version where no other MODs were installed.  (v.2.0.9) and I got the same message.

I installed it anyway and it did installed alright even if I had the same messages.  However, there is no  place where I see where I can create a menu. :-(

davidhs

Quote from: Denis Pageau on August 08, 2015, 12:30:50 PM
I receive this message when I installed the latest version on 2.0.10


Execute Modification./Themes/core/index.template.phpTest failed

1.Replace./Themes/core/index.template.phpTest failed

Execute Modification./Themes/core/css/index.cssTest failed

1.Replace./Themes/core/css/index.cssTest failed

2.Replace./Themes/core/css/index.cssTest failed

I do have a two MODs installed:

EZportal
Footer Menu

and use the default theme for SMF

Quote from: Denis Pageau on August 08, 2015, 10:03:01 PM
I installed one on a SMF version where no other MODs were installed.  (v.2.0.9) and I got the same message.

I installed it anyway and it did installed alright even if I had the same messages.  However, there is no  place where I see where I can create a menu. :-(
This mod only install in default theme of SMF 2.0.x series. If you uses this theme do not worry, you do not need install in core theme.

Core theme of SMF 2.0.x series is similar to default theme of SMF 1.1.x series and this mod do not works in this.

DenDen60

Quotehis mod only install in default theme of SMF 2.0.x series.

This is what I did, but I did receive the message and event when installed, it did not work, or at least I could not find the place to create the menu ( I used your MOD about a year ago and it worked. I am now ready to use it and for some reason it does want to show me where to change it.

Maybe I will try to do it manually.

Advertisement: