X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fphotos.php;h=12ca99e60f25f76a0c1e5cbca30a52606c2cb2d2;hb=10e84c548cdc3d980b89442f8b69b95910d62442;hp=d96bc135e4133d62eabfd126e725a72f051993e0;hpb=54c76ca822978ebb97cd5b6dfdff0ea3f4f4fe7c;p=friendica.git diff --git a/mod/photos.php b/mod/photos.php index d96bc135e4..12ca99e60f 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -4,14 +4,18 @@ require_once('include/items.php'); require_once('include/acl_selectors.php'); require_once('include/bbcode.php'); require_once('include/security.php'); +require_once('include/redir.php'); function photos_init(&$a) { + if($a->argc > 1) + auto_redir($a, $a->argv[1]); if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { return; } + $o = ''; if($a->argc > 1) { @@ -23,23 +27,25 @@ function photos_init(&$a) { if(! count($r)) return; + $o .= '
'; + $o .= '
' . $a->data['user']['username'] . '
'; + $o .= '
' . $a->data['user']['username'] . '
'; + $o .= '
'; + $a->data['user'] = $r[0]; $sql_extra = permissions_sql($a->data['user']['uid']); - $albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d $sql_extra ", + $albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d $sql_extra order by created desc", intval($a->data['user']['uid']) ); if(count($albums)) { $a->data['albums'] = $albums; - $o .= '
'; - $o .= '
' . $a->data['user']['username'] . '
'; - $o .= '
' . $a->data['user']['username'] . '
'; - $o .= '
'; - - if(! intval($a->data['user']['hidewall'])) { + $albums_visible = ((intval($a->data['user']['hidewall']) && (! local_user()) && (! remote_user())) ? false : true); + + if($albums_visible) { $o .= '