MyBB Community Forums

Full Version: How to display Private Message on an envelop icon instead of a msg?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I don't want to show on the pange ' You have a private message from ..'

But I want to add a envelop icon (a mail box) on the header to show there is one msg.

See two screenshots
This variable
{$mybb->user['pms_unread']}
displays only the unread PM Count.

I have made a fiddle for you to show how it works. Replace the hardcoded number with the variable:
https://jsfiddle.net/effone/h29rafht/
(2018-04-09, 03:35 AM)effone Wrote: [ -> ]This variable
{$mybb->user['pms_unread']}
displays only the unread PM Count.

I have made a fiddle for you to show how it works. Replace the hardcoded number with the variable:
https://jsfiddle.net/effone/h29rafht/

That is so cute!!

Where should I replace the code? Like which file should I put the HTML and CSS you created for me. 
Thank you so much.
Header Templates > header_welcomeblock_member
Place it suitably. Position using CSS...

Put the CSS in global.css. Don't include body {....} declaration, that was for the demo.
(2018-04-09, 11:58 AM)effone Wrote: [ -> ]Header Templates > header_welcomeblock_member
Place it suitably. Position using CSS...

Put the CSS in global.css. Don't include body {....} declaration, that was for the demo.

Works great. 

1 issue:

if I have 1 unread message, it won't show next to Favicon on the search engine bar ( I am using Chrome)

How to add there a '(1)' next to the title on the bar.
To add the number (1) in header bar , you need to add the unread PM code in title bar,
 {$mybb->user['pms_unread']}

You can either edit templates and add this or use a Javascript Dom manipulation to add it on all pages without editing title page.
(2018-04-09, 01:03 PM)WallBB Wrote: [ -> ]To add the number (1) in header bar , you need to add the unread PM code in title bar,
 {$mybb->user['pms_unread']}

You can either edit templates and add this or use a Javascript Dom manipulation to add it on all pages without editing title page.

Great!

How to use a Javascript Dom manipulation to add it on all pages without editing title page?
Can you advice please?
No need. Header template is available in every page by default.
(2018-04-09, 01:09 PM)effone Wrote: [ -> ]No need. Header template is available in every page by default.

But it not showing (1) if I have one unread message on the header bar near favicon