Hey there,
I was wondering if you could suggest some PHP to use to for a block to display the number of unread messages for a user from your PrivateMsg module.
My aim is to write a snippet of code that will display a link to your '/messages' page and then the number of unread messages for that user. So it looks like ...
...where 4 is the number of unread messages. It would a great if you could maybe incorporate as a block in your module as standard.
Thanks for your help!
Russ
Comments
Comment #1
berdirThis does already exist... look for a block called "Privatemsg links" or so, it contains 3 links, "write new message", "inbox (x new)" and "sent".
Comment #2
Russellf commentedAhah, brilliant! Thanks!
Comment #3
Russellf commentedComment #4
Anonymous (not verified) commentedFor themers, it could be usefull. This works on d6 :
And this is for d5 :
Comment #5
BeaPower commentedHow about for d7 to use in views with php custom field?
Comment #6
BeaPower commentedComment #7
berdirThis works exactly the same way in D7 as it does in D6. You can optionally pass in the user object to the the unread messages count of another user.
Comment #8
BeaPower commentedI tried that in views, but I get no output, nothing.