Hey guys.
The title pretty much says everything. I cannot find a way of writing a notification snippet which will display a message to users when they have pending friend requests to approve. I would like it to say "Friends: (2 new)" but nomatter what I write, it simply doesn't work. After just under a week of trying, I have come to these forums to request some guidance.

Thanks for any help you can give.

Comments

ulo’s picture

Hi!
My solution looks something like this:

$requests = db_result(db_query("
	SELECT COUNT(DISTINCT(users.uid)) AS c
	FROM users users 
	INNER JOIN flag_content flag_content_users ON users.uid = flag_content_users.uid AND flag_content_users.fid = 2
	WHERE flag_content_users.content_id = ".$user->uid
));
darklight’s picture

Ahh, thanks for your reply. I shall try this out right now. Cheerz man I appreciate this.

darklight’s picture

Working with this code made me re-focus on what I originally wanted it for, a Notification system. While I was tinkering about I found a much easier and much more efficient way of acheiving what I wanted. I used Views and used a few arguments and a relationship, now I have everything I need.

In a way you helped me acheive this by bringing me back onto the subject of Flag Friend, so I thank you very much. I'm sure this code would have worked by I found what I needed using Views (which I am in love with) so I'll use that instead.

Thanks again ;)

barylov’s picture

Dark-light could You tell me how You did this?

jrivelli’s picture

Yeah how did you do that?

darklight’s picture

Hey. Sorry I cannot remember. I did this a year ago, and I now use the User Relationships module. Try playing around with Views :)