Closed (fixed)
Project:
Fivestar
Version:
6.x-1.17
Component:
Documentation
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
11 Mar 2007 at 05:10 UTC
Updated:
30 Dec 2010 at 18:48 UTC
Jump to comment: Most recent file
Comments
Comment #1
Rob_Feature commentedI actually had this same question...Just started using fivestar and wondered what the point of this field is if only those editing the node see it...I guess there could be a use, but I wonder what the intended use is...
Comment #2
quicksketchFivestar provides two mechanisms for voting:
- Voting on the node which contains it (set at the content type settings, self-explanatory functionality)
- Voting on another node (the purpose of the CCK field, explained below)
For 90% of cases, when you're setting up a CCK type which votes on another node you'll need to use to determine the Node ID to be voted on.
Say you want a 'review' type which votes on a 'product' type. You'll create a new fivestar field in your 'review' type and enter PHP code necessary to retrieve which node you want the review to point to. For example:
- Create a link to add a review: /node/add/review?target=30, where 30 is the nid of the 'product' node your reviewing
- In the Node ID textarea for your fivestar field, use this php code:
Now each review will register a vote on the target node.
Comment #3
elki-1 commentedI'm interested in collecting several votes per node - essentially rating different aspects of the node. We want users to be able to vote, not just the content creator.
Adding one CCK voting field allows the creator to provide a vote, but not the users.
If we add a second, we can enter a second vote when creating content, but when the node is displayed the second set of stars aren't displayed.
Presumably we're looking to use this module for a task it is not designed for. If so, do you have another suggestion? And, if not, can you help us to get the behavior we need?
Many thanks,
Elki.
Comment #4
quicksketchThe only way to do what you describe is to create a 'review' type and add several fivestar fields to that type, allowing anonymous users to post reviews. Collecting multiple votes on one node is a separate feature request.
I'm going to mark as closed as scottg has not posted since asking the original question.
Comment #5
snufkin commentedI think the problem can be rephrased as a feature request:
lets say we have a review about a location, and we want to allow users to rate not just the node, but custom fields like 'wifi access', or 'personell'. it is not convenient to allow users to edit the whole node and resubmit, first its problematic content-wise, and not userfriendly either. Using AJAX submission rating can be done without editing the node itself (i think this was the original issue in this thread too). Im quite sure that all the components are in place, I am simply not advanced in jQuery to do it myself. I imagined a new widget type, for live voting, which onclick events simply casts the vote.
I set it to active and changed to feature request, because I think this feature would be a really useful one.
Comment #6
scottg commentedSorry I haven't been following this thread, but I think snufkin summed it all up pretty well. I had wanted a certain node type to have four different voting criteria and also display an average of those criteria. In the end I just modified the original fivestar module and "hard coded" that functionality. It was kind of a hack, but it worked for my site.
I agree a separate widget would be a much better solution.
Comment #7
mikelove commentedyes - this cck field live voting feature is what i was looking for as well.
Comment #8
ezra-g commentedIt sounds like people want to be able to rate nodes on multiple axis using the Fivestar CCK field. Being able to dynamically set the target NID (as quicksketch explained in #2) is an extremely useful feature.
Perhaps as part of the field configuration, users could set the 'value_type' and 'tag' values used by the Voting API. That way, each field can register as a vote (percent, vote) or a rating(rating, axis_name), similar to how the nodereview module stores ratings.
I realize the maintainers are likely busy with the upcoming Drupal 6 code freeze. If this sounds like an acceptable addition, I'll get more familiar with the module and submit a patch.
I'm respectfully changing the issue title so that it might more specifically indicate the feature being requested.
Comment #9
eaton commentedThat would be an excellent point of configurability for the module, and how it needs to be done. I'll give a quick heads up: changes would have to be made to the menu callbacks, as they currently rely on a specific set of url driven information. Ideally, the menu callbacks in question would be changed to accept POST data from the jQuery functions, instead.
The other trick is that clicking EACH of the stars for a multi-critiera vote would probably trigger a 'vote' event when using the module in non-CCK scenerios. That's probably inefficient, as it would trigger recalculation each time. I'm not sure what the best solution is, but it's something to think about. I know I don't have time to dive into it just yet but I'd be happy to brainstorm with anyone kicking around ideas about how to best approach it. Posting to this issue would be the best bet, probably...
Comment #10
raintonr commentedAfter reading the above a few people are asking for functionality that we were looking for.
As it stands, Fivestar is able to have a single vote per node. This is great, but we'd like to be able to rate different aspects of a node without the voter having to create a 'review' or other node type linking back to it.
In the 'content type' admin section at the moment there's the 'Enable Five Star rating' checkbox, etc. Ideally I'd like to see this extended to have 'Rate these attributes for this content type:' and have multiple qualities. Eg, we run a mountain bike web site with trail descriptions. It would be great if the users could not only vote for overall score for each trail, but also rate the trail on technical/downhill/XC/fitness categories too. Multiple Fivestar widgets could line up under each other. Ideally one could make a view with a grid of trails and their voted attributes.
This is only a lofty wish for us, but wanted to mention that the ideas in this request sound good.
Thanks for the module as it's working very well as is on our site anyhow.
Comment #11
parajeff commented+1 for multiple axes functionality for FiveStar. A simple, clean way of adding more than one rating category into a content type would be very, very useful.
How involved would this be?
Comment #12
drutube commentedOur needs are more simplistic and I'm not sure a feature request is way for me to approach this but this thread got me going and sums it up perfectly. Quickstretch pretty much answered this for me but I need a little Drupal help to bring it home. Or I may be all wrong about what I'm seeing. Its late.
We need for users to be able to rate nodes that in this case are CCK content types that are just profiles of real estate agents. So they are rating the agent. There are 7 or 8 statements the pertain to the user's experience like "agent was punctual" ect. They rate them using 5 star. See the attached.
Create a link to add a review: /node/add/review?target=30, where 30 is the nid of the 'product' node your reviewing
I did what Quickstretch described here..
Then I created a link to the review type (which again is a bunch of 5 stars) with the /node/add/review?target=30 [the 30 was the node id of the agent. I added reviews using that link as two users and the devel module showed the data was indeed in the the voting cache
And sure enough it was there.
The NID was 77 btw.
Those fileds are the fivestars.
So the thinking is seems like thiw should work
Step 1. Add a link to node/add/[multiquesiton review content type] to the nodes for Agent that passes the node ID like href="/node/add/agentatribute2?target=77 which is exactly what got the below results. Getting this to be a setting for the content type to automatically link to the add content url for a review content should be automatic.
The agent is created from a separate content type and not a user node as it is hard to add the user node as another user....
So in step one the call to add the review content would have to reference the node or itself as the target. That seems simple enough. The node would already be created so it just needs to look at its own node id and pass that via the url to the link to create the review. Right??
Step 2. Create a crude method to just sum the results and divide by the number of responders for that question. Not all will respond for every question . Spit this out in a view or table and call it a day.
Or something.
screenshot provided.
I guess my question does anyone having any ideas on one or two.
Comment #13
hadishon commented+1
I would like to have the same capabilities that others are describing in this thread. Has anyone found a work around for this yet?
Comment #14
j0k3z commented++
Comment #15
j0k3z commented++
Comment #16
sparr commented+1
I spent hours setting up my content types, naively expecting this functionality to already be in place. I was quite disappointed, and now I do not have a good way to accomplish my goal (which is quite similar to that stated by others above).
Comment #17
bibo commentedI also need multi-axis criteria (which should be configurable per node, not nodetype). I guess the ajax calls become a lot harder to do if there are several axis, but I'd love to see this functional.
I like the handy UI of Fivestar a lot, but I need primarily flexibility. Can anyone point me to another rating module that allows defining multiple criteria axis that are configurable for each node (via CCK or something else)?
Comment #18
anders.fajerson commentedSubscribing and bumping up the version number.
Comment #19
rares commentedI think one solution is to force fivestar fields into the userreview form. that allows people to vote on multiple axes from within userreview.
the first problem to implementing this is that userreview displays those lousy messages "to add a review go to the node..." when you try to mess with its content type. one workaround for that is to hack the module so that it doesn't generate those messages anymore. another hack would be to import the field from a different content type.
the next problem is that there is no votingapi vote counting and averaging on those extra fields. the module needs to be hacked again to do that.
I have not taken the time to make this work yet but I have had luck with adding fields to userreview. If you think this is a good idea and try it please let me know how it works.
Comment #20
ezra-g commentedThis patch implements configurable CCK multiple axis ratings using Five Star. It adds an axis textfield on the field configuration page. If the field is left blank, Five Star uses the default 'vote' tag under the Voting API. It's worth noting that I updated the queries in _fivestar_cast_vote() so that Fivestar can distinguish between votes already cast by a user for a particular tag. This prevents the module from mistaking two votes by the same user on different axis for the same piece of content (such as deliciousness, presentation) as a "double vote" -- instead, each gets its own vote id.
I tested this with a custom node type containing 1 and then 2 Five Star CCK fields, which operated without interfering with the functionality of the regular non-CCK Five Star widget on the bottom of the test node.
Note that the axis field can be changed in the field configuration and that doing so will not update votes from the votingapi_vote table. This shouldn't cause a problem, and having Five Star go through all recorded votes to update old ones to reflect a changed axis could get more complicated than perhaps is necessary. Such a feature might require keeping more data about which vote was registered not only by a particular user and IP address, but a particular field. In my mind that heads down the road of vote accountability (paper trails and recounts) which seems outside of the scope of this feature.
Comment #21
quicksketchAmazing that all that talk and +1ing we got that the actual patch is only like 30 lines of code. ;-)
Thanks ezra. I'll review and post soon. Any interested users please try out the patch and post any problems. This patch has my full support.
Comment #22
quicksketchIt's looking pretty good overall but I ran into an issue with the 'axis' field being left blank. Apparently, if the axis is left blank, a vote is submitted with no axis at all, rather than defaulting to 'vote' like the help text describes.
I cleaned up the Axis field help text and made it a textfield rather than textarea in this patch. Though the problem with the vote axis not being set is not fixed. Ezra could you have another look at this?
Comment #23
mikelove commentedAm I missing something? I applied the patch, successful changes to fivestar_field.inc and fivestar.module, but the fivestar CCK fields still can only be edited through node edit.
Comment #24
quicksketch@mikelove, I think you might be requesting a separate feature than this patch seeks to add. This patch makes it so you can add multiple Fivestar CCK fields to a node type and each set of stars will rate on a different category (or axis), such as 'quality', 'satisfaction', 'overall', etc. Making it so users could vote on multiple aspects. It has nothing to do with making CCK fields available without editing the node.
Comment #25
anders.fajerson commentedI opened a new issue for that feauture request: http://drupal.org/node/185074
Comment #26
ezra-g commented@Quicsketch: I should be able to take a look at this tomorrow. Thanks for testing!
Comment #27
ezra-g commentedpardon the typo in your name, Quicksketch. I owe you a 'k'.
Comment #28
sparr commentedGiven that scott specifically mentioned having to edit the node in the original issue report, I would say that the real failure is for this patch to address the other half of the problem-as-stated.
That said, I think that this patch is very nice, and does address *A* need, if not *THE* need of this issue. I do not think that the other issue should be forked, but that this patch should be continued or added to until it meets both needs listed here.
Comment #29
ezra-g commentedThis issue is called "Rate on multiple axis using CCK field" and that is what this patch will implement. Non-cck functionality is another feature issue and patch. I hope to have this re-reviewed this evening.
Comment #30
mikelove commentedI appreciate the work for this patch, just wasn't sure if it was going after the 'live voting' that had been mentioned here and there.
Moving to this other issue now - http://drupal.org/node/185074- I think a lot can be taken from this thread. Is it best to do live voting on multiple axes by starting with the widget mechanism rather than the CCK mechanism?
Comment #31
ezra-g commentedIn my testing, this clears up the default 'vote' tag not registering when the axis field is left blank.
This patch also adds a
$tag = nullto the function definition of _fivestar_cast_vote() to prevent a missing argument error when called by fivestar_form_submit() though I didn't see any such errors when testing as that function was never called.Comment #32
ezra-g commentedMoving this back to CNR
Comment #33
quicksketchI found another small bug: if a node has been voted on in two axis, when using the ajax rating widget on the node view side, the updated average and count total could be incorrect if the tag had a value alphabetically after 'vote'. This was actually an existing bug, but it just came to light with the addition of this patch.
To set a default argument, I changed the function declaration to
Other than that change, everything went great. Committed to 5.x. Thanks ezra!
Comment #34
mikelove commentedHere's a way to display stars for the CCK fields on the target node.
In fivestar.module, function fivestar_form, after this line:
$current_avg = votingapi_get_voting_result($content_type, $content_id, 'percent', 'vote', 'average');Add a line:
$current_yourfield_avg = votingapi_get_voting_result($content_type, $content_id, 'percent', 'yourfield', 'average');Then under case 'dual':
Add another:
Comment #35
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #36
stg11 commentedThe patch doesn't seem to be working for me.
I applied the changes in comments #31 and #33 and updated my cck fivestar field to have a voting axis.
Then I created a fresh instance of the content type to test with.
The result is the same as before any changes -- the node can't be rated on my cck fivestar when in view mode, the default node-level fivestar widget works ok as before. I noticed with firebug that the class id being generated for the cck fivestar is still "fivestar-widget-static clear-block" instead of "fivestar-widget clear-block", which the default fivestar widget uses and corresponds to line 130 of the jquery.rating.js.
Is there something I'm missing or is there a bug?
Thanks
Edwin
Comment #37
totalsense commentedsubscribe
Comment #38
stg11 commentedPlease ignore my last comment. I misunderstood the intent of the patch. I will now monitoring http://drupal.org/node/185074 closely as I need the community voting on multiple axis for a given node.
Comment #39
bardkerbie commentedI don't usually crosspost, but it seemed appropriate.
I've been trying to figure out how to implement this properly, with no success. Therefore, I've posted a bounty for documentation related to this:
http://drupal.org/node/208054
Comment #40
Marquis commentedsubscribe
Comment #41
batje commentedsubscribe
Comment #42
vkr11 commentedSubscribe.
-Victor
http://drupalsearch.org
Comment #43
subhajit chatterjee commentedGo Adminter->Site COnfiguration->votingapi
then "changeAnonymous vote rollover" to "Immediately"
then anonymous users will be able to rate in fivestar.
Thanks
With warm regards,
Subhajit Chatterjee
Comment #44
ezra-g commentedComment #45
abhid90210 commentedsubscribe