• Resolved Halil ESEN

    (@halilesen)


    Hi,
    I am showing the number of notifications with the code below.

    <?php global $w3all_phpbb_unotifications; if (!empty($w3all_phpbb_unotifications) && $w3all_phpbb_unotifications > 0){ echo '<span class="blablax">' . $w3all_phpbb_unotifications . '</span>'; } ?>

    If I’m not mistaken, this is just like the number of notifications in the notification icon in phpBB. Also, with the same logic, I want to show the PM number if there is a PM. I know, the number of notifications includes new PMs. However, I want to show the PM notification number next to the PM icon in the menu as per design.

    Can you help me?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author axew3

    (@axewww)

    Hello!

    Use the $w3all_phpbb_usession var declaring as global, and then get PM number (user_new_privmsg) or Unread PM (user_unread_privmsg) for the user in this way:

    global $w3all_phpbb_usession;
    echo $w3all_phpbb_usession->user_unread_privmsg;

    Into widgets and templates you can use it.

    You can see the complete list of all user’s info, that are really many and probably more of what you will never need, printing like this the array:

    global $w3all_phpbb_usession;
    echo '<pre>';
    print_r($w3all_phpbb_usession); exit;

    The name name of all vars quite self-explain the meaning and what the value represent, but if any doubt on about how to extract more and different values just let know

    • This reply was modified 1 year, 7 months ago by axew3.
    Thread Starter Halil ESEN

    (@halilesen)

    I set it as below. It works great. Thanks

    <?php global $w3all_phpbb_usession; if ($w3all_phpbb_usession->user_unread_privmsg > 0) { echo '<span class="blablax">' . $w3all_phpbb_usession->user_unread_privmsg . '</span>'; } ?>
    • This reply was modified 1 year, 7 months ago by Halil ESEN.
    • This reply was modified 1 year, 7 months ago by Halil ESEN.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Number of Unread PM Notifications’ is closed to new replies.