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

TSNetwork’s picture

I 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?

rszrama’s picture

Not 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.

TSNetwork’s picture

Is there a way to have it message them while surfing the website about their unread messages, not only on login?

rszrama’s picture

You 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.

TSNetwork’s picture

I 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".

TSNetwork’s picture

I 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...

rszrama’s picture

Are you using a custom theme and/or is your theme modified to not print $messages?

TSNetwork’s picture

I'm using a custom theme but it shows messages. It doesn't have any modifications on $messages...

TSNetwork’s picture

Ok... 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...

JamesAn’s picture

Priority: Critical » Normal

The 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:

          $rec_status = '';
          if ($row['status'] == 0) {
            $rec_status = ' <span class="marker">'. t('new') .'</span>';
          }
          $links[] = l($row['name'], 'user/'. $row['recipient']) . $rec_status;
TSNetwork’s picture

It's not a theme issue, I tried that. The "new" message still doesn't show up next to the primary link... any more ideas?

JamesAn’s picture

Hmm..

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.