aboutsummaryrefslogtreecommitdiffstats
path: root/include/photos.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-03-21 22:05:36 -0700
committerMario Vavti <mario@mariovavti.com>2017-03-29 14:11:56 +0200
commit9d0e2cbd89d69609b9173511eed53b6033008911 (patch)
tree0a6b8539e9460dde3e0f918ba8c308105161697a /include/photos.php
parent032b6f193df3e9de1e0af1a742f047b4b3e29023 (diff)
downloadvolse-hubzilla-9d0e2cbd89d69609b9173511eed53b6033008911.tar.gz
volse-hubzilla-9d0e2cbd89d69609b9173511eed53b6033008911.tar.bz2
volse-hubzilla-9d0e2cbd89d69609b9173511eed53b6033008911.zip
more work on the photo album mess
Diffstat (limited to 'include/photos.php')
-rw-r--r--include/photos.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/photos.php b/include/photos.php
index 49c2d66f5..e73428478 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -623,14 +623,15 @@ function photos_album_rename($channel_id, $oldname, $newname) {
*/
function photos_album_get_db_idstr($channel_id, $album, $remote_xchan = '') {
- if ($remote_xchan) {
- $r = q("SELECT distinct resource_id from photo where xchan = '%s' and uid = %d and album = '%s' ",
+ if($remote_xchan) {
+ $r = q("SELECT hash from attach where creator = '%s' and uid = %d and folder = '%s' ",
dbesc($remote_xchan),
intval($channel_id),
dbesc($album)
);
- } else {
- $r = q("SELECT distinct resource_id from photo where uid = %d and album = '%s' ",
+ }
+ else {
+ $r = q("SELECT hash from attach where uid = %d and folder = '%s' ",
intval($channel_id),
dbesc($album)
);
@@ -638,7 +639,7 @@ function photos_album_get_db_idstr($channel_id, $album, $remote_xchan = '') {
if ($r) {
$arr = array();
foreach ($r as $rr) {
- $arr[] = "'" . dbesc($rr['resource_id']) . "'" ;
+ $arr[] = "'" . dbesc($rr['hash']) . "'" ;
}
$str = implode(',',$arr);
return $str;