-
- $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);