Customizing SMF > SMF Coding Discussion

PM Inbox Link

(1/1)

Aaron Nelsen:
Currently I have a link on my side menu bar that says "PM Inbox" now I would like it to display something like "PM Inbox (1)" when you have a new message, just to give an indicator that you have a new message. I assume this can be done, but I doubt I'm smart enough to figure out how *grin*

Any help would be greatly appreciated!

[Unknown]:
If this is in a template, you can just do this:

PM Inbox ', $context['user']['unread_messages'], '

-[Unknown]

Aaron Nelsen:
Figured it was something simple like that, thanks, works like a charm!

[Unknown]:
Oops, forgot the parenthesis, didn't I?  Oh well - you can also use $context['user']['messages'] for their message count.

In fact, I recommend you try this:

<pre>';
print_r($context['user']);
echo '</pre>

And see what it says ;).

-[Unknown]

Aaron Nelsen:
Heh heh, very nice *grin*

Navigation

[0] Message Index

Go to full version