I created a view to display a list of the discussion of my forum. I want to show the author of the last comment, but only the ID is displayed.
How do I replace the author ID with the username ?
$view = new view();
$view->name = 'sujet';
$view->description = 'A view to emulate Drupal core\'s handling of taxonomy/term.';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Sujet';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['use_more_text'] = 'plus';
$handler->display->display_options['group_by'] = TRUE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'time';
$handler->display->display_options['cache']['results_lifespan'] = '3600';
$handler->display->display_options['cache']['results_lifespan_custom'] = '0';
$handler->display->display_options['cache']['output_lifespan'] = '3600';
$handler->display->display_options['cache']['output_lifespan_custom'] = '0';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['exposed_form']['options']['submit_button'] = 'Appliquer';
$handler->display->display_options['exposed_form']['options']['reset_button_label'] = 'Réinitialiser';
$handler->display->display_options['exposed_form']['options']['exposed_sorts_label'] = 'Trier par';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'views_bootstrap_table_plugin_style';
$handler->display->display_options['style_options']['columns'] = array(
'nid' => 'nid',
'field_image' => 'field_image',
'title' => 'title',
'commerce_price' => 'commerce_price',
'field_rating' => 'field_rating',
'body' => 'body',
);
$handler->display->display_options['style_options']['default'] = '-1';
$handler->display->display_options['style_options']['info'] = array(
'nid' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'field_image' => array(
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'title' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'commerce_price' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'field_rating' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'body' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
);
$handler->display->display_options['style_options']['bootstrap_styles'] = array(
'striped' => 'striped',
'bordered' => 'bordered',
'hover' => 0,
'condensed' => 0,
);
$handler->display->display_options['style_options']['responsive'] = 0;
/* Relation: Contenu : Auteur */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'node';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
/* Relation: Commentaire : Dernier commentaire */
$handler->display->display_options['relationships']['cid']['id'] = 'cid';
$handler->display->display_options['relationships']['cid']['table'] = 'node_comment_statistics';
$handler->display->display_options['relationships']['cid']['field'] = 'cid';
/* Relation: Commentaire : Auteur */
$handler->display->display_options['relationships']['uid_1']['id'] = 'uid_1';
$handler->display->display_options['relationships']['uid_1']['table'] = 'comment';
$handler->display->display_options['relationships']['uid_1']['field'] = 'uid';
$handler->display->display_options['relationships']['uid_1']['relationship'] = 'cid';
/* Champ: Contenu : Titre */
$handler->display->display_options['fields']['title_1']['id'] = 'title_1';
$handler->display->display_options['fields']['title_1']['table'] = 'node';
$handler->display->display_options['fields']['title_1']['field'] = 'title';
$handler->display->display_options['fields']['title_1']['label'] = '';
$handler->display->display_options['fields']['title_1']['exclude'] = TRUE;
$handler->display->display_options['fields']['title_1']['element_label_colon'] = FALSE;
/* Champ: Utilisateur : Nom */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'users';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['relationship'] = 'uid';
$handler->display->display_options['fields']['name']['label'] = '';
$handler->display->display_options['fields']['name']['exclude'] = TRUE;
$handler->display->display_options['fields']['name']['element_label_colon'] = FALSE;
/* Champ: Contenu : Date de publication */
$handler->display->display_options['fields']['created']['id'] = 'created';
$handler->display->display_options['fields']['created']['table'] = 'node';
$handler->display->display_options['fields']['created']['field'] = 'created';
$handler->display->display_options['fields']['created']['label'] = '';
$handler->display->display_options['fields']['created']['exclude'] = TRUE;
$handler->display->display_options['fields']['created']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['created']['date_format'] = 'short';
$handler->display->display_options['fields']['created']['second_date_format'] = 'long';
$handler->display->display_options['fields']['created']['format_date_sql'] = 0;
/* Champ: Global : Texte personnalisé */
$handler->display->display_options['fields']['nothing']['id'] = 'nothing';
$handler->display->display_options['fields']['nothing']['table'] = 'views';
$handler->display->display_options['fields']['nothing']['field'] = 'nothing';
$handler->display->display_options['fields']['nothing']['label'] = 'Sujets';
$handler->display->display_options['fields']['nothing']['alter']['text'] = '[title_1]</br>
par [name] le [created]';
/* Champ: Contenu : Nombre de commentaires */
$handler->display->display_options['fields']['comment_count']['id'] = 'comment_count';
$handler->display->display_options['fields']['comment_count']['table'] = 'node_comment_statistics';
$handler->display->display_options['fields']['comment_count']['field'] = 'comment_count';
$handler->display->display_options['fields']['comment_count']['label'] = 'Réponses';
/* Champ: Contenu : Uid du dernier commentaire */
$handler->display->display_options['fields']['last_comment_uid']['id'] = 'last_comment_uid';
$handler->display->display_options['fields']['last_comment_uid']['table'] = 'node_comment_statistics';
$handler->display->display_options['fields']['last_comment_uid']['field'] = 'last_comment_uid';
$handler->display->display_options['fields']['last_comment_uid']['label'] = '';
$handler->display->display_options['fields']['last_comment_uid']['exclude'] = TRUE;
$handler->display->display_options['fields']['last_comment_uid']['element_label_colon'] = FALSE;
/* Champ: Contenu : Heure du dernier commentaire */
$handler->display->display_options['fields']['last_comment_timestamp']['id'] = 'last_comment_timestamp';
$handler->display->display_options['fields']['last_comment_timestamp']['table'] = 'node_comment_statistics';
$handler->display->display_options['fields']['last_comment_timestamp']['field'] = 'last_comment_timestamp';
$handler->display->display_options['fields']['last_comment_timestamp']['label'] = '';
$handler->display->display_options['fields']['last_comment_timestamp']['exclude'] = TRUE;
$handler->display->display_options['fields']['last_comment_timestamp']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['last_comment_timestamp']['date_format'] = 'short';
$handler->display->display_options['fields']['last_comment_timestamp']['second_date_format'] = 'long';
/* Champ: Global : Texte personnalisé */
$handler->display->display_options['fields']['nothing_1']['id'] = 'nothing_1';
$handler->display->display_options['fields']['nothing_1']['table'] = 'views';
$handler->display->display_options['fields']['nothing_1']['field'] = 'nothing';
$handler->display->display_options['fields']['nothing_1']['label'] = 'Dernière contribution';
$handler->display->display_options['fields']['nothing_1']['alter']['text'] = 'par [last_comment_uid]</br>
le [last_comment_timestamp]';
/* Critère de tri: Contenu : Épinglé (en haut des listes) */
$handler->display->display_options['sorts']['sticky']['id'] = 'sticky';
$handler->display->display_options['sorts']['sticky']['table'] = 'node';
$handler->display->display_options['sorts']['sticky']['field'] = 'sticky';
$handler->display->display_options['sorts']['sticky']['order'] = 'DESC';
/* Critère de tri: Contenu : Date de publication */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Filtre contextuel: Contenu : Possède l'identifiant de terme de taxonomie (avec profondeur) */
$handler->display->display_options['arguments']['term_node_tid_depth']['id'] = 'term_node_tid_depth';
$handler->display->display_options['arguments']['term_node_tid_depth']['table'] = 'node';
$handler->display->display_options['arguments']['term_node_tid_depth']['field'] = 'term_node_tid_depth';
$handler->display->display_options['arguments']['term_node_tid_depth']['default_action'] = 'not found';
$handler->display->display_options['arguments']['term_node_tid_depth']['exception']['title_enable'] = TRUE;
$handler->display->display_options['arguments']['term_node_tid_depth']['exception']['title'] = 'Tout';
$handler->display->display_options['arguments']['term_node_tid_depth']['title_enable'] = TRUE;
$handler->display->display_options['arguments']['term_node_tid_depth']['title'] = '%1';
$handler->display->display_options['arguments']['term_node_tid_depth']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['term_node_tid_depth']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['term_node_tid_depth']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['term_node_tid_depth']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['term_node_tid_depth']['specify_validation'] = TRUE;
$handler->display->display_options['arguments']['term_node_tid_depth']['validate']['type'] = 'taxonomy_term';
$handler->display->display_options['arguments']['term_node_tid_depth']['depth'] = '0';
$handler->display->display_options['arguments']['term_node_tid_depth']['break_phrase'] = TRUE;
/* Filtre contextuel: Contenu : Possède l'identifiant du terme de taxonomie avec modification de profondeur */
$handler->display->display_options['arguments']['term_node_tid_depth_modifier']['id'] = 'term_node_tid_depth_modifier';
$handler->display->display_options['arguments']['term_node_tid_depth_modifier']['table'] = 'node';
$handler->display->display_options['arguments']['term_node_tid_depth_modifier']['field'] = 'term_node_tid_depth_modifier';
$handler->display->display_options['arguments']['term_node_tid_depth_modifier']['exception']['title_enable'] = TRUE;
$handler->display->display_options['arguments']['term_node_tid_depth_modifier']['exception']['title'] = 'Tout';
$handler->display->display_options['arguments']['term_node_tid_depth_modifier']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['term_node_tid_depth_modifier']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['term_node_tid_depth_modifier']['specify_validation'] = TRUE;
/* Critère de filtrage: Contenu : Publié ou admin */
$handler->display->display_options['filters']['status_extra']['id'] = 'status_extra';
$handler->display->display_options['filters']['status_extra']['table'] = 'node';
$handler->display->display_options['filters']['status_extra']['field'] = 'status_extra';
$handler->display->display_options['filters']['status_extra']['group'] = 0;
$handler->display->display_options['filters']['status_extra']['expose']['operator'] = FALSE;
/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['metatags'] = array(
'und' => array(
'title' => array(
'value' => '[view:title] | [site:name]',
'default' => '[view:title] | [site:name]',
),
'description' => array(
'value' => '',
'default' => '[view:description]',
),
'abstract' => array(
'value' => '',
'default' => '',
),
'keywords' => array(
'value' => '',
'default' => '',
),
'robots' => array(
'value' => array(
'index' => 'index',
'follow' => 'follow',
'noindex' => 0,
'nofollow' => 0,
'noarchive' => 0,
'nosnippet' => 0,
'noodp' => 0,
'noydir' => 0,
'noimageindex' => 0,
'notranslate' => 0,
),
'default' => array(
'index' => 'index',
'follow' => 'follow',
'noindex' => 0,
'nofollow' => 0,
'noarchive' => 0,
'nosnippet' => 0,
'noodp' => 0,
'noydir' => 0,
'noimageindex' => 0,
'notranslate' => 0,
),
),
'news_keywords' => array(
'value' => '',
'default' => '',
),
'standout' => array(
'value' => '',
'default' => '',
),
'rating' => array(
'value' => '',
'default' => '',
),
'referrer' => array(
'value' => '',
'default' => '',
),
'rights' => array(
'value' => '',
'default' => '',
),
'image_src' => array(
'value' => '',
'default' => '',
),
'canonical' => array(
'value' => '[view:url]',
'default' => '[view:url]',
),
'shortlink' => array(
'value' => '[current-page:url:unaliased]',
'default' => '[current-page:url:unaliased]',
),
'publisher' => array(
'value' => '',
'default' => '',
),
'author' => array(
'value' => '',
'default' => '',
),
'original-source' => array(
'value' => '',
'default' => '',
),
'prev' => array(
'value' => '',
'default' => '',
),
'next' => array(
'value' => '',
'default' => '',
),
'revisit-after' => array(
'value' => '',
'period' => '',
'default' => '',
),
'content-language' => array(
'value' => 'fr',
'default' => 'fr',
),
'geo.position' => array(
'value' => '',
'default' => '',
),
'geo.placename' => array(
'value' => '',
'default' => '',
),
'geo.region' => array(
'value' => '',
'default' => '',
),
'icbm' => array(
'value' => '',
'default' => '',
),
'refresh' => array(
'value' => '',
'default' => '',
),
'itemtype' => array(
'value' => '',
'default' => '',
),
'itemprop:name' => array(
'value' => '',
'default' => '',
),
'itemprop:description' => array(
'value' => '',
'default' => '',
),
'itemprop:image' => array(
'value' => '',
'default' => '',
),
'og:type' => array(
'value' => '',
'default' => '',
),
'og:url' => array(
'value' => '',
'default' => '',
),
'og:title' => array(
'value' => '',
'default' => '',
),
'og:determiner' => array(
'value' => '',
'default' => '',
),
'og:description' => array(
'value' => '',
'default' => '',
),
'og:updated_time' => array(
'value' => '',
'default' => '',
),
'og:see_also' => array(
'value' => '',
'default' => '',
),
'og:image' => array(
'value' => '',
'default' => '',
),
'og:image:url' => array(
'value' => '',
'default' => '',
),
'og:image:secure_url' => array(
'value' => '',
'default' => '',
),
'og:image:type' => array(
'value' => '',
'default' => '',
),
'og:image:width' => array(
'value' => '',
'default' => '',
),
'og:image:height' => array(
'value' => '',
'default' => '',
),
'og:latitude' => array(
'value' => '',
'default' => '',
),
'og:longitude' => array(
'value' => '',
'default' => '',
),
'og:street_address' => array(
'value' => '',
'default' => '',
),
'og:locality' => array(
'value' => '',
'default' => '',
),
'og:region' => array(
'value' => '',
'default' => '',
),
'og:postal_code' => array(
'value' => '',
'default' => '',
),
'og:country_name' => array(
'value' => '',
'default' => '',
),
'og:email' => array(
'value' => '',
'default' => '',
),
'og:phone_number' => array(
'value' => '',
'default' => '',
),
'og:fax_number' => array(
'value' => '',
'default' => '',
),
'og:locale' => array(
'value' => '',
'default' => '',
),
'og:locale:alternate' => array(
'value' => '',
'default' => '',
),
'article:author' => array(
'value' => '',
'default' => '',
),
'article:publisher' => array(
'value' => '',
'default' => '',
),
'article:section' => array(
'value' => '',
'default' => '',
),
'article:tag' => array(
'value' => '',
'default' => '',
),
'article:published_time' => array(
'value' => '',
'default' => '',
),
'article:modified_time' => array(
'value' => '',
'default' => '',
),
'article:expiration_time' => array(
'value' => '',
'default' => '',
),
'profile:first_name' => array(
'value' => '',
'default' => '',
),
'profile:last_name' => array(
'value' => '',
'default' => '',
),
'profile:username' => array(
'value' => '',
'default' => '',
),
'profile:gender' => array(
'value' => '',
'default' => '',
),
'og:audio' => array(
'value' => '',
'default' => '',
),
'og:audio:secure_url' => array(
'value' => '',
'default' => '',
),
'og:audio:type' => array(
'value' => '',
'default' => '',
),
'book:author' => array(
'value' => '',
'default' => '',
),
'book:isbn' => array(
'value' => '',
'default' => '',
),
'book:release_date' => array(
'value' => '',
'default' => '',
),
'book:tag' => array(
'value' => '',
'default' => '',
),
'og:video' => array(
'value' => '',
'default' => '',
),
'og:video:secure_url' => array(
'value' => '',
'default' => '',
),
'og:video:width' => array(
'value' => '',
'default' => '',
),
'og:video:height' => array(
'value' => '',
'default' => '',
),
'og:video:type' => array(
'value' => '',
'default' => '',
),
'video:actor' => array(
'value' => '',
'default' => '',
),
'video:actor:role' => array(
'value' => '',
'default' => '',
),
'video:director' => array(
'value' => '',
'default' => '',
),
'video:writer' => array(
'value' => '',
'default' => '',
),
'video:duration' => array(
'value' => '',
'default' => '',
),
'video:release_date' => array(
'value' => '',
'default' => '',
),
'video:tag' => array(
'value' => '',
'default' => '',
),
'video:series' => array(
'value' => '',
'default' => '',
),
'twitter:card' => array(
'value' => '',
'default' => '',
),
'twitter:creator' => array(
'value' => '',
'default' => '',
),
'twitter:creator:id' => array(
'value' => '',
'default' => '',
),
'twitter:url' => array(
'value' => '',
'default' => '',
),
'twitter:title' => array(
'value' => '',
'default' => '',
),
'twitter:description' => array(
'value' => '',
'default' => '',
),
'twitter:image:src' => array(
'value' => '',
'default' => '',
),
'twitter:image:width' => array(
'value' => '',
'default' => '',
),
'twitter:image:height' => array(
'value' => '',
'default' => '',
),
'twitter:image0' => array(
'value' => '',
'default' => '',
),
'twitter:image1' => array(
'value' => '',
'default' => '',
),
'twitter:image2' => array(
'value' => '',
'default' => '',
),
'twitter:image3' => array(
'value' => '',
'default' => '',
),
'twitter:player' => array(
'value' => '',
'default' => '',
),
'twitter:player:width' => array(
'value' => '',
'default' => '',
),
'twitter:player:height' => array(
'value' => '',
'default' => '',
),
'twitter:player:stream' => array(
'value' => '',
'default' => '',
),
'twitter:player:stream:content_type' => array(
'value' => '',
'default' => '',
),
'twitter:app:country' => array(
'value' => '',
'default' => '',
),
'twitter:app:name:iphone' => array(
'value' => '',
'default' => '',
),
'twitter:app:id:iphone' => array(
'value' => '',
'default' => '',
),
'twitter:app:url:iphone' => array(
'value' => '',
'default' => '',
),
'twitter:app:name:ipad' => array(
'value' => '',
'default' => '',
),
'twitter:app:id:ipad' => array(
'value' => '',
'default' => '',
),
'twitter:app:url:ipad' => array(
'value' => '',
'default' => '',
),
'twitter:app:name:googleplay' => array(
'value' => '',
'default' => '',
),
'twitter:app:id:googleplay' => array(
'value' => '',
'default' => '',
),
'twitter:app:url:googleplay' => array(
'value' => '',
'default' => '',
),
'twitter:label1' => array(
'value' => '',
'default' => '',
),
'twitter:data1' => array(
'value' => '',
'default' => '',
),
'twitter:label2' => array(
'value' => '',
'default' => '',
),
'twitter:data2' => array(
'value' => '',
'default' => '',
),
),
);
$handler->display->display_options['path'] = 'taxonomy/term/%';
$translatables['sujet'] = array(
t('Master'),
t('plus'),
t('Appliquer'),
t('Réinitialiser'),
t('Trier par'),
t('Asc'),
t('Desc'),
t('auteur'),
t('Dernier commentaire'),
t('Sujets'),
t('[title_1]</br>
par [name] le [created]'),
t('Réponses'),
t('.'),
t(','),
t('Dernière contribution'),
t('par [last_comment_uid]</br>
le [last_comment_timestamp]'),
t('Tout'),
t('%1'),
t('Page'),
);