From: rabuzarus <> Date: Wed, 27 May 2015 01:35:29 +0000 (+0200) Subject: first step to get html code from photos.php removed X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=15499ff1aa7154aecddb4b801c4c0b96f6a2df76;p=friendica.git first step to get html code from photos.php removed --- diff --git a/mod/photos.php b/mod/photos.php index f8bba01b00..3ae5bbf392 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -41,8 +41,57 @@ function photos_init(&$a) { $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)) { + + $ret = array('success' => false); + $albums_visible = ((intval($a->data['user']['hidewall']) && (! local_user()) && (! remote_user())) ? false : true); + + foreach($albums as $k => $album) { + if( $album['album'] === 'Contact Photos') { + unset ($albums[$k]['album']); + } + } + + if($albums) { + if ($albums_visible) { + $ret['success'] = true; + } + $ret['albums'] = array(); + foreach($albums as $k => $album) { + $entry = array( + 'text' => $album['album'], + 'total' => $album['total'], + 'url' => z_root() . '/photos/' . $channel['channel_address'] . '/album/' . bin2hex($album['album']), + 'urlencode' => urlencode($album['album']), + 'bin2hex' => bin2hex($album['album']) + ); + $ret['albums'][] = $entry; + } + } + + /*return $ret;*/ + + $o = ''; + + if(! $albums) { + if(array_key_exists('albums', get_app()->data)) + $albums = get_app()->data['albums']; + else + $albums = $ret; + } + + $albums = $ret; + + + if($albums['success']) { + $o = replace_macros(get_markup_template('photo_albums.tpl'),array( + '$nick' => $a->data['user']['nickname'], + '$title' => t('Photo Albums'), + '$albums' => $albums['albums'], + '$baseurl' => z_root() + )); + } + +/* if(count($albums)) { $a->data['albums'] = $albums; $albums_visible = ((intval($a->data['user']['hidewall']) && (! local_user()) && (! remote_user())) ? false : true); @@ -69,6 +118,8 @@ function photos_init(&$a) { $o .= ''; } + * + */ if(! x($a->page,'aside')) $a->page['aside'] = ''; diff --git a/view/templates/photo_albums.tpl b/view/templates/photo_albums.tpl new file mode 100644 index 0000000000..bbbf5c4a97 --- /dev/null +++ b/view/templates/photo_albums.tpl @@ -0,0 +1,13 @@ +