This is a follow up from a question I asked.
I'd like to see a way to have Friendlist automatically notify the receiver of a friend request, other than email. What I'm looking for is when you have a message waiting to be read, a number appears in the menu block (example: "twoway received (1)").
Private messages does a similar thing. When you have a message waiting to be read, a number appears in the menu (example: "All messages (1)").
Comments
Comment #1
mariusooms commentedWe can not do it that way currently. However here's a way, but the relationship count will not be in the menu item. Instead you can create a tiny block notifying the user he or she has pending requests. I have not done this myself, but try this.
Create a new block with this code:
This is just a tiny example how you can output the number of statuses for the logged in user. Now that you have this info you can display it in any way you desire. Sorry about the markup clunkyness, but I just wanted to quickly show how to make a block like this. Format the php in any way you think is best for your needs.
Regards,
Marius
Comment #2
wxman commentedThanks. I'm adding this to my ever growing list of things to get caught up on.
Comment #3
mariusooms commentedOkiedokie
Comment #4
manoz_79 commentedHi,
I created a new block using the code above and enabled it. But I see no messages in the block, do I need to do something more apart from pasting the code above in the block body, with input format selected as PHP? Is there something else that i need to do/
I am using the latest dev version of Frielndlist.
Thanks.
Comment #5
mariusooms commentedI'm so sorry Manoz...that's what you get when you try write some quick code. Try the following code instead. Just stick it in a block with the input filter set to "PHP code" and display it on the user profile.
Additionally if you wish to only display this on the profile for the logged in user (which I think you do), put the following code in the visibility settings with the radio button checked for "Show if the following PHP code returns TRUE". This code assumes you are using the core profile module. If you use e.g. Content Profile you will need to adjust the argument, since you are viewing a profile as a node.
Good luck!
Marius
PS.
Comment #6
manoz_79 commentedThanks Marius, the code worked perfectly.
Comment #7
mariusooms commentedGood to hear...this code might even be useful to include as a default block for the module. We'll see...maybe we will just include it as a snippet in the manual.
Regards,
Marius
Comment #9
TapSkill commentedVery useful snippet, thanks.