X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fphotos.php;h=cb13b760364e72df276db5c3db5dc8eeeef0e074;hb=ac6945eed1644e7a9e58c5f74dae696ff0f09d72;hp=2c896e32f533276ff48638136d8f304afaa6babe;hpb=53653f6a4d6b4c9d348d7e9d8eb1648469b031af;p=friendica.git diff --git a/mod/photos.php b/mod/photos.php index 2c896e32f5..cb13b76036 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -25,7 +25,7 @@ function photos_init(&$a) { $a->data['user'] = $r[0]; $sql_extra = permissions_sql($a->data['user']['uid']); -echo "SQL=$sql_extra"; + $albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d $sql_extra ", intval($a->data['user']['uid']) ); @@ -816,11 +816,7 @@ function photos_content(&$a) { } } - $r = q("SELECT `hidewall` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1", - intval($owner_uid) - ); - - if(count($r) && $r[0]['hidewall'] && (local_user() != $owner_uid) && (! $remote_contact)) { + if($a->data['user']['hidewall'] && (local_user() != $owner_uid) && (! $remote_contact)) { notice( t('Access to this item is restricted.') . EOL); return; } @@ -907,7 +903,7 @@ function photos_content(&$a) { $album = hex2bin($datum); $r = q("SELECT `resource-id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s' - $sql_extra GROUP BY `resource-id`", + AND `scale` <= 4 $sql_extra GROUP BY `resource-id`", intval($owner_uid), dbesc($album) ); @@ -917,7 +913,7 @@ function photos_content(&$a) { } $r = q("SELECT `resource-id`, `id`, `filename`, max(`scale`) AS `scale`, `desc` FROM `photo` WHERE `uid` = %d AND `album` = '%s' - $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d", + AND `scale` <= 4 $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d", intval($owner_uid), dbesc($album), intval($a->pager['start']), @@ -1110,6 +1106,7 @@ function photos_content(&$a) { } $tags=Null; + if(count($linked_items) && strlen($link_item['tag'])) { $arr = explode(',',$link_item['tag']); // parse tags and add links