backend work to allow admin to delete photos. Still requires frontend work to give admin access to either the photos and/or the delete link.

This commit is contained in:
zotlabs
2018-05-02 18:23:42 -07:00
parent 406ea67bbc
commit 9713436f49
3 changed files with 53 additions and 29 deletions

View File

@@ -786,17 +786,31 @@ function photos_album_get_db_idstr($channel_id, $album, $remote_xchan = '') {
);
}
if ($r) {
$arr = array();
foreach ($r as $rr) {
$arr[] = "'" . dbesc($rr['hash']) . "'" ;
}
$str = implode(',',$arr);
return $str;
return ids_to_querystr($r,'hash',true);
}
return false;
}
function photos_album_get_db_idstr_admin($channel_id, $album) {
if(! is_site_admin())
return false;
$r = q("SELECT hash from attach where uid = %d and folder = '%s' ",
intval($channel_id),
dbesc($album)
);
if ($r) {
return ids_to_querystr($r,'hash',true);
}
return false;
}
/**
* @brief Creates a new photo item.
*