3

I've got a website where people vote on a user using a button found on the user's profile page, and where users are ranked on the homepage based on the number of votes to their name (along with some fields associated with their account).

I'm trying to implement this voting system using another module (because the voting API isn't particularly well documented). Unfortunately, the Rate module is only suitable for nodes and comments, and the Fivestar module is not suitable for this purpose (I just need a single vote button).

I've also tried adapting the Flag module, although this is proving to be difficult, because I need the ability for users to vote a maximum of once per week on a profile, and by default, it does not allow this.

I'm using Drupal 7, and I have access to cron jobs and full control of the drupal installation.

I'd be grateful if anyone who has experience with the voting API, or a different module could direct me on how to set up this system.

1
  • If you have some time, wait for the Rate 2 release: "Rate 2 has been developed considerably. [...] Major improvements are: [...] * Can be added to all kind of entities"
    – Turion
    Commented Sep 1, 2014 at 9:21

2 Answers 2

1

if you end up getting stuck, you could create a Rule that populates a node when a user is created, and essentially create a node-based profile that the user can edit, then use Rate. Look at Node Limit to limit the profile count to 1 node per user, and set permissions on the content type to restrict the user being able to only edit (and not delete) their own content.

Rules:

The Rules module allows site administrators to define conditionally executed actions based on occurring events (known as reactive or ECA rules). It's a replacement with more features for the trigger module in core and the successor of the Drupal 5 workflow-ng module.

Rate:

This module provides flexible voting widgets for nodes and comments.

Node Limit:

The Node Limit module allows administrators to restrict the number of nodes of a specific type that roles or users may create. For example, if a site has an "Advertiser" role that can create "advertisement" nodes, then the node limit administrator can restrict all users in that role to a specific number of nodes. He may also restrict users on a per-user basis.

1
  • And set up a rule that deletes the node when the user is deleted! (And possibly other bugs?)
    – Turion
    Commented Sep 1, 2014 at 9:14
0

Choose the Flag module.

You should be able to disallow voting more than once per week by setting up a custom rule that saves the time of flagging in an additional field if it's unset, or looks up the last time of flagging if it's set and discards the flag if it's less than a week.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.