Closed (outdated)
Project:
Rate
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
10 Aug 2011 at 10:54 UTC
Updated:
18 Sep 2025 at 13:12 UTC
Jump to comment: Most recent
This is my initial attempt at a rate field. Not sure if I did it all correctly, I used email.module as a guide.
Tested only on a custom options widget. I decided to do this as a module and if it all works ok it could be merged into the rate.module code itself.
I have a added a rate widget selection, and a php textarea that picks the target to be rated.
Many things may be missing / not working , so please update where you can!
| Comment | File | Size | Author |
|---|---|---|---|
| ratefield.tar_.gz | 1.44 KB | chrisroditis |
Comments
Comment #1
Luna Vulpo commentedI try your module but I get this errors, when I adding a new field.
Comment #2
andypostGreat idea, but for 1.x branch you need just implement hook_field_extra_fields()
Comment #3
IWasBornToWin commentedIs this working in new dev? Can we use it as a field yet?
Comment #4
mauritsl commentedNot yet, I've implemented this yesterday evening. 2.x branch is outdated, I will update it soon.
Comment #5
IWasBornToWin commentedExcellent, thanks
Comment #6
IWasBornToWin commentedSorry to bother you but how long do you think it will be before this can be added as a field, or used on different node/comment types?
Comment #7
mauritsl commentedI plan to release a beta somewhere begin april (but no guarantees on vulunteer work..)
Please note that you can already activate the widget on different node/content types in the 1.x branch. See the edit widget page in the admin.
Comment #8
IWasBornToWin commentedThank you. My big challenge is being able to use it on comments and only show the tally of votes on the node. I am looking for a solution which will allow a user to vote as many times as they want on comments and the node simply shows the totaled average.
Comment #9
mauritsl commentedI'm exploring new ways for vote aggregation, but that will not make it in the first 2.x release either.
For now you have to go with some custom code. This can be done by implementing hook_votingapi_insert():
Comment #10
IWasBornToWin commentedI'm grateful for your responses. I have no idea where to put that code. I do my best not to hack core if I can help it. I also use Views Css code module. Is there a way I can put this code in a veiws php module or what? Just to know, I use Views to view the nodes and comments I want to use rates for. So, I assume your code is saying--if I get votes on a bunch of comments to total those votes for the comment node?
What field would I use to put the votes in(or would I create a field) since Rate doesn't allow me to use comments? Sorry for all the questions.
Thank you again.
Comment #11
ocamp commentedWould this way work with fields instead of comments?
like
$vote['node'][ 'title']
$vote['node'][ 'body']
Anything like that?
Thanks
Comment #12
spgd01 commentedAny progress on this? It will greatly help with display.
Comment #13
AncientSwordRage commentedAny progress on this yet?
Comment #14
ivnishDrupal 7 is EOL. Issue will be closed, but patches are still here