I have a review site on which people can rate spa's. A user can visit the user profile pages of individual users. I would like the user profile page of every individual user to show the 3 spa's they rated highest. To do so I enabled blocks on the user profile page. Subsequently I use views to make a block in which the top 3 spa's are shown.

To show the top 3 per user I need to do the following:
1) add a relationship based on individual votes
2) add an argument in which I retrieve the user uid or name of the profile page the user is visiting.
3) sort the nodes based on the vote casted by the user whose profile page is being looked at.

Does anybody know how this can be done?

I can only find relationship based on number of votes or aggregate result. In the arguments function I do not see any reference to the individual user who voted.

Is the top 3 spa list per individual user not possible or am I overlooking something?

Thanks in advance for your replies

Comments

oeroek’s picture

Update:Almost there.
Using drupal 6, views, voting api and fivestar

1) made a block view
2) relationships added, 1) node vote results (procent, normal vote, average vote) and 2) node:votes (procent, normal vote)
3) Arguments: Votes: user. Default argument-> php

if (arg(0) == 'user' && is_numeric(arg(1))) {
  return arg(1);}

I want this block to be available on a user profile page only. The top list should be based on the user whose profile is being looked at.
4) Fields used are node :title and Vote result.

The live preview can be given the user id as argument after which it shows all nodes on which that user casted a vote together with the fivestar widget.

Remaining question:
The fivestar widget shows the current average vote of that node and in text it mentions the vote of the user who is watching/signed in.

However I want the fivestar widget to show the vote of the user whose profile we are looking at (ie the argument). Does anybody know how this can be done?

legolasbo’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Drupal 6 is no longer supported. Closing old issues to clean up the issue queue.

Please reopen and update this issue if this is still an issue in the D7 or D8 version.