How to create list of content by friends using views module? Is it possible?

Thanks for your help.

Comments

sirkitree’s picture

I think in this instance, a flag_friend relationship handler would have to be created. That way you could list content of people who have a relationship to you through flag_friend.

mariusooms’s picture

Would this be a serious feature to incorporate? Since it is pretty much the feature 'friendlist' has over this module. Well, this and some others, however content tracking from friends is seriously lacking within Drupal modules. Therefore I really welcome any effort in this direction.

Kind regards,

Marius

sirkitree’s picture

Most of my efforts for content tracking have been with the Activity module, so I'm unlikely to take the time to write this handler myself, but i would gladly review a patch.

dicreat’s picture

Does somebody have a worked example of listing content by friends?
Thanks.

bentonboomslang’s picture

I don't have a solution but I too would love to see this kind of functionality.

It didn't seem like it would be too difficult to build but I've been stuck on it for ages now. I'm trying to create a list of just the profiles of my friends (but the profiles are created by Content Profile and as such are nodes created by Users that are my friends).

Any ideas?

Thanks

tyromind’s picture

couldn't wrap my head around how to pull it off - seems like adding the flag-friend relationship would allow you to list nodes authored by users via that relationship. is it a bug that it doesn't work? currently it will only display content by the current user.

sirkitree’s picture

StatusFileSize
new27.08 KB

I dunno what you have, but when I configure the relationship handler, I have an option to list by Any User - see attached. Does this not work for you?

palazis’s picture

I think a have a very similar problem - i want to create a node view "All posts of my friends".
I have tried to use the Relationship "Flag Friend: User flag" By "Current User" but I always end up with an empty view (no rows). Same result if I use By "Any User"
Is there something I am doing wrong?
Thanks for the great module anyway!

palazis’s picture

I think I might have found what is going wrong... Here's the SQL code of my view:

SELECT node.nid AS nid, node.title AS node_title
FROM drupal_node node 
INNER JOIN drupal_users users ON node.uid = users.uid
INNER JOIN drupal_flag_content flag_content_users ON users.uid = flag_content_users.uid 
AND flag_content_users.fid = 2

I believe that the flag_content table shouldn't be used here since we need the Flag Friend Relationship.
The flag_friend should be used instead.
How can this be fixed?

liliplanet’s picture

StatusFileSize
new39.25 KB

Hi,

Using Activity 2 and Friend Flag.

As it's a bit long to write all the details, have just made a screenshot, see attached.

It shows all content added by friends (flag friend) and activity 'node insert'.

If I remember correctly, there was a problem when you re-named the Page Name, so just keep it as is : 'Page'.

palazis’s picture

Thanks.
I will try to use the Activity Module

palazis’s picture

I am afraid this doesn't work...
The view of the screen shot returns a view of my activities only - not the activities of my friends.
I would like to end up with the activities of my friends.
Same if I log in as another user. I get his posts only.
If I remove the Activity Access: Allow Access to the Actor filter, I end up with an empty view.
This is the SQL code of my view:

SELECT DISTINCT(activity.aid) AS aid,
COALESCE(activity_personal_messages.message, activity_messages.message) AS activity_messages_message,
activity.created AS activity_created
FROM drupal_activity activity 
INNER JOIN drupal_activity_access activity_access ON activity.aid = activity_access.aid
INNER JOIN drupal_activity_targets activity_targets ON activity.aid = activity_targets.aid AND activity_targets.uid = 0
INNER JOIN drupal_activity_messages activity_messages ON activity_targets.amid = activity_messages.amid
LEFT JOIN drupal_activity_targets activity_personal_targets ON activity.aid = activity_personal_targets.aid AND activity_personal_targets.uid = ***CURRENT_USER***
LEFT JOIN drupal_activity_messages activity_personal_messages ON activity_personal_targets.amid = activity_personal_messages.amid
WHERE (((activity.uid = 1)) OR ((activity_access.realm = 'flag_friend' AND activity_access.value IN  (4))))
AND ((activity.type) = ('node'))
ORDER BY activity_created DESC

Any solutions please?

liliplanet’s picture

Just select Activity Access : Flag Friend

Did you select the correct relationship in Activity Access: Flag_friend Access?

Access to Actor also includes the posts added by the owner.

palazis’s picture

This is working !!!
Thanks a lot!

sirkitree’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

marcoBauli’s picture

Version: 6.x-1.0-beta1 » 6.x-1.0-rc4
Status: Closed (fixed) » Active

Howdy, i am trying to show nodes from friends too, but after trying all the possible relationships and handlers seems i cannot get to it..

A flag_friend relationship should be everything needed without adding extra modules (Activities 2), but it outputs a blank page with no results as palazis says.

Can anyone who succeeded kindly upload an export of the view? Any assistance would be very much appreciated, i tried everything but this does not seem to work as expected...thank you

sirkitree’s picture

Status: Active » Fixed

Ideally a new argument handler should be created for this, but you can work it with a little php magic.

Create a new node view and add a User: uid argument:
Only local images are allowed.

Configure this argument to provide a default value with php, returning a comma delimited list of the user's friend uids, and set the argument to allow multiple values:
Only local images are allowed.

In this example I've just used the current user, but you can plug in whatever user you like with other various methods, but that's outside the scope of this.

marcoBauli’s picture

#18 perfectly works, thanks a lot!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.