aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-05-02 18:23:42 -0700
committerzotlabs <mike@macgirvin.com>2018-05-02 18:23:42 -0700
commit9713436f497a031e4369130dda40b415ff285fd8 (patch)
treeb0054c391d3477d935f14e51e1ec98dbefc3cfcb /include
parent406ea67bbc9b67ca4bd80d80eb012bc68afc5262 (diff)
downloadvolse-hubzilla-9713436f497a031e4369130dda40b415ff285fd8.tar.gz
volse-hubzilla-9713436f497a031e4369130dda40b415ff285fd8.tar.bz2
volse-hubzilla-9713436f497a031e4369130dda40b415ff285fd8.zip
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.
Diffstat (limited to 'include')
-rw-r--r--include/photos.php26
1 files changed, 20 insertions, 6 deletions
diff --git a/include/photos.php b/include/photos.php
index 9ae0e6874..495043bbf 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -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.
*