Hi - I have two rate widgets on each node. I would like to display the second rate widget ONLY IF the user has responded to the first one. I am not sure how to test if the first widget has been responded to in my template file php. Currently, the code looks like...

print rate_embed($node, 'ownit', RATE_FULL);
print rate_embed($node, 'thumbsupdown', RATE_FULL);

I basically am looking for the correct if statement before displaying the second line of code. Please help.

Thanks.

Comments

texas-bronius’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev

Hi - I'm not a maintainer, but I wanted to offer two tips:

First, Rate 2 (2.x) branch doesn't yet support something equivalent to rate_embed(), so I've updated this issue's attributes to reflect the branch you're more likely working in -- please correct me if I'm wrong.

Secondly, you're on the right track. So in order to get the current node's voting status, you will want to invoke a Voting API call (the engine that works behind Rate). I think votingapi_select_votes, votingapi_select_single_vote_value, or votingapi_select_single_result_value from votingapi.module is what you're after.

Hope this helps.

ivnish’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 7 is EOL. Issue will be closed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.