By Obrittian on
I'm using Voting API and Fivestar Modules to calculate and sort scores. I was just wondering how I could reset the results.
I'm using Voting API and Fivestar Modules to calculate and sort scores. I was just wondering how I could reset the results.
Comments
Why not have a look at the
Why not have a look at the source for votingapi.module? There's a function in there to find votes (by node mostly), and another function to delete votes. Try something like:
Sorry
I'm not experienced in writing code. I have absolutely no idea what I would do with that. Do you think you could explain it me?
Sorry, I made a wrong
Sorry, I made a wrong assumption:
There is currently no function in the UI to delete all the votes for a particular node, so you'll have to execute some custom code. How you do this depends on your application: if you just want to do this once, then you could install "devel" module, enable the execute-PHP block, and paste in the code above.
If you want to do this more often, you could probably ask someone to write you a module, to add this functionality to the UI (or patch fivestar/voting API). If you were doing that, it might be worth doing the code a little more efficiently, since the method above will have issues when there are many (hundreds) of votes for the node.