I've been having a rummage on the net to see what I could find, and actually found what looks like a great script:
For something that could have been quite daunting, I've managed to replicate the basic demo, and also apply it to my existing data.
I know ideally each lodge page would be a details page, but because the site owners wanted the lodge name to be in the URL, each lodge actually has its own page. So all I needed to do was replace the array values with the LodgeID, and it seems to be working pretty well. It doesn't seem to write the average score to a database field, but that might be a good little exercise to see if I can figure it out. Although for our purposes, as long as the average rating is appearing on the site, we won't need it in the data. Although we will need the total score.
Similarly with the users, I don't think we'll need site visitors to be logged in to vote, but at a later stage we will need a user group, Judges, to log in and vote.
The long term plan as I understand it is to be able to come up with a Total Score for each Lodge, where site visitors can give a score out of 3, and judges give a score out of 15 (their votes deemed to carry more weight than passing visitors).
So in theory I just need to have a second version of the basic voting behind a login, that mutiplies the score by 3 for votes made by the Judges.
I don't think we need to record who is voting, which should hopefully keep it more straightforward.