Closed (fixed)
Project:
Flag Friend
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 Mar 2009 at 23:19 UTC
Updated:
14 Sep 2009 at 18:58 UTC
In the screenshots there a "pending message" message/popup showing something like "you have 1 pending message".
How is that done? ATM i don't see any notifying - you have explicit to click on the friends->pending tabs in the account page.
Comments
Comment #1
sirkitree commentedI ended up getting rid of this as it wasn't customizable enough using a drupal_set_message() within hook_init(). I could possibly throw it back in with a setting to disable or something.
Comment #2
michtoen commentedWell, thought i had some missed - for me a custom call would be better then (have an customized user status block).
Comment #3
sirkitree commentedYour English doesn't quite make sense there... are you saying that you would find a function that you can call within a custom block more useful?
Comment #4
michtoen commentedSorry, it was late...
I have a custom "user status" block for logged in users. Beside links to the users profile and others i want
a notification for PM's and for the friendlist.
I *think* its ok to fetch for a logged in user both infos - for PMs its not the big query, it think its ok for the flag friends too, or?
Comment #5
sirkitree commentedSure, very simple. You can get the count like so:
$count now holds the amount of people who have flagged whatever $uid you pass in.
Note that this doesn't necessarily mean that a user filled out the message, but will give you an accurate count of 'pending' relationship requests.
Let me know if this takes care of your problem.
Comment #6
Ujval Shah commentedI have enabled flag and flag module, i have also configured flag friend.
When i send a request to another user as - 'Add as Friend', There is no status/notification message to another user to whom i have placed a request.
Does this feature yet to developed or am i missing some configuration.
Help would be much appreciated.
Comment #7
sirkitree commented@thedrupal: If you read the rest of this thread you will have your answer.
Comment #8
mstef commentedThat seems to be a good solution. How exactly would you recommend setting this up? My first thought would be to make a block containing that code, and issue a drupal message if the count is above zero. But then you'd have to load the flag and check the count for every single page view the logged in user makes? Seems inefficient. Any other ideas?
Also, on a slightly related note, how about email notifications upon friend requests?
Thanks
Comment #9
avpadernoComment #10
sirkitree commentedFirst of all, you should be putting this in your site's custom module, probably in hook_init() though you may have some trouble with message duplication. I would suggest you look at a couple of the previous version of the module within CVS and see if you can find it.
Second, email notification is implemented, though i had a report of it not working: @see #351714: Friend message not going out. and reopen that one if you are still having issues.
Comment #11
mstef commentedWell what I did worked fine - I just thought it may be a bit inefficient. I created a block that only shows to authenticated users. The display mode is based on PHP - shown only if $count is bigger than zero. The block is simply a message giving a link to pending requests. I thought that was better than using drupal_set_message to avoid any more database calls - also, it's less intrusive if the user doesn't care about it.
I'll check the other thread for email notification because it's not working for me..
Comment #12
sirkitree commenteddrupal_set_message() doesn't do any database calls, but you're right about it being somewhat intrusive. That was actually the main reason I got rid of it from the module. I would still encourage you to have this in a custom module for your site rather than in a custom php block which is stored in the database. That _is_ causing another database call and if you make a mistake you can very easily WSOD your site. It's just considered bad practice for this reason and more.
Comment #13
liliplanet commentedWould be tremendous if we could have a block of 'you have x pending friend requests'.
The custom module mentioned above, is it perhaps possible to release it to us please?
Comment #14
sirkitree commentedI'm going to be working on a custom function for the count, but it won't be a block. Please see #434020: Get total count of friends by $flag->get_user_count