1. In index.template.php
There are two ways to do this. This first method is the recommended one.
First method
if ($context['current_action'] == 'search2')
$current_action = 'search'; if ($context['current_action'] == 'chat')
$current_action = 'chat';Second Method
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))As you can see it has a list of the actions in the menu. What we are going to do is add , 'chat' after 'pm'. Each action in the array is separated by a comma and enclosed in single quotes ('). It should look like this.
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'chat')))The next step is adding the link itself. This is an example of the home menu.
2. In the same file
// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </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 . '"> </td>' : '';- $current_action=='home' - is what sets the tab for the current actions. As you can see it is defined in 3 instances. You will need to change it for all three of them.
- ' , $txt[103] , ' - is the text string that prints Home on the Main menu. As you see the variable is inside ' , , '. The reason for this is because it's inside an echo. If you are going to hard code the name in the menu you do not need to put ' , , ' around it.
This is how it should look with the made changes.
// Show the [chat] button.
echo ($current_action=='chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=chat">Chat</a>
</td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '"> </td>' : '';If you want to be neat about it and add support for other languages add this string to /Themes/default/languages/index.english.php and to any other language file that you want to add it to. ie. /Themes/default/languages/index.{language}.php and change Chat to the translated string.
$txt['chat'] = 'Chat';
For Support please take a look at this topic.

How do you add custom tabs to the Core (default) theme menu?


How can I add a link in to main forum manu but to open (flash chat) that link in a new window of my own dimensions (500px, 400px)

Thank you for your time and help
Tomislav