By kwemart on
Hi to all
I want to display only the vote of the node author (whose profile is viewed)... I don't know exactly how to do...
just need some snipet for user argument
this is the export
<?php
function foo_views_default_views() {
$view = new view;
$view->name = 'draggable_user_ranking';
$view->description = '';
$view->tag = 'Draggable User Ranking ';
$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', 'Paramètres par défaut', 'default');
$handler->override_option('relationships', array(
'field_lien_fiche_nid' => array(
'label' => 'field_lien_fiche_nid',
'required' => 0,
'id' => 'field_lien_fiche_nid',
'table' => 'node_data_field_lien_fiche',
'field' => 'field_lien_fiche_nid',
'relationship' => 'none',
),
'votingapi_vote' => array(
'label' => 'Ma note',
'required' => 0,
'votingapi' => array(
'value_type' => 'points',
'tag' => 'vote',
),
'current_user' => 0,
'id' => 'votingapi_vote',
'table' => 'node',
'field' => 'votingapi_vote',
'relationship' => 'field_lien_fiche_nid',
'override' => array(
'button' => 'Supplanter',
),
),
));
$handler->override_option('fields', array(
'field_lien_fiche_nid' => array(
'label' => '',
'link_to_node' => 0,
'label_type' => 'widget',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 1,
'id' => 'field_lien_fiche_nid',
'table' => 'node_data_field_lien_fiche',
'field' => 'field_lien_fiche_nid',
'relationship' => 'none',
),
'field_affiche_fid_1' => array(
'label' => '',
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'miniature_default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_affiche_fid_1',
'table' => 'node_data_field_affiche',
'field' => 'field_affiche_fid',
'relationship' => 'field_lien_fiche_nid',
),
'field_titre_france_url' => array(
'label' => '',
'link_to_node' => 0,
'label_type' => 'widget',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_titre_france_url',
'table' => 'node_data_field_titre_france',
'field' => 'field_titre_france_url',
'relationship' => 'field_lien_fiche_nid',
),
'field_annee_value' => array(
'label' => '',
'link_to_node' => 0,
'label_type' => 'widget',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_annee_value',
'table' => 'node_data_field_annee',
'field' => 'field_annee_value',
'relationship' => 'field_lien_fiche_nid',
),
'field_director_nid' => array(
'label' => '',
'link_to_node' => 0,
'label_type' => 'widget',
'format' => 'default',
'multiple' => array(
'group' => 1,
'multiple_number' => '2',
'multiple_from' => '',
'multiple_reversed' => 0,
),
'exclude' => 0,
'id' => 'field_director_nid',
'table' => 'node_data_field_director',
'field' => 'field_director_nid',
'relationship' => 'field_lien_fiche_nid',
'override' => array(
'button' => 'Supplanter',
),
),
'value' => array(
'label' => 'Ma note',
'set_precision' => FALSE,
'precision' => 0,
'decimal' => '.',
'separator' => ',',
'prefix' => '',
'suffix' => '',
'appearance' => NULL,
'exclude' => 0,
'id' => 'value',
'table' => 'votingapi_vote',
'field' => 'value',
'relationship' => 'votingapi_vote',
),
'name' => array(
'label' => 'Nom',
'link_to_user' => 1,
'exclude' => 1,
'id' => 'name',
'table' => 'users',
'field' => 'name',
'override' => array(
'button' => 'Supplanter',
),
'relationship' => 'none',
),
'field_weight_level1_value' => array(
'label' => '',
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_weight_level1_value',
'table' => 'node_data_field_weight_level1',
'field' => 'field_weight_level1_value',
'relationship' => 'none',
'override' => array(
'button' => 'Supplanter',
),
),
));
$handler->override_option('sorts', array(
'value' => array(
'order' => 'DESC',
'id' => 'value',
'table' => 'votingapi_vote',
'field' => 'value',
'relationship' => 'votingapi_vote',
'override' => array(
'button' => 'Supplanter',
),
),
'field_weight_level1_value' => array(
'order' => 'ASC',
'id' => 'field_weight_level1_value',
'table' => 'node_data_field_weight_level1',
'field' => 'field_weight_level1_value',
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'name' => array(
'default_action' => 'ignore',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'Tous / Toutes',
'title' => '',
'default_argument_type' => 'fixed',
'default_argument' => '',
'validate_type' => 'php',
'validate_fail' => 'not found',
'glossary' => 0,
'limit' => '0',
'case' => 'none',
'path_case' => 'none',
'transform_dash' => 1,
'id' => 'name',
'table' => 'users',
'field' => 'name',
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'blog' => 0,
'poll' => 0,
'forum' => 0,
'panel' => 0,
'book' => 0,
'critiques' => 0,
'fiche' => 0,
'fiche_series_tv' => 0,
'fiche_series_tv_saison' => 0,
'filmographie' => 0,
'news' => 0,
'page' => 0,
'profile' => 0,
'story' => 0,
'user_list' => 0,
'user_ranking' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'2' => 0,
'3' => 0,
'1' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_php' => '',
'default_argument_user' => 0,
'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',
'override' => array(
'button' => 'Supplanter',
),
),
'date_argument' => array(
'default_action' => 'ignore',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'Tous / Toutes',
'title' => '',
'default_argument_type' => 'fixed',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'date_fields' => array(
'node_data_field_annee.field_annee_value' => 'node_data_field_annee.field_annee_value',
),
'date_method' => 'OR',
'granularity' => 'year',
'id' => 'date_argument',
'table' => 'node',
'field' => 'date_argument',
'relationship' => 'field_lien_fiche_nid',
'default_options_div_prefix' => '',
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'blog' => 0,
'poll' => 0,
'forum' => 0,
'panel' => 0,
'book' => 0,
'critiques' => 0,
'fiche' => 0,
'fiche_series_tv' => 0,
'fiche_series_tv_saison' => 0,
'filmographie' => 0,
'news' => 0,
'page' => 0,
'profile' => 0,
'story' => 0,
'user_list' => 0,
'user_ranking' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'2' => 0,
'3' => 0,
'1' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_php' => '',
'override' => array(
'button' => 'Supplanter',
),
'default_argument_user' => 0,
'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',
),
));
$handler->override_option('filters', array(
'type' => array(
'operator' => 'in',
'value' => array(
'user_ranking' => 'user_ranking',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
'override' => array(
'button' => 'Supplanter',
),
),
'uid' => array(
'operator' => 'not in',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'uid',
'table' => 'votingapi_vote',
'field' => 'uid',
'relationship' => 'votingapi_vote',
'override' => array(
'button' => 'Supplanter',
),
),
'uid_1' => array(
'id' => 'uid_1',
'table' => 'users',
'field' => 'uid',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('title', 'Classement');
$handler->override_option('use_more', 1);
$handler->override_option('distinct', 0);
$handler->override_option('style_plugin', 'draggabletable');
$handler->override_option('style_options', array(
'grouping' => '',
'override' => 1,
'sticky' => 0,
'order' => 'asc',
'columns' => array(
'field_date_film_vu_value' => 'field_date_film_vu_value',
'field_affiche_fid_1' => 'field_affiche_fid_1',
'field_titre_france_url' => 'field_titre_france_url',
'field_annee_value' => 'field_annee_value',
'field_director_nid' => 'field_director_nid',
'field_lien_fiche_nid' => 'field_lien_fiche_nid',
'field_ville_vu_au_cine_value' => 'field_ville_vu_au_cine_value',
'field_vo_ou_vf_value' => 'field_vo_ou_vf_value',
'field_date_sortie_france_value' => 'field_date_sortie_france_value',
'name' => 'name',
'field_weight_level1_value' => 'field_weight_level1_value',
),
'info' => array(
'field_date_film_vu_value' => array(
'sortable' => 0,
'separator' => '',
),
'field_affiche_fid_1' => array(
'separator' => '',
),
'field_titre_france_url' => array(
'sortable' => 0,
'separator' => '',
),
'field_annee_value' => array(
'sortable' => 0,
'separator' => '',
),
'field_director_nid' => array(
'separator' => '',
),
'field_lien_fiche_nid' => array(
'separator' => '',
),
'field_ville_vu_au_cine_value' => array(
'sortable' => 0,
'separator' => '',
),
'field_vo_ou_vf_value' => array(
'sortable' => 0,
'separator' => '',
),
'field_date_sortie_france_value' => array(
'sortable' => 0,
'separator' => '',
),
'name' => array(
'sortable' => 0,
'separator' => '',
),
'field_weight_level1_value' => array(
'sortable' => 0,
'separator' => '',
),
),
'default' => '-1',
'tabledrag_hierarchy' => array(
'parent_field' => 'none',
),
'tabledrag_order' => array(
'0' => array(
'field' => 'field_weight_level1_value',
'del' => 'Supprimer',
),
),
'tabledrag_order_add' => 'Add order field',
'tabledrag_order_visible' => array(
'visible' => 0,
),
'tabledrag_hierarchy_visible' => array(
'visible' => 0,
),
'tabledrag_types_add' => 'Add type',
'tabledrag_expand' => array(
'expand_links' => 'expand_links',
'collapsed' => 0,
),
));
$handler = $view->new_display('page', 'Classement', 'page_1');
$handler->override_option('relationships', array(
'field_lien_fiche_nid' => array(
'label' => 'field_lien_fiche_nid',
'required' => 0,
'id' => 'field_lien_fiche_nid',
'table' => 'node_data_field_lien_fiche',
'field' => 'field_lien_fiche_nid',
'relationship' => 'none',
),
'votingapi_vote' => array(
'label' => 'Ma note',
'required' => 0,
'votingapi' => array(
'value_type' => 'points',
'tag' => 'vote',
),
'current_user' => 0,
'id' => 'votingapi_vote',
'table' => 'node',
'field' => 'votingapi_vote',
'relationship' => 'field_lien_fiche_nid',
'override' => array(
'button' => 'Utiliser la valeur par défaut',
),
),
));
$handler->override_option('path', 'classement');
$handler->override_option('menu', array(
'type' => 'normal',
'title' => 'Classement 2008',
'weight' => '0',
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'weight' => 0,
));
$handler = $view->new_display('block', 'Bloc', 'block_1');
$handler->override_option('block_description', 'block_rank');
$handler->override_option('block_caching', -1);
$views[$view->name] = $view;
return $views;
}
?>
Comments
no Ideas?
there's noboby for help?