Closed (fixed)
Project:
Voting API
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Jul 2010 at 20:32 UTC
Updated:
2 Apr 2013 at 06:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
ledom commentedFinaly found a workaround by hacking votingapi.module and removing test on criteria an window:
Before:
311 if (!empty($criteria['vote_source']) && $anon_window >= 0) {
312 $criteria['timestamp'] = time() - $anon_window;
313 }
After:
311// if (!empty($criteria['vote_source']) && $anon_window >= 0) {
312 $criteria['timestamp'] = time() - $anon_window;
313// }
Comment #2
jcisio commentedI move this issue from vote_up_down to VotingAPI if you don't mind.
Comment #3
marvil07 commentedNot exactly what you asked for, but related: #813534: +N/-N votes on widgets
Comment #4
jjchinquistHello,
I too am intersted in changing the behaviour (adding a setting in the API admin/settings/votingapi form). It appears straight forward.
I would add a new setting option to admin/settings/votingapi to add a time interval of a non-anonymous user vote. That would then record it to the DB votingapi.module >> votingapi_set_votes
Can anyone answer this question though, if non-anonymous votes are sent and recorded multiple times (1x / day / content_id / uid or 1x / week / content_id / uid, etc.) to votingapi and then to the database, will this mess up any other modules (like advpoll) where it assumes each logged in user votes only 1x / content_id / uid?
Thanks!
Comment #5
jjchinquistIt will take me a bit of time to get the patch created due to technical reasons. However, here is the changes in code I did locally, which worked. Maybe someone can patch on the newest dev version and test.
votingapi.module addition to administration form
votingapi.module change to votingapi_select_votes
votingapi.install change for removing variables on uninstall
Comment #6
NathanM commentedSubscribing & will test out this patch later.
Comment #7
jjchinquistHello NathanM, there is one problem with the following section. If the VotingAPI Admin form is set to "Immediate" then the old votes are overwritten exactly the same as if "Never" were selected.
Old Patch
New patch
Comment #8
Megha Shah commentedIs this patch tested? I'am interested in the same functionality.
Comment #9
emergencyofstate commentedNeed this same function desperately for D7 version.
Comment #10
havran commentedWith Rate module you can use this solution (this code is part of my custom module - in my case it's name is regions_vote):
Comment #11
frichman commented+1
It would be great if we could get an official patch for this for the D7 version.
Comment #13
balsamaPatch incorporating #5 and #7 for Drupal 6 dev branch attached.
Comment #14
balsamaDrupal 7 patch attached.
This needs to be tested. It looks like the votingapi_select_results() function was slightly modified in the D7 version. I copied @jjchinquist's version from comment #7 above verbatim, which I think was written for the D6 version.
Comment #15
balsamaAfter looking at @jjchinquist's code again, I noticed that it included a db_fetch_array, which obviously won't work in D7. I changed that to a foreach loop in the attached patch.
This patch is still untested though.
Comment #16
istryker commentedOk I think I found 2 problems
believe #2 applied to 6.x patch too.
Comment #17
istryker commentedAnother problem is at the end of patch #14. Something tells me from between May 26th, 2011 and now, the method of selecting the votes from the database has changed. Some one can double-check if they like.
D7
Other than that it works.
Attached is my D7 patch, with the changes from this comment and #15.
Attached is @balsama D6 patch, with 3 changes:
votingapi_select_votes()Comment #18
balsamaThanks @iStryker.
Using fivestar, D7 and the votingapi-registered_user_rollover_D7-860886-16.patch patch, I can confirm that both anon and auth voter rollovers are working as I would expect them.
Comment #19
Juan C commentedThanks for the patch. It works.
It would be nicer if the patch allows permission to certain roles only, not all authenticated users, to have the permission for multiple votes.
Cheers,
Comment #20
franzkewd commentedUsing Advanced Poll, Drupal 7.20, Patch #17. It just works as expected.
Agreed with #19 if we can have the permissions for certain roles only for multiple votes.
Comment #21
torotil commentedCommited a slightly modified version of this patch to 7.x-2.x. Thanks!