X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fphotos.php;h=605f6153aedad1935e2a789aa9c19a7b21120e57;hb=778ed772d2c4d1a1b1222f2f9bbe98ad9fa67eff;hp=a6552994e5258c9aa1ef788ae98b8251e9fb3026;hpb=edc68f487607a5a7c8602a7e51ee5559acb82114;p=friendica.git diff --git a/mod/photos.php b/mod/photos.php index a6552994e5..605f6153ae 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -4,19 +4,24 @@ 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'); +require_once('include/tags.php'); +require_once('include/threads.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) { $nick = $a->argv[1]; - $r = q("SELECT `user`.*, `contact`.`avatar-date` AS picdate FROM `user` LEFT JOIN `contact` on `contact`.`uid` = `user`.`uid` WHERE `user`.`nickname` = '%s' AND `user`.`blocked` = 0 LIMIT 1", + $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `blocked` = 0 LIMIT 1", dbesc($nick) ); @@ -25,24 +30,27 @@ function photos_init(&$a) { $a->data['user'] = $r[0]; + $o .= '
'; + $o .= '
' . $a->data['user']['username'] . '
'; + $o .= '
' . $a->data['user']['username'] . '
'; + $o .= '
'; + + $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 .= '