From 69c9f4588c57a1159ab18c5987f99ea5471579d5 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 7 Dec 2015 12:13:51 +0100 Subject: make justify gallery work with more than one albums per page (eg album widget) --- mod/photos.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mod/photos.php') diff --git a/mod/photos.php b/mod/photos.php index 33a895fdf..5a55123cc 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -779,6 +779,7 @@ function photos_content(&$a) { $o .= replace_macros($tpl, array( '$photos' => $photos, '$album' => $album, + '$album_id' => rand(), '$album_edit' => array(t('Edit Album'), $album_edit), '$can_post' => $can_post, '$upload' => array(t('Upload'), $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/upload/' . bin2hex($album)), @@ -1313,6 +1314,7 @@ function photos_content(&$a) { $tpl = get_markup_template('photos_recent.tpl'); $o .= replace_macros($tpl, array( '$title' => t('Recent Photos'), + '$album_id' => rand(), '$can_post' => $can_post, '$upload' => array(t('Upload'), $a->get_baseurl().'/photos/'.$a->data['channel']['channel_address'].'/upload'), '$photos' => $photos, -- cgit v1.2.3 From 0df4f9c114529478468fa1dbe9ab6032eded4db2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 7 Dec 2015 13:27:35 +0100 Subject: change album_id logic to make it work with ajax calls --- mod/photos.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mod/photos.php') diff --git a/mod/photos.php b/mod/photos.php index 5a55123cc..5b3367d40 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -765,6 +765,7 @@ function photos_content(&$a) { if($photos) { $o = replace_macros(get_markup_template('photosajax.tpl'),array( '$photos' => $photos, + '$album_id' => bin2hex($album) )); } else { @@ -779,7 +780,7 @@ function photos_content(&$a) { $o .= replace_macros($tpl, array( '$photos' => $photos, '$album' => $album, - '$album_id' => rand(), + '$album_id' => bin2hex($album), '$album_edit' => array(t('Edit Album'), $album_edit), '$can_post' => $can_post, '$upload' => array(t('Upload'), $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/upload/' . bin2hex($album)), @@ -1301,6 +1302,7 @@ function photos_content(&$a) { if($photos) { $o = replace_macros(get_markup_template('photosajax.tpl'),array( '$photos' => $photos, + '$album_id' => bin2hex(t('Recent Photos')) )); } else { @@ -1314,7 +1316,7 @@ function photos_content(&$a) { $tpl = get_markup_template('photos_recent.tpl'); $o .= replace_macros($tpl, array( '$title' => t('Recent Photos'), - '$album_id' => rand(), + '$album_id' => bin2hex(t('Recent Photos')), '$can_post' => $can_post, '$upload' => array(t('Upload'), $a->get_baseurl().'/photos/'.$a->data['channel']['channel_address'].'/upload'), '$photos' => $photos, -- cgit v1.2.3 From 29ac533cc908a57115d52a8659bce348b36ae6fa Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 8 Dec 2015 16:32:06 -0800 Subject: remove some unused stuff --- mod/photos.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'mod/photos.php') diff --git a/mod/photos.php b/mod/photos.php index 5b3367d40..b0d9bc631 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -698,12 +698,7 @@ function photos_content(&$a) { $album_edit = null; if(($album !== t('Profile Photos')) && ($album !== 'Profile Photos') && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) { if($can_post) { - if($a->get_template_engine() === 'internal') { - $album_e = template_escape($album); - } - else { - $album_e = $album; - } + $album_e = $album; $albums = ((array_key_exists('albums', $a->data)) ? $a->data['albums'] : photos_albums_list($a->data['channel'],$a->data['observer'])); // @fixme - syncronise actions with DAV -- cgit v1.2.3