Allow multiple instances of the same widget

This commit is contained in:
Daniel Preussker
2015-09-05 15:53:43 +01:00
parent 31bf0b4dbf
commit 41cff31941

View File

@@ -20,13 +20,6 @@ elseif ($sub_type == 'remove-all') {
} }
} }
elseif ($sub_type == 'add' && is_numeric($widget_id)) { elseif ($sub_type == 'add' && is_numeric($widget_id)) {
$dupe_check = dbFetchCEll('SELECT `user_widget_id` FROM `users_widgets` WHERE `user_id`=? AND `widget_id`=?',array($_SESSION['user_id'],$widget_id));
if (is_numeric($dupe_check)) {
$message = 'This widget has already been added';
}
else {
$widget = dbFetchRow('SELECT * FROM `widgets` WHERE `widget_id`=?', array($widget_id)); $widget = dbFetchRow('SELECT * FROM `widgets` WHERE `widget_id`=?', array($widget_id));
if (is_array($widget)) { if (is_array($widget)) {
list($x,$y) = explode(',',$widget['base_dimensions']); list($x,$y) = explode(',',$widget['base_dimensions']);
@@ -37,7 +30,6 @@ elseif ($sub_type == 'add' && is_numeric($widget_id)) {
$message = ''; $message = '';
} }
} }
}
} }
else { else {
$status = 'ok'; $status = 'ok';