diff options
author | zotlabs <mike@macgirvin.com> | 2017-03-21 22:05:36 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-03-21 22:05:36 -0700 |
commit | 65ecc5ae15757b41bda8e0aed23a17d5e258cdc7 (patch) | |
tree | 18b0688d4e1185eabf31e328c7ffc3dc45dc3e0b /include | |
parent | 83a78a949d67dbbe3294f7f02ffeb45b6f96423d (diff) | |
download | volse-hubzilla-65ecc5ae15757b41bda8e0aed23a17d5e258cdc7.tar.gz volse-hubzilla-65ecc5ae15757b41bda8e0aed23a17d5e258cdc7.tar.bz2 volse-hubzilla-65ecc5ae15757b41bda8e0aed23a17d5e258cdc7.zip |
more work on the photo album mess
Diffstat (limited to 'include')
-rw-r--r-- | include/photos.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/photos.php b/include/photos.php index 69b31de9f..3ce307067 100644 --- a/include/photos.php +++ b/include/photos.php @@ -625,14 +625,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) ); @@ -640,7 +641,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; |