if user has no votes, don't delete all their votes
This commit is contained in:
parent
14770e4733
commit
03795e7d1c
@ -192,6 +192,8 @@ class NumericScore extends Extension {
|
|||||||
|
|
||||||
$image_ids = $database->get_col("SELECT image_id FROM numeric_score_votes WHERE user_id=?", array($user_id));
|
$image_ids = $database->get_col("SELECT image_id FROM numeric_score_votes WHERE user_id=?", array($user_id));
|
||||||
|
|
||||||
|
if(count($image_ids) == 0) return;
|
||||||
|
|
||||||
$database->execute(
|
$database->execute(
|
||||||
"DELETE FROM numeric_score_votes WHERE user_id=? AND image_id IN (".implode(",", $image_ids).")",
|
"DELETE FROM numeric_score_votes WHERE user_id=? AND image_id IN (".implode(",", $image_ids).")",
|
||||||
array($user_id));
|
array($user_id));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user