Hi there,
I’m using the following Code to show users unread messages and pending friend requests in the sidebar:
Friendship Requests
Freundschaftsanfragen: <?php echo bp_friend_total_requests_count() ?>
Unread Messages
Nachrichten: <?php bp_total_unread_messages_count() ?>
(I’m using “Enhanced Text Widget” to show php-code in my sidebar-widget)
Additionally, I want to create some kind of notification that displays users if they have new messages or requests and thtat is only shown IF there are any new messages or requests!
I imagine it should look something like:
if (unread messages > 0)
echo “You have unread Messages”;
else
echo ” “;
if (pending friendship requests > 0)
echo “You have new friendship requests”;
else
echo ” “;
my problem is, that I don’t know the names of the variables to use (I tried it with the functions instead of the variables which didn’t work). Can anyone of your pls help? I’m using the “allow PHP in posts and pages” plugin to use php in posts and pages^^
My WordPress-Version is 4.0.1, my Buddypress-Version is 2.1.1
My website is still under construction and has directory protection, which is why I won’t post the domain, username or password. If your realy need this information, I’ll send it to your via pm.
P.S. English is not my native language, I apologize for any typos or other kind of misstake.