aboutsummaryrefslogtreecommitdiffstats
path: root/include/photos.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-26 02:24:07 -0800
committerfriendica <info@friendica.com>2013-01-26 02:24:07 -0800
commit91126d8dd33bdfa86ab1013561833b0c3c224a14 (patch)
tree6f8b1a86dccd7f753015270156ddf2b89614f1ea /include/photos.php
parent70aa8421b37a6ad7318172ef515bbb56e2d33917 (diff)
downloadvolse-hubzilla-91126d8dd33bdfa86ab1013561833b0c3c224a14.tar.gz
volse-hubzilla-91126d8dd33bdfa86ab1013561833b0c3c224a14.tar.bz2
volse-hubzilla-91126d8dd33bdfa86ab1013561833b0c3c224a14.zip
more photo backend stuff
Diffstat (limited to 'include/photos.php')
-rw-r--r--include/photos.php29
1 files changed, 28 insertions, 1 deletions
diff --git a/include/photos.php b/include/photos.php
index 7ccfd31c6..6609a6fa8 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -230,7 +230,7 @@ function photo_upload($channel, $observer, $args) {
function photos_albums_list($channel,$observer) {
- $channel_id = $channel['channel_id'];
+ $channel_id = $channel['channel_id'];
$observer_xchan = (($observer) ? $observer['xchan_hash'] : '');
if(! perm_is_allowed($channel_id,$observer_xchan,'view_photos'))
@@ -244,7 +244,34 @@ function photos_albums_list($channel,$observer) {
intval($channel_id)
);
+ // add various encodings to the array so we can just loop through and pick them out in a template
+
+ if($albums) {
+ foreach($albums as $k => $album) {
+ $albums[$k]['urlencode'] = urlencode($album['album']);
+ $albums[$k]['bin2hex'] = bin2hex($album['album']);
+ }
+ }
return $albums;
}
+function photos_album_widget($channelx,$observer,$albums = null) {
+
+ $o = '';
+
+ if(! $albums)
+ $albums = photos_albums_list($channelx,$observer);
+
+ if($albums) {
+ $o = replace_macros(get_markup_template('photo_albums.tpl'),array(
+ '$nick' => $channelx['channel_address'],
+ '$title' => t('Photo Albums'),
+ '$albums' => $albums,
+ '$baseurl' => z_root(),
+ '$upload' => ((perm_is_allowed($channelx['channel_id'],(($observer) ? $observer['xchan_hash'] : ''),'post_photos'))
+ ? t('Upload New Photos') : '')
+ ));
+ }
+ return $o;
+} \ No newline at end of file