clean up votes when images are deleted

git-svn-id: file:///home/shish/svn/shimmie2/trunk@547 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish
2007-10-21 23:12:49 +00:00
parent c11d39f5b7
commit 2c43a4f420
2 changed files with 11 additions and 1 deletions

View File

@ -58,6 +58,11 @@ class NumericScore extends Extension {
}
}
if(is_a($event, 'ImageDeletionEvent')) {
global $database;
$database->execute("DELETE FROM numeric_score_votes WHERE image_id=?", array($event->image->id));
}
if(is_a($event, 'SetupBuildingEvent')) {
$sb = new SetupBlock("Numeric Score");
$sb->add_bool_option("numeric_score_anon", "Allow anonymous votes: ");