News:

Join the Facebook Fan Page.

Main Menu

SMF Navigation menu

Started by Gmans, December 29, 2008, 04:21:54 AM

Previous topic - Next topic

Gmans

In smf 1.x nav.menu in themes/theme/index.template.php

// Show the [home] button.
 echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
  <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
  <a href="', $scripturl, '">' , $txt[103] , '</a>
  </td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

 // Show the [help] button.
 echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
  <td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
  <a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
  </td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
.........


In smf2 this no  :(
Where in smf2 is formed menu (theme directory)
Sorry, my English bad...
Можно по-русски! :Р
"Not so big the universe, as its source code ..." ^^

Tyrsson

The menu is called into location here:

// Show the menu here, according to the menu sub template.
template_menu();



The menu sub template is found at the bottom of the index.template.php file:


// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<div id="main_menu">
<ul class="clearfix">';

foreach ($context['menu_buttons'] as $act => $button)
{
echo '
<li id="button_', $act, '">
<a', $button['active_button'] ? ' class="active"' : '', ' title="', $act , '" href="', $button['href'], '">
<span', isset($button['is_last']) ? ' class="last"' : '', '>', ($button['active_button'] ? '<em>' : ''), $button['title'], ($button['active_button'] ? '</em>' : ''), '</span>
</a>
</li>';
}

echo '
</ul>
</div>';
}



PM at your own risk, some I answer, if they are interesting, some I ignore.

Gmans

Thank you
HM
But how do I be if I want to remove part a menu in one place, but part in other place :)
Можно по-русски! :Р
"Not so big the universe, as its source code ..." ^^

greyknight17

Is this issue resolved now?

If not, look for the menu navigation buttons in /Sources/Subs.php. Do a search for the below line of code and you will see the button codes a few lines down:

// All the buttons we can possible want and then some, try pulling the final list of buttons from cache first.

mint

Aha! this is what I've been looking for. I couldn't find it anywhere, I assume it has changed in version 2?

I've managed to remove the help and search buttons by deleting them from Subs.php thanks to your reply.

I'd like to remove 'my messages' too as there is already a link to this else where but I can't find it. I assume there is a file related to buttons that appear when logged or something.

Cheers,
John

mint

i've also just found out that altering Subs.php like this means mods refuse to touch it when installing so thats no good. Reverted back again for now.  :-\

greyknight17

Hi mint, welcome to SMF.

That's correct. Some mods need that file to install properly. In these cases, you can always install the mods manually if they have a conflict. I'm sure you will see conflicts in other files as well (not just Subs.php), but it's nothing to be alarmed about. It just means the code was probably changed by another mod and this mod can't do the code replacement automatically....will require your manual intervention to fix it.

Gmans

#7
Thank you. ;)
I have found other output:
Has Taken for example of the functions subs.php and has inserted them in index.template.... where it is necessary.
//usermenu                                                   
 if($context['user']['is_logged'])
 {
 echo '<td class="usermenu">';
 if ($context['allow_admin'])
 echo '<a href="', $scripturl, '?action=admin">' , $txt['admin'] , '</a>';
 if ($context['user']['can_mod'])
  echo '<a href="', $scripturl, '?action=moderate">', $txt['moderate'], '</a>';
 if ($context['allow_edit_profile'])
 echo '<a href="', $scripturl, '?action=profile">' , $txt['profile'] , '</a>';
  echo '<a href="', $scripturl, '?action=mlist">', $txt['members_title'], '</a>';
  echo '<a href="', $scripturl, '?action=pm">', $txt['pm_short'], '';
  if ($context['user']['unread_messages'] > 0)
  echo ' (<strong>'. $context['user']['unread_messages'] . '</strong>)';

Можно по-русски! :Р
"Not so big the universe, as its source code ..." ^^

Advertisement: