X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fphotos.php;h=324ce898d26003fdf188ebd919114cc43e6590a6;hb=cde17704ddbbe2b4926824aa2aa7aec7a9ac2dd6;hp=2e0ccd248fd2865625debbe5b63fa96a212ebd4b;hpb=3a6dfb9862c4d91f7a2f259bca447a469e19e8b5;p=friendica.git diff --git a/mod/photos.php b/mod/photos.php index 2e0ccd248f..324ce898d2 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -6,6 +6,10 @@ require_once('include/bbcode.php'); function photos_init(&$a) { + + if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { + return; + } $o = ''; if($a->argc > 1) { @@ -657,6 +661,16 @@ function photos_content(&$a) { // photos/name/image/xxxxx/edit + if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { + notice( t('Public access denied.') . EOL); + return; + } + + + require_once('include/bbcode.php'); + require_once('include/security.php'); + require_once('include/conversation.php'); + if(! x($a->data,'user')) { notice( t('No photos selected') . EOL ); return; @@ -893,8 +907,7 @@ function photos_content(&$a) { if($datatype === 'image') { - require_once('security.php'); - require_once('bbcode.php'); + $o = '
' . "\r\n"; // fetch image, item containing image, then comments @@ -1259,17 +1272,14 @@ function photos_content(&$a) { if(count($r)) { foreach($r as $rr) { $o .= replace_macros($tpl,array( - '$id' => $rr['id'], - '$photolink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] - . '/image/' . $rr['resource-id'], + '$id' => $rr['id'], + '$photolink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'], '$phototitle' => t('View Photo'), - '$imgsrc' => $a->get_baseurl() . '/photo/' - . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.jpg', - '$albumlink' => $a->get_baseurl() . '/photos/' - . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']), - '$albumname' => $rr['album'], - '$albumalt' => t('View Album'), - '$imgalt' => $rr['filename'] + '$imgsrc' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.jpg', + '$albumlink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']), + '$albumname' => $rr['album'], + '$albumalt' => t('View Album'), + '$imgalt' => $rr['filename'] )); }