News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Delete member does not remove poll vote

Started by jamesk, June 06, 2008, 11:52:48 AM

Previous topic - Next topic

jamesk

SMF Ver 1.15

I've had an instance where a person registered multiple accounts in order to change the # of votes in a poll.  All the accounts registered with that same IP address were deleted and the # of voters in the poll was decreased, but the vote itself was not removed so the total number of votes did not match the total number of voters.

I don't know if this would be considered a bug or not.  I removed (what I believe to be) the person's multiple votes by manually changing the quantity in the database, but I think this is a feature that should be done automatically, no? -- Unless the user's particular vote is not kept track of in the database...

I know there is a "who voted for what" mod, but I don't want to install it as I don't want even the admins to know what someone else voted for...



RyanB88

#1
I wouldn't call it a bug.  Just a feature that dosen't yet exist.

EDIT: To clairify for it to be able to remove their vote, it would have to know what they voted, AFAIK SMF just keeps a count of how many times something was voted for.

greyknight17

That would throw things off. Did you try running a repair or recount to see if it helps? Go into Admin->Forum Maintenance and run the following:

Find and repair any errors.
Recount all forum totals and statistics.

You can give it a test run by creating a test post with a dummy user. Make it vote and then delete the user.

jamesk

RyanB88:   I believe SMF does keep count of who voted for what.  In the database, there's a smf_log_polls which has ID_POLL, ID_MEMBER, ID_CHOICE.  Since the programmer thought enough to decrement the total # of voters, he/she probably should've added code to make [pseudocode snippet] ID_CHOICE = 0 for all ID_POLL where ID_MEMBER = memberToDelete [/pseudocode snippet].  If I have time and don't get too lost in the coding, I'll try to have a look...

greyknight17:  At you suggestion, I tried both repairing and recount to no avail.  The deleted user's vote still existed but the total number of voters was 0.

RyanB88

I haven't looked extensivly at it to know for sure.  BUt if it does log it, and recounting statistics dosen't fix it, it seems that you might have to manually remove the users votes, but atleast you can know for sure what their vote was.  Maybe somone could write a mod to recalculate votes, removing votes from deleted users, i could write a php script to go do that, but I don't have the php skills to write a full mod that will intergrate into SMF.

greyknight17

We can move this over to the Mod Request board for you if you like to see a mod created for this.

Advertisement: