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

View file

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