Hi.

Is it possible to create a view, which showes shared connections between the current user and a uid provided by an argument.
i tryed to manage it but i got stuck in the relationships,
it would be nice if someone could help me there :)

greetings

Comments

mariusooms’s picture

Yes, I believe so...I will need some more context as to what exactly you are trying to achieve. Who's uid? The logged user? Who is the current user? The one your viewing or the logged user? Are you wanting to show this relationship on the profile, node, page or block? That kinda thing. You can learn a lot by studying the included views as well.

Kind regards,

Marius

dawehner’s picture

ok:

the current user: $user is visiting a user profile of user $user_2.

Then i want to return the connections where $user and $user_2 has TW_BOTH as status.

thx for the help!

dawehner’s picture

thats what i'm currently trying

i would appreciate help a lot :)

$view = new view;
$view->name = 'friendlist_shared_contacts';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'friendlist_relations';
$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' => 'friendlist_relations',
    'field' => 'requestee_id',
    'relationship' => 'none',
  ),
  'requester_id' => array(
    'label' => 'Requester',
    'required' => 0,
    'id' => 'requester_id',
    'table' => 'friendlist_relations',
    'field' => 'requester_id',
    'relationship' => 'none',
  ),
));
$handler->override_option('fields', array(
  'picture' => array(
    'label' => 'Benutzerbild',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
    ),
    'exclude' => 0,
    'id' => 'picture',
    'table' => 'users',
    'field' => 'picture',
    'relationship' => 'requester_id',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('arguments', array(
  'uid' => array(
    'default_action' => 'ignore',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'Alle',
    'title' => '',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'not found',
    'break_phrase' => 0,
    'not' => 0,
    'id' => 'uid',
    'table' => 'users',
    'field' => 'uid',
    'relationship' => 'requestee_id',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'blog' => 0,
      'book' => 0,
      'experiment' => 0,
      'faq' => 0,
      'image' => 0,
      'page' => 0,
      'panel_block_node' => 0,
      'spread' => 0,
      'spreadyo_blogeintrag' => 0,
      'story' => 0,
      'video' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '4' => 0,
      '3' => 0,
      '1' => 0,
      '6' => 0,
      '2' => 0,
      '5' => 0,
    ),
    'validate_argument_type' => 'tid',
    'user_argument_type' => '',
    'restrict_user_roles' => 0,
    'user_roles' => array(),
    'validate_argument_node_flag_name' => '*relationship*',
    'validate_argument_node_flag_test' => 'flaggable',
    'validate_argument_node_flag_id_type' => 'id',
    'validate_argument_user_flag_name' => '*relationship*',
    'validate_argument_user_flag_test' => 'flaggable',
    'validate_argument_user_flag_id_type' => 'id',
    'validate_argument_is_member' => 0,
    'validate_argument_php' => '',
  ),
));
$handler->override_option('filters', array(
  'status' => array(
    'operator' => 'in',
    'value' => array(
      'TW_BOTH' => 'TW_BOTH',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'friendlist_statuses',
    'field' => 'status',
    'relationship' => 'none',
  ),
  'requester_id_current' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'requester_id_current',
    'table' => 'friendlist_relations',
    'field' => 'requester_id_current',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler = $view->new_display('page', 'Seite', 'page_1');
$handler->override_option('path', 'shared');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
));
?>
mercmobily’s picture

Hi,

Did you manage to fix this problem?

Merc.

mercmobily’s picture

Status: Active » Fixed

Hi,

Assuming so.

Merc.

mercmobily’s picture

Status: Fixed » Closed (fixed)
kvvnn’s picture

I would like to do the same thing, and cannot figure out how. Can you provide instructions? I've tried a lot of filters / arguments / relationships combinations.

Thanks.