News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Notification from menu to forum

Started by NaneK, September 15, 2014, 05:00:38 AM

Previous topic - Next topic

NaneK

I'm trying to move number of mentions in posts, from menu to somewhere in forum.
I found this for displaying notifications in menu from Mentions.php file.

/**
* Callback for integrate_emnu_buttons
*
* @param array &$menu_buttons
* @return void
*/
function mentions_menu(array &$menu_buttons)
{
global $txt, $scripturl, $smcFunc, $user_info, $user_settings;

loadLanguage('Mentions');

$menu_buttons['profile']['sub_buttons']['mentions'] = array(
'title' => $txt['mentions'] . (!empty($user_settings['unread_mentions']) ? ' [' . $user_settings['unread_mentions'] . ']' : ''),
'href' => $scripturl . '?action=profile;area=mentions',
'show' => true,
);
$menu_buttons['profile']['title'] .=  (!empty($user_settings['unread_mentions']) ? ' [' . $user_settings['unread_mentions'] . ']' : '');
}


Now, how using this code can I display number of mentions somewhere else in forum eg. in user info?

If someones needs, here is the Mentions.php full code -> http://pastebin.com/ne7bLymF

kat

I assume that's some mod?

If so, try asking in the mod's support topic, as the author will know the code way better than we do. :)

Justyne

Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

NaneK

I'm sorry for opening topic in wrong section.
Anyway one of members helped me on private message.
I solved it :D

Thank you anyway :D

Advertisement: