@@ -117,7 +112,7 @@ class Photos extends \Zotlabs\Web\Controller {
$folder_hash='';
$r=q("select * from attach where is_dir = 1 and uid = %d and filename = '%s'",
$r=q("select * from attach where is_dir = 1 and uid = %d and hash = '%s'",
intval($page_owner_uid),
dbesc($album)
);
...
...
@@ -125,14 +120,7 @@ class Photos extends \Zotlabs\Web\Controller {
notice(t('Album not found.').EOL);
return;
}
if(count($r)>1){
notice(t('Multiple storage folders exist with this album name, but within different directories. Please remove the desired folder or folders using the Files manager').EOL);
return;
}
else{
$folder_hash=$r[0]['hash'];
}
$folder_hash=$r[0]['hash'];
$res=array();
...
...
@@ -464,7 +452,7 @@ class Photos extends \Zotlabs\Web\Controller {
* default post action - upload a photo
*/
$channel=\App::$data['channel'];
$channel=\App::$data['channel'];
$observer=\App::$data['observer'];
$_REQUEST['source']='photos';
...
...
@@ -481,12 +469,10 @@ class Photos extends \Zotlabs\Web\Controller {
$x=q("select folder from attach where hash = '%s' and uid = %d $sql_attach limit 1",
dbesc($datum),
intval($owner_uid)
);
// fetch image, item containing image, then comments
$ph=q("SELECT id,aid,uid,xchan,resource_id,created,edited,title,description,album,filename,mimetype,height,width,filesize,imgscale,photo_usage,is_nsfw,allow_cid,allow_gid,deny_cid,deny_gid FROM photo WHERE uid = %d AND resource_id = '%s'
...
...
@@ -827,7 +815,7 @@ class Photos extends \Zotlabs\Web\Controller {
dbesc($datum)
);
if(!$ph){
if(!($ph&&$x)){
/* Check again - this time without specifying permissions */
...
...
@@ -852,16 +840,17 @@ class Photos extends \Zotlabs\Web\Controller {
else
$order='DESC';
$prvnxt=q("SELECT resource_id FROM photo WHERE album = '%s' AND uid = %d AND imgscale = 0
$sql_extra ORDER BY created $order ",
dbesc($ph[0]['album']),
$prvnxt=q("SELECT hash FROM attach WHERE folder = '%s' AND uid = %d AND is_photo = 1