News:

Wondering if this will always be free?  See why free is better.

Main Menu

Menu Editor Lite

Started by Matthew K., March 06, 2012, 01:05:26 PM

Previous topic - Next topic

Badboy

Quote from: FireDitto on December 14, 2012, 03:02:18 AM

What editing would be required to put the count for Personal Messages back in the menu? It's being heavily missed.

Thank you.

Quote from: Greybrow on May 01, 2012, 07:52:11 PM
I just love this menu editor. It made my life a lot easier.
But I wanted to have pm count on menu, so I hacked a bit and found a solution.

in Sources\menu_source\resources\main.php (should be line 899) change:
$buttons[$value['id_button']] = array(
'title' => $value['name'],
'href' => $value['href'],
'show' => true,
'target' => $value['target'],
'sub_buttons' => array(
),
'is_last' => $value['id_button'] == $menu_editor['last_button'] ? !$context['right_to_left'] : '',
'level' => 0
);
// Do we have Children?
if (!empty($menu_editor['children']['actual'][$value['id_button']]))
{
$buttons[$value['id_button']]['sub_buttons'] = array();
foreach ($menu_editor['children']['actual'][$value['id_button']] as $act => $sub_value)
{
// Introduce the Grandchildren - If we have any.
if (!empty($menu_editor['grandchildren']['actual'][$sub_value['id_button']]))
$temp[$sub_value['id_button']]['sub_buttons'] = $menu_editor['grandchildren']['actual'][$sub_value['id_button']];
else
$temp[$sub_value['id_button']]['sub_buttons'] = array();

// Actually add the Children!
$buttons[$sub_value['id_parent']]['sub_buttons'][$sub_value['id_button']] = array(
'title' => $sub_value['title'],

to:
// lets check if there are some unread pm and add the count if any
$title = '';
if ($context['user']['unread_messages'] > 0 && $value['href'] == $scripturl . '?action=pm')
$title = $value['name'] .' [<strong>' . $context['user']['unread_messages'] . '</strong>]';
else
$title = $value['name'];
// there goes the menu item
$buttons[$value['id_button']] = array(
'title' => $title,
'href' => $value['href'],
'show' => true,
'target' => $value['target'],
'sub_buttons' => array(
),
'is_last' => $value['id_button'] == $menu_editor['last_button'] ? !$context['right_to_left'] : '',
'level' => 0
);
// Do we have Children?
if (!empty($menu_editor['children']['actual'][$value['id_button']]))
{
$buttons[$value['id_button']]['sub_buttons'] = array();
foreach ($menu_editor['children']['actual'][$value['id_button']] as $act => $sub_value)
{
// lets check again if there are some unread pm and add the count if any to children
$title = '';
if ($context['user']['unread_messages'] > 0 && $sub_value['href'] == $scripturl . '?action=pm')
$title = $sub_value['title'] .' [<strong>' . $context['user']['unread_messages'] . '</strong>]';
else
$title = $sub_value['title'];
// Introduce the Grandchildren - If we have any.
if (!empty($menu_editor['grandchildren']['actual'][$sub_value['id_button']]))
$temp[$sub_value['id_button']]['sub_buttons'] = $menu_editor['grandchildren']['actual'][$sub_value['id_button']];
else
$temp[$sub_value['id_button']]['sub_buttons'] = array();

// Actually add the Children!
$buttons[$sub_value['id_parent']]['sub_buttons'][$sub_value['id_button']] = array(
'title' => $title,


It adds unread pm counter to menu item if you set it as internal link to personal messages.
I claim no copyright (it all goes to Labradoodle-360) and give no warranty that it works or destroys your forum.
But it works for me so I hope it helps.
Nothing is true, everything is permitted.

FireDitto

Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Silvershark78

OK. because I am trying to get this fixed ASAP because it messed things up, I ma using the most recent version of simple portal. It erased the Forum button. I tried an internal link and it is not there. It also erased the gallery button for smf hacks pro gallery. I set both of these up as external links but is there a quick fix to this. Im sorry I didnt read but I have members complaining within like 60 seconds of install. Thanks
Still have lots to learn

Matthew K.

You can add the forum as an external link, with your forum URL such as: http://yourdomain.com/forum_path/index.php?action=forum and it will automatically be highlighted if you're not on the portal homepage or another action that's on the menu.

Note for the gallery button, it's custom permissions will not be added in, unfortunately. But you can put your own permissions on it which should be fairly comparable.

Silvershark78

Yeah I just did an external link to it too. Do the external links for the buttons open me up for security issues. I asume not. Just curious
Still have lots to learn

Matthew K.

No, they do not open up any security issues. The only difference is "Internal Links" automatically select their associated SMF permissions, and make it easy for you by not needing a URL. While external links to not automatically gain their associated SMF Permissions and you have to type the link.

Skaty

when i install this mod it is deleting my other pages. Any idea to fix ?




Kindred

you have to add them into the list
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Skaty

Quote from: Kindred on January 11, 2013, 03:13:57 PM
you have to add them into the list

Oh, sorry my bad. 

Now i'm adding them but i change the name of personal message tab and now it is not given me the sign when new pm is came ?

Kindred

and, as far as I know, it will not...    if you read back in this thread, you will note that the author has indicated just that
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

FireDitto

The code offered in the post at the top of this page gives a replacement to make PMs appear in the menu. Link
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Skaty

#291
Thank you @FireDitto.            @Kindred, now i understand your post :) my english isn't s good for sarcasms sorry :D i should read at least this page you right.

Skaty

btw can we give a color for this little notification :)

IchBin™

Quote from: Skaty on January 15, 2013, 04:48:07 AM
btw can we give a color for this little notification :)

Of course you can. You just add something like a span tag with color attribute around the text.

<strong><span style="color: red;">' . $context['user']['unread_messages'] . '</span></strong>
IchBin™        TinyPortal

Skaty


FireDitto

o_O

Somewhere along the line I did something, and it's killed my ability to add children; the bar has been bitten off at 'Childre' >>

Where will I have screwed this up? I know its not in any of the 'menu_source' since I overlaid that with a healthy set of files from the test site.

Thanks x.x
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Matthew K.

Any errors in the error log? Screenshot? Link?

FireDitto

No, there doesn't appear to be any errors in the log.

Ah, a screen shot; Link.
I have tried on all layouts; it isn't just that one on which is it not appearing correctly. I tried uninstalling and reinstalling, so I'm not quite sure what's going on. o_O

At the moment I'm just adding children as needed via;
?action=admin;area=menueditor;sa=add;parent=## where ## is the parent menu item's ID.
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

electricwildflower

i must congratulate you on this it's fantastic i have just come across it and it's much better than editing subs.php but i have some questions.

What i want to do is have a drop down menu to forum sections example below

I create a button called Forum and under this i want a sub menu which has the names of all my forum categories and under each category there will be buttons to link to sections of the forum example below.

General (this is just a menu name)
           Shout (this is a link)
           General Discussion (this is a link)
           Arguments (this is a link)

Music (this is just a menu name)
         goth rock (this is a link)
         deathrock (this is a link)
         post-punk (this is a link)
         other (this is a link)

and so on

This way it will be easier for my members to navigate through the forums so can i add a menu name which does nothing but drops down to the categories if you get me ?

Kindred

the trick is - if you must have a link to trigger the drop down, use "#" (with no quotes)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: