Hello, I am building a drupal 6 page view which needs to display a list of nodes depending on the value selected in a user's content profile.

Summary:
User selects a value from a node reference field in their content profile

Create view page which displays all nodes in a table, filtered by the specific value in the profile.

User can not see nodes from other values in the node reference. only their selected value

User1 - has selected *advanced*
User2 - has selected *intermediate*
User3 - has selected *advanced
user4 - has selected *intermediate*
user5 - has selected *beginner*

User1, User3 are able to see each others nodes in a table
same goes for User2 and User4. User 5 only see's one node submitted

Here is a page i have been referencing for assistance:
http://stonebergdesign.com/blog/drupal-views-listing-nodes-related-user-...

But i am not using panels module(which shouldn't matter anyways)

**my view:**

    $view = new view;
    $view->name = 'AuthorSchedules';
    $view->description = '';
    $view->tag = '';
    $view->view_php = '';
    $view->base_table = 'node';
    $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('fields', array(
      'field_type_nid' => 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,
        'link_to_node' => 0,
        'label_type' => 'custom',
        'format' => 'plain',
        'multiple' => array(
          'group' => 1,
          'multiple_number' => '',
          'multiple_from' => '',
          'multiple_reversed' => 0,
        ),
        'exclude' => 0,
        'id' => 'field_type_nid',
        'table' => 'node_data_field_type',
        'field' => 'field_type_nid',
        'override' => array(
          'button' => 'Override',
        ),
        'relationship' => 'none',
      ),
      'field_center_local_nid' => array(
        'label' => 'Schedule Details',
        '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_node' => 0,
        'label_type' => 'custom',
        'format' => 'plain',
        'multiple' => array(
          'group' => 1,
          'multiple_number' => '',
          'multiple_from' => '',
          'multiple_reversed' => 0,
        ),
        'exclude' => 0,
        'id' => 'field_center_local_nid',
        'table' => 'node_data_field_center_local',
        'field' => 'field_center_local_nid',
        'override' => array(
          'button' => 'Override',
        ),
        'relationship' => 'none',
      ),
      'field_name_value' => 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,
        'link_to_node' => 0,
        'label_type' => 'none',
        'format' => 'default',
        'multiple' => array(
          'group' => TRUE,
          'multiple_number' => '',
          'multiple_from' => '',
          'multiple_reversed' => FALSE,
        ),
        'exclude' => 1,
        'id' => 'field_name_value',
        'table' => 'node_data_field_name',
        'field' => 'field_name_value',
        'relationship' => 'none',
      ),
      'field_last_name_value' => array(
        'label' => 'Trainer',
        'alter' => array(
          'alter_text' => 1,
          'text' => '[field_name_value] [field_last_name_value] ',
          '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_node' => 0,
        'label_type' => 'custom',
        'format' => 'default',
        'multiple' => array(
          'group' => TRUE,
          'multiple_number' => '',
          'multiple_from' => '',
          'multiple_reversed' => FALSE,
        ),
        'exclude' => 0,
        'id' => 'field_last_name_value',
        'table' => 'node_data_field_last_name',
        'field' => 'field_last_name_value',
        'override' => array(
          'button' => 'Override',
        ),
        'relationship' => 'none',
      ),
      'created' => array(
        'label' => 'Post date',
        '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,
        'date_format' => 'custom',
        'custom_date_format' => 'm-d-y',
        'exclude' => 0,
        'id' => 'created',
        'table' => 'node',
        'field' => 'created',
        'override' => array(
          'button' => 'Override',
        ),
        'relationship' => 'none',
      ),
    ));
    $handler->override_option('arguments', array(
      'field_org_ref_select_nid' => array(
        'default_action' => 'default',
        'style_plugin' => 'default_summary',
        'style_options' => array(),
        'wildcard' => 'all',
        'wildcard_substitution' => 'All',
        'title' => '',
        'breadcrumb' => '',
        'default_argument_type' => 'php',
        'default_argument' => '',
        'validate_type' => 'none',
        'validate_fail' => 'not found',
        'break_phrase' => 0,
        'not' => 0,
        'id' => 'field_org_ref_select_nid',
        'table' => 'node_data_field_org_ref_select',
        'field' => 'field_org_ref_select_nid',
        'validate_user_argument_type' => 'uid',
        'validate_user_roles' => array(
          '2' => 0,
          '4' => 0,
          '6' => 0,
          '5' => 0,
          '3' => 0,
        ),
        'override' => array(
          'button' => 'Override',
        ),
        'relationship' => 'none',
        'default_options_div_prefix' => '',
        'default_argument_fixed' => '',
        'default_argument_user' => 0,
        'default_argument_php' => '$userid = arg(1);
    $content_profile = content_profile_load(\'profile\', $userid);
    $content_profile_nid = $content_profile->nid;
    $node_ref = node_load($content_profile_nid);
    $refnid = $node_ref->field_org_ref_select[0][\'nid\'];
    return $refnid;',
        'validate_argument_node_type' => array(
          'profile' => 'profile',
          'center_location' => 0,
          'organization' => 0,
          'page' => 0,
          'story' => 0,
          'type' => 0,
        ),
        'validate_argument_node_access' => 0,
        'validate_argument_nid_type' => 'nid',
        'validate_argument_vocabulary' => array(
          '1' => 0,
        ),
        'validate_argument_type' => 'tid',
        'validate_argument_transform' => 0,
        'validate_user_restrict_roles' => 0,
        'validate_argument_php' => '',
      ),
      'nid' => array(
        'default_action' => 'default',
        'style_plugin' => 'default_summary',
        'style_options' => array(),
        'wildcard' => 'all',
        'wildcard_substitution' => 'All',
        'title' => '',
        'breadcrumb' => '',
        'default_argument_type' => 'php',
        'default_argument' => '',
        'validate_type' => 'none',
        'validate_fail' => 'ignore',
        'break_phrase' => 0,
        'not' => 1,
        'id' => 'nid',
        'table' => 'node',
        'field' => 'nid',
        'validate_user_argument_type' => 'uid',
        'validate_user_roles' => array(
          '2' => 0,
          '4' => 0,
          '6' => 0,
          '5' => 0,
          '3' => 0,
        ),
        'override' => array(
          'button' => 'Override',
        ),
        'relationship' => 'none',
        'default_options_div_prefix' => '',
        'default_argument_fixed' => '',
        'default_argument_user' => 0,
        'default_argument_php' => '$userid = arg(1);
    $content_profile = content_profile_load(\'profile\', $userid);
    $content_profile_nid = $content_profile->nid;
    if($content_profile_nid) {
    return $content_profile_nid;
    }
    return false;',
        'validate_argument_node_type' => array(
          'center_location' => 0,
          'organization' => 0,
          'page' => 0,
          'profile' => 0,
          'story' => 0,
          'type' => 0,
        ),
        'validate_argument_node_access' => 0,
        'validate_argument_nid_type' => 'nid',
        'validate_argument_vocabulary' => array(
          '1' => 0,
        ),
        'validate_argument_type' => 'tid',
        'validate_argument_transform' => 0,
        'validate_user_restrict_roles' => 0,
        'validate_argument_php' => '',
      ),
    ));
    $handler->override_option('access', array(
      'type' => 'role',
      'role' => array(
        '3' => 3,
      ),
    ));
    $handler->override_option('cache', array(
      'type' => 'none',
    ));
    $handler->override_option('header', '<h1>Your Training Schedules</h1>');
    $handler->override_option('header_format', '2');
    $handler->override_option('header_empty', 0);
    $handler->override_option('use_ajax', TRUE);
    $handler->override_option('items_per_page', 25);
    $handler->override_option('use_pager', 'mini');
    $handler->override_option('style_plugin', 'table');
    $handler->override_option('style_options', array(
      'grouping' => '',
      'override' => 1,
      'sticky' => 0,
      'order' => 'asc',
      'columns' => array(
        'field_type_nid' => 'field_type_nid',
        'field_center_local_nid' => 'field_center_local_nid',
        'field_name_value' => 'field_name_value',
        'field_last_name_value' => 'field_last_name_value',
        'created' => 'created',
      ),
      'info' => array(
        'field_type_nid' => array(
          'separator' => '',
        ),
        'field_center_local_nid' => array(
          'separator' => '',
        ),
        'field_name_value' => array(
          'sortable' => 1,
          'separator' => '',
        ),
        'field_last_name_value' => array(
          'sortable' => 1,
          'separator' => '',
        ),
        'created' => array(
          'sortable' => 1,
          'separator' => '',
        ),
      ),
      'default' => '-1',
    ));
    $handler = $view->new_display('page', 'Page', 'page_1');
    $handler->override_option('path', 'schedules_author');
    $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,
      'name' => 'navigation',
    ));

Let me know if anyhthing isn't clear. I really appreciate the help.

http://stackoverflow.com/questions/7252222/drupal-6-page-view-content-pr...

Comments

arkjoseph’s picture

Any one have any ideas?

Bump!

-JG