Flag_Friend Notifications

Dark-Light - June 10, 2009 - 17:54

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.

Hi! My solution looks

ulo - June 24, 2009 - 10:09

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
));

Ahh, thanks for your reply. I

Dark-Light - June 27, 2009 - 11:37

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

Reece S - CEO of ColdCast Technologies.
http://www.coldcast.co.uk/

Working with this code made

Dark-Light - June 27, 2009 - 13:17

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 ;)

Reece S - CEO of ColdCast Technologies.
http://www.coldcast.co.uk/

Dark-light could You tell me

barylov - September 9, 2009 - 00:08

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

 
 

Drupal is a registered trademark of Dries Buytaert.