General Question

Dog's avatar

How to create a poll in a SMF forum where mulitple votes are allowed for the same answer?

Asked by Dog (25152points) August 1st, 2009

I am building a forum for a fellowship that helps animal charities.

As a means to make it easy to see which charities is not getting as much help as the other I set up a poll with answers that are the charity names.

This is how it needs to work:

Lets say I paint a painting and it sells to benefit Old Dog Haven I vote for Old dog haven. All the other members do the same when they make a sale to support one of the charities. This way since the results are always visible we can see which charity needs support.

Here is the problem- lets say the next week I paint another painting that sells for Old Dog Haven. The poll as it stands right now will not allow me to vote more than once for each answer.
(It will let me vote once for each charity but not more than once)

Does anyone know how to override this so that each member can add to the votes multiple times for each charity?

I have researched and posted in SMF forums with no luck yet. Any help offered will be greatly appreciated.

Observing members: 0 Composing members: 0

6 Answers

Dog's avatar

This problem was solved by one of our brilliant new LifeHacker members @gggristo!

Many many thanks to you gggristo! Wish you would post to get the Lurve you so deserve!

gggritso's avatar

Disclaimer: Implementing my “fix” permanently breaks the functionality of polls where the users can change their vote.

Step 1: For the poll in question, in the Admin panel of SMF allow the users to change their vote.
Step 2: In the Sources folder, in the Poll.php file around line 130 you will see this block of code:

// Update the poll totals.
db_query(”
UPDATE {$db_prefix}poll_choices
SET votes = votes – 1

change “SET votes = votes – 1” to “SET votes = votes – 1”

Done.

Dog's avatar

:) Do you not mean:

change “SET votes = votes – 1” to “SET votes = votes ” ?

Many thanks- it is working brilliantly!

gggritso's avatar

Oh whoops, yeah. Got a little ahead of myself there.

Dog's avatar

HA! Lured you back for more lurve.

Seriously you saved me hours if not days of seeking and implementing a workable alternative.

In a nutshell this odd and remote question is what Fluther is all about. It is about a collective of people with unique talents sharing valuable information that cannot be found anywhere else.

Response moderated (Spam)

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther