Some more changed calls

This commit is contained in:
Michael 2017-11-22 09:11:44 +00:00
parent 7c3fd2adb5
commit c6c180e8b9
2 changed files with 13 additions and 25 deletions

View file

@ -3435,11 +3435,7 @@ function api_fr_photoalbum_delete($type)
}
// now let's delete all photos from the album
$result = q(
"DELETE FROM `photo` WHERE `uid` = %d AND `album` = '%s'",
intval(api_user()),
dbesc($album)
);
$result = dba::delete('photo', array('uid' => api_user(), 'album' => $album));
// return success of deletion or error message
if ($result) {
@ -3722,11 +3718,7 @@ function api_fr_photo_delete($type)
throw new BadRequestException("photo not available");
}
// now we can perform on the deletion of the photo
$result = q(
"DELETE FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'",
intval(api_user()),
dbesc($photo_id)
);
$result = dba::delete('photo', array('uid' => api_user(), 'resource-id' => $photo_id));
// return success of deletion or error message
if ($result) {

View file

@ -79,10 +79,7 @@ function group_rmv($uid,$name) {
}
// remove all members
$r = q("DELETE FROM `group_member` WHERE `uid` = %d AND `gid` = %d ",
intval($uid),
intval($group_id)
);
dba::delete('group_member', array('uid' => $uid, 'pid' => $group_id));
// remove group
$r = q("UPDATE `group` SET `deleted` = 1 WHERE `uid` = %d AND `name` = '%s'",
@ -111,18 +108,17 @@ function group_byname($uid,$name) {
function group_rmv_member($uid, $name, $member) {
$gid = group_byname($uid, $name);
if (! $gid)
if (!$gid) {
return false;
if (! ( $uid && $gid && $member))
}
if (!($uid && $gid && $member)) {
return false;
$r = q("DELETE FROM `group_member` WHERE `uid` = %d AND `gid` = %d AND `contact-id` = %d",
intval($uid),
intval($gid),
intval($member)
);
}
$r = dba::delete('group_member', array('uid' => $uid, 'gid' => $gid, 'contact-id' => $member));
return $r;
}