Active
Project:
PM Lite
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Mar 2009 at 23:22 UTC
Updated:
10 Jul 2009 at 03:01 UTC
This is a great module, I like it more than privatemsg because it's much simpler and doesn't conflict that much with other modules.
To the point - I need SOME sort of notification for new private messages, is there a way to change the Navigation link title when there's an unread message or at least to make it show a number of the unread messages somewhere? And if there is - please help me with an example. I know it has something to do with the function pm_lite_unread() but I don't know where to use it and how...
Thank you. Please help.
Comments
Comment #1
TSNetwork commentedI tried all of the versions, none of them displayed the number of unread messages, they just said "Inbox" in the primary link. If this can't work can the message that shows up on login also show up anytime if the user has an unread message and surfs the website logged in?
Comment #2
rszrama commentedNot sure why it's not working for you, but it's working for me just fine to show how many are unread in the menu item. Also, you can have it message people when they login how many unread messages they have.
Comment #3
TSNetwork commentedIs there a way to have it message them while surfing the website about their unread messages, not only on login?
Comment #4
rszrama commentedYou could write a simple module to do this, as there's an API function in the PM Lite module to return how many unread posts a user has (can't remember the name off the top of my head). You could use something like hook_init() to display a message if that function returns a number greater than 0.
Comment #5
TSNetwork commentedI think the function is pm_lite_unread()
And without a module, could this string be shown with a message somewhere in a block or a node, and how? I mean something like: "You have @unread new messages".
Comment #6
TSNetwork commentedI added a drupal_set_message in the part where PM_Lite checks for unread messages and changes the title if there are any, but the message doesn't show up. Which might mean pm_lite_unread() doesn't appear to work? Why could that be?
I just need something, whatever, to happen if the user has unread messages...
Comment #7
rszrama commentedAre you using a custom theme and/or is your theme modified to not print $messages?
Comment #8
TSNetwork commentedI'm using a custom theme but it shows messages. It doesn't have any modifications on $messages...
Comment #9
TSNetwork commentedOk... where is the code which is used to show the red "new" message in front of the unread messages? Can I use something similar to redirect the user to their inbox if they have a new message? At least...
Comment #10
JamesAn commentedThe notifications are working fine with me too.
@SektorZ: I can't think of much off the top of my head except for you to test viewing your site in Garland to ensure no theme issues. The red "new" message is appended in the function pm_lite_table(), line 78p:
Comment #11
TSNetwork commentedIt's not a theme issue, I tried that. The "new" message still doesn't show up next to the primary link... any more ideas?
Comment #12
JamesAn commentedHmm..
If you're comfortable around PHP, you can output some of the variables in that function, pm_lite_table, to figure out what's going on.