Hi,
Just a minor request which I'm hoping is easy: how would you modify the user_relationships_content view to also include content types from the person in the user id argument?

thanks for any help
levin

Comments

alex.k’s picture

Just to be clear, you want the view to display content from user's related users, and from the user him/herself. I'm not sure this is possible, actually. The argument can only have one meaning... you would need to mix together two views somehow.

Perhaps some Views gurus out there know a solution...

jay k-2’s picture

Assigned: Unassigned » jay k-2
levin-1’s picture

Yes, that's exactly it. I want to display all the events (for example) created by the user and his/her associates. I know it's easy to do one or the other but I want to combine them!

cheers
levin

alex.k’s picture

Assigned: jay k-2 » Unassigned

I'd be interested to hear a solution, too, if one exists. I'd actually suggest you rethink if you really need to show both views in the same listing. Perhaps there is another UI solution that doesn't require such trickery.

tkrajcar’s picture

It would really be helpful to find a way to do this. It is pretty common on social networking sites for you to see your own updates/content mixed in with the feed of your friends. This doesn't appear to be possible at present without adding yourself as a relationship, which is a pretty kludgey solution.

alex.k’s picture

Views_or http://drupal.org/project/views_or might help you do it. I haven't tried to use it in this application, so could not guarantee it will work.

kuttu666’s picture

Title: user_relationships_content view including self » user_relationships pending requests approve with view

Hi,

How can i setup user_relationships pending requests approve page with view.

Thanks
Manoj

YK85’s picture

Has anyone been able to figure this out?
This would be a big heap for User Relationships Views integration.

Thanks!

robby.smith’s picture

+1 subscribing

guntherdevisch’s picture

Is there any news about a User relationship view where you can approve / dissaprove? I now have a view with the pending requests, but you can only see a 'Cancel' link in my Status field. There is no 'Approve' or 'Dissaprove' link.

Here's my view

$view = new view;
$view->name = 'Vrienden';
$view->description = 'Vrienden';
$view->tag = 'Vrienden';
$view->view_php = '';
$view->base_table = 'user_relationships';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
  'requestee_id' => array(
    'label' => 'requestee',
    'required' => 0,
    'id' => 'requestee_id',
    'table' => 'user_relationships',
    'field' => 'requestee_id',
    'relationship' => 'none',
  ),
  'requester_id' => array(
    'label' => 'requester',
    'required' => 0,
    'id' => 'requester_id',
    'table' => 'user_relationships',
    'field' => 'requester_id',
    'relationship' => 'none',
  ),
));
$handler->override_option('fields', array(
  'picture' => array(
    'label' => 'Afbeelding',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'imagecache_preset' => '',
    'exclude' => 0,
    'id' => 'picture',
    'table' => 'users',
    'field' => 'picture',
    'relationship' => 'requestee_id',
  ),
  'name' => array(
    'label' => 'Naam',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_user' => 1,
    'overwrite_anonymous' => 0,
    'anonymous_text' => '',
    'exclude' => 0,
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
    'relationship' => 'requestee_id',
  ),
  'status' => array(
    'label' => 'Status',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'status',
    'table' => 'facebook_status',
    'field' => 'status',
    'relationship' => 'requestee_id',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'status_link' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'status_link',
    'table' => 'user_relationships',
    'field' => 'status_link',
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'name' => array(
    'order' => 'ASC',
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
    'relationship' => 'requestee_id',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('filters', array(
  'approved' => array(
    'operator' => '=',
    'value' => '0',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'approved',
    'table' => 'user_relationships',
    'field' => 'approved',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'rtype' => array(
    'operator' => 'in',
    'value' => array(
      '0' => '1',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'rtype',
    'table' => 'user_relationships',
    'field' => 'rtype',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'uid_current' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'uid_current',
    'table' => 'users',
    'field' => 'uid_current',
    'relationship' => 'requester_id',
  ),
  'sid_extra' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'sid_extra',
    'table' => 'facebook_status',
    'field' => 'sid_extra',
    'relationship' => 'requestee_id',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('title', 'Vrienden');
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'picture' => 'picture',
    'name' => 'name',
    'status_link' => 'status_link',
    'status' => 'status',
  ),
  'info' => array(
    'picture' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'name' => array(
      'sortable' => 1,
      'separator' => '',
    ),
    'status_link' => array(
      'separator' => '',
    ),
    'status' => array(
      'sortable' => 0,
      'separator' => '',
    ),
  ),
  'default' => 'name',
));
$handler = $view->new_display('page', 'Pagina', 'page_1');
$handler->override_option('fields', array(
  'picture' => array(
    'label' => 'Afbeelding',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'imagecache_preset' => '',
    'exclude' => 0,
    'id' => 'picture',
    'table' => 'users',
    'field' => 'picture',
    'relationship' => 'requestee_id',
  ),
  'name' => array(
    'label' => 'Naam',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_user' => 1,
    'overwrite_anonymous' => 0,
    'anonymous_text' => '',
    'exclude' => 0,
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
    'relationship' => 'requestee_id',
  ),
  'status' => array(
    'label' => 'Status',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'status',
    'table' => 'facebook_status',
    'field' => 'status',
    'relationship' => 'requestee_id',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
  'status_link' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'status_link',
    'table' => 'user_relationships',
    'field' => 'status_link',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'approved' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'approved',
    'table' => 'user_relationships',
    'field' => 'approved',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
  'rtype' => array(
    'operator' => 'in',
    'value' => array(
      '0' => '1',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'rtype',
    'table' => 'user_relationships',
    'field' => 'rtype',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'uid_current' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'uid_current',
    'table' => 'users',
    'field' => 'uid_current',
    'relationship' => 'requester_id',
  ),
  'sid_extra' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'sid_extra',
    'table' => 'facebook_status',
    'field' => 'sid_extra',
    'relationship' => 'requestee_id',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('path', 'user/%/vrienden');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => 'Alle',
  'description' => '',
  'weight' => '0',
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler = $view->new_display('page', 'Pagina', 'page_2');
$handler->override_option('filters', array(
  'approved' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'approved',
    'table' => 'user_relationships',
    'field' => 'approved',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'rtype' => array(
    'operator' => 'in',
    'value' => array(
      '0' => '1',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'rtype',
    'table' => 'user_relationships',
    'field' => 'rtype',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'uid_current' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'uid_current',
    'table' => 'users',
    'field' => 'uid_current',
    'relationship' => 'requester_id',
  ),
  'sid_extra' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'sid_extra',
    'table' => 'facebook_status',
    'field' => 'sid_extra',
    'relationship' => 'requestee_id',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
));
$handler->override_option('path', 'user/%/vrienden/alle');
$handler->override_option('menu', array(
  'type' => 'default tab',
  'title' => 'Alle',
  'description' => '',
  'weight' => '0',
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => 'Alle',
  'description' => '',
  'weight' => '0',
  'name' => 'navigation',
));
$handler = $view->new_display('page', 'Pagina', 'page_3');
$handler->override_option('fields', array(
  'picture' => array(
    'label' => 'Afbeelding',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'imagecache_preset' => '',
    'exclude' => 0,
    'id' => 'picture',
    'table' => 'users',
    'field' => 'picture',
    'relationship' => 'requestee_id',
  ),
  'name' => array(
    'label' => 'Naam',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_user' => 1,
    'overwrite_anonymous' => 0,
    'anonymous_text' => '',
    'exclude' => 0,
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
    'relationship' => 'requestee_id',
  ),
  'status_link' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'status_link',
    'table' => 'user_relationships',
    'field' => 'status_link',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'approved' => array(
    'operator' => '=',
    'value' => '0',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'approved',
    'table' => 'user_relationships',
    'field' => 'approved',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'uid_current' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'uid_current',
    'table' => 'users',
    'field' => 'uid_current',
    'relationship' => 'requester_id',
  ),
  'rtype' => array(
    'operator' => 'in',
    'value' => array(
      '0' => '1',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'rtype',
    'table' => 'user_relationships',
    'field' => 'rtype',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('path', 'user/%/vrienden/verzoeken');
$handler->override_option('menu', array(
  'type' => 'tab',
  'title' => 'Verzoeken',
  'description' => '',
  'weight' => '1',
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'tab',
  'title' => 'Verzoeken',
  'description' => '',
  'weight' => '0',
  'name' => 'navigation',
));

Can someone help me?

Thanks!
Gunther

guntherdevisch’s picture

Hi all,

I've added some code to the file: views_handler_field_user_relationships_status_link.inc and it works!

In the else-clause (Requests by me) i added an approve and disapprove link. Check my changed code below. Can this be updated in the next release?

    //Requests by me.
    if ($values->{$this->aliases['requester_id']} === $user->uid) {
      if ($values->{$this->aliases['approved']}) {
        return theme('user_relationships_remove_link', $values->{$this->aliases['requester_id']}, $values->{$this->aliases['rid']}) ;
      }
      else {
        return
        theme('user_relationships_pending_request_approve_link', $values->{$this->aliases['requester_id']}, $values->{$this->aliases['rid']}) .
        ' | '.
        theme('user_relationships_pending_request_disapprove_link', $values->{$this->aliases['requester_id']}, $values->{$this->aliases['rid']}) .
		' | '.
        theme('user_relationships_pending_request_cancel_link', $values->{$this->aliases['requester_id']}, $values->{$this->aliases['rid']}) ;
      }
    }

Greets,
Gunther

alex.k’s picture

Can you provide a patch, please?

guntherdevisch’s picture

Oké that would be my first patch, i'll have a look:)

Greets

alex.k’s picture

guntherdevisch’s picture

Component: User interface » Code
Status: Active » Needs review
StatusFileSize
new1.26 KB

Hi,

Here's the patch. Can you check this alex.k?

Thanks,
Gunther

YK85’s picture

Status: Needs review » Needs work

The patch didn't apply smoothly so had to manually apply it. This patch causes a weird outcome.

Example: I sent a relationship request so I should only see "Cancel" (which is shown before the patch), but after applying the patch it shows "Approve | Disapprove | Cancel" which is weird. The requester should see "Cancel" and the requestee should see "Approve | Disapprove | Cancel"

Thanks!

guntherdevisch’s picture

Status: Needs work » Closed (fixed)

Indeed, you're right Yaz085. The patch outcome isn't correct. My apologies.

This patch looks more promising: http://drupal.org/node/866400

Greets,
Gunther

MSSS’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Component: Code » Miscellaneous

Managing a Drupal site - but have zero programming experience. As an Admin, I can see the management drop-downs. Can you help me make a change?

When I get a "member to approve" I cannot see "Edit My Member Profile" (until AFTER the member is approved). So I can't tell if the applicant is legit.

How do I find the "Edit My Member Profile" info for a prospective member, who has filled out the required questionnaire in some way. All I see now is the name and email address.