I'm using zenphoto version 1.2.5_RC2 [4019] since about one year.
I'm very happy with it and I want to thanks again all the developers for their work.
Now I've found a small problem in this plugin.
I had a look to the latest version of ZP and it seems still present, so I bring it to your attention.
If you remove your rating without insert a new value the total_votes in database remains the same as it was before, so next time you (or someone else) vote the value is divided by actual total votes + 1.
The solution I found is to add this line in update.php:
`if (!$rating) {$voting = -1;}`
at line 71 in my version of the plugin or at line 78 in the latest (official) version.
Comments
Just FYI, 1.2.5_RC2 is not even an official release of the 1.2.5 version of Zenphoto much less a curent version (1.2.9, soon to be 1.3.0.)
Anyway if you want to check what I am sayng the line in the latest SVN is N. 41.
Near the end of the script, after
`
35 if ($oldrating) {
36 $voting = 0;
37 $valuechange = $rating-$oldrating;
38 if ($valuechange>=0) {
39 $valuechange = '+'.$valuechange;
40 }
`
and before
`
41 } else {
42 $voting = 1;
43 $valuechange = '+'.$rating;
44 }
..
`
[edit] Sorry, but I cannot reproduce the original issue with the current release.
Note that this appens only if you retire your vote, not if you just change it.
1) Pick a not rated photo
2) Rate it to 5 stars and refresh the page
3) Delete your rating and refresh the page
4) Rate it again to 5 stars and refresh
5) Now you should see the issue. The rating will be 2.5 with 2 votes instead of 5 with 1 vote..
Quite strange btw
Thanks again for this wonderful CMS!
Ciao