Hi,

I am using the votingAPI (with fivestar) with views. I can create a relationship with "Individual Votes".

I add a field "Voting API votes: User" to show which user created a rating.

This shows up, I get the uid of the user who rated the content.

Can I change this to show the username instead of the uid? I'd like to see the username and not the uid...

Thanx in advance!

Comments

timlie’s picture

Managed to get it to work with a views tpl file, views-view-field--viewname--uid.tpl.php

and the following code:

  $user = user_load($row->{$field->field_alias});
  $userpath = 'user/' . $user->uid;
  print l($user->name, $userpath);

I could have used a custom theme function as well but I'd like to have the default theme function.

timlie’s picture

Managed to get it to work with a views tpl file, views-view-field--viewname--uid.tpl.php

and the following code:

  $user = user_load($row->{$field->field_alias});
  $userpath = 'user/' . $user->uid;
  print l($user->name, $userpath);

I could have used a custom theme function as well but I'd like to have the default theme function.