<%args> $nlw => undef $definitionid => undef $place => undef $stfu => undef $word => undef $meaning => undef <%method title> Vote Recorded (Probably) <%init> our(%session,$dbh); <%perl> unless(defined($session{'username'})) { Voting Error!

Sorry, you've got to be logged in!

<%perl> return; } <%perl> unless(defined($nlw) && defined($definitionid) && defined($place) ) { Voting Error!

Sorry, you've got to tell me what you want to vote for!

<%perl> return; } if( ! defined( $stfu ) ) { Voting...

Any previous vote will be silently removed.

<%perl> } else {

Recording your vote on word "<% $word %>" in sense "<% $meaning %>".

<%perl> } # We're deleting all entries for the current wordid. Since wordid # is constrained to be a particular word with a particular meaning # in a particular language, this deletes all previous votes by the # users. $dbh->do("DELETE FROM natlangwordvotes WHERE natlangwordid=? AND userid=?", undef, $nlw, $session{'userid'}); $dbh->do("INSERT INTO natlangwordvotes (natlangwordid, definitionid, place, value, userid, time) VALUES (?, ?, ?, (SELECT votesize FROM users WHERE userid=?), ?, ?)", undef, $nlw, $definitionid, $place, $session{'userid'}, $session{'userid'}, time()); # Update natlangwordbestguesses my $jbovlastedir = $m->base_comp->attr('jbovlaste_dir'); system( "$jbovlastedir/bin/updatenlbg $jbovlastedir $nlw $place $session{'userid'} $definitionid \&");

Your vote should've been recorded.

<%perl> if( ! defined( $stfu ) ) {

You may go back to where you were.

<%perl> }