From a9711895cf254a0ca34b1e3f7c8e75bb832e6973 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 20 Feb 2016 19:39:54 +1100 Subject: move accesslist class to namespace --- include/photos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/photos.php') diff --git a/include/photos.php b/include/photos.php index 93511d2c0..1a57ce76f 100644 --- a/include/photos.php +++ b/include/photos.php @@ -48,7 +48,7 @@ function photo_upload($channel, $observer, $args) { // all other settings. 'allow_cid' being passed from an external source takes priority over channel settings. // ...messy... needs re-factoring once the photos/files integration stabilises - $acl = new AccessList($channel); + $acl = new Zotlabs\Access\AccessList($channel); if(array_key_exists('directory',$args) && $args['directory']) $acl->set($args['directory']); if(array_key_exists('allow_cid',$args)) -- cgit v1.2.3 From dfbe2eaf9856140de84f4d891fd442cdd6872545 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 20 Feb 2016 00:49:37 -0800 Subject: Revert "move accesslist class to namespace" This reverts commit a9711895cf254a0ca34b1e3f7c8e75bb832e6973. --- include/photos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/photos.php') diff --git a/include/photos.php b/include/photos.php index 1a57ce76f..93511d2c0 100644 --- a/include/photos.php +++ b/include/photos.php @@ -48,7 +48,7 @@ function photo_upload($channel, $observer, $args) { // all other settings. 'allow_cid' being passed from an external source takes priority over channel settings. // ...messy... needs re-factoring once the photos/files integration stabilises - $acl = new Zotlabs\Access\AccessList($channel); + $acl = new AccessList($channel); if(array_key_exists('directory',$args) && $args['directory']) $acl->set($args['directory']); if(array_key_exists('allow_cid',$args)) -- cgit v1.2.3 From f1564b4cff5a584d37b12000f68014df49e683d9 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 21 Feb 2016 16:49:49 -0800 Subject: retry the move of AccessList to composer format (one or more third-party plugins will likely break as a result) --- include/photos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/photos.php') diff --git a/include/photos.php b/include/photos.php index 93511d2c0..1a57ce76f 100644 --- a/include/photos.php +++ b/include/photos.php @@ -48,7 +48,7 @@ function photo_upload($channel, $observer, $args) { // all other settings. 'allow_cid' being passed from an external source takes priority over channel settings. // ...messy... needs re-factoring once the photos/files integration stabilises - $acl = new AccessList($channel); + $acl = new Zotlabs\Access\AccessList($channel); if(array_key_exists('directory',$args) && $args['directory']) $acl->set($args['directory']); if(array_key_exists('allow_cid',$args)) -- cgit v1.2.3 From 776bc51172f5c21348c674a8bb6bf5037bde6815 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 26 Feb 2016 15:21:14 +0100 Subject: fix link to photo album and make sure that small photos are not overwritten by body text. --- include/photos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/photos.php') diff --git a/include/photos.php b/include/photos.php index 1a57ce76f..be18600de 100644 --- a/include/photos.php +++ b/include/photos.php @@ -296,7 +296,7 @@ function photo_upload($channel, $observer, $args) { $photo_link = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']' . t('a new photo') . '[/zrl]'; - $album_link = '[zrl=' . z_root() . '/photos/album/' . bin2hex($album) . ']' . $album . '[/zrl]'; + $album_link = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/album/' . bin2hex($album) . ']' . $album . '[/zrl]'; $activity_format = sprintf(t('%1$s posted %2$s to %3$s','photo_upload'), $author_link, $photo_link, $album_link); -- cgit v1.2.3 From 2d45f9f385a5738d2126f66c0e5467533e6838c2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 29 Feb 2016 23:58:32 +0100 Subject: provide footer bbcode --- include/photos.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/photos.php') diff --git a/include/photos.php b/include/photos.php index be18600de..5dd5f3c62 100644 --- a/include/photos.php +++ b/include/photos.php @@ -300,7 +300,7 @@ function photo_upload($channel, $observer, $args) { $activity_format = sprintf(t('%1$s posted %2$s to %3$s','photo_upload'), $author_link, $photo_link, $album_link); - $summary = $activity_format . "\n\n" . (($args['body']) ? $args['body'] . "\n\n" : ''); + $summary = (($args['body']) ? $args['body'] : '') . '[footer]' . $activity_format . '[/footer]'; $obj_body = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']' . $tag . z_root() . "/photo/{$photo_hash}-{$scale}." . $ph->getExt() . '[/zmg]' @@ -391,8 +391,8 @@ function photo_upload($channel, $observer, $args) { $arr['deny_cid'] = $ac['deny_cid']; $arr['deny_gid'] = $ac['deny_gid']; $arr['verb'] = ACTIVITY_POST; - $arr['obj_type'] = ACTIVITY_OBJ_PHOTO; - $arr['object'] = json_encode($object); + $arr['obj_type'] = ACTIVITY_OBJ_PHOTO; + $arr['object'] = json_encode($object); $arr['tgt_type'] = ACTIVITY_OBJ_ALBUM; $arr['target'] = json_encode($target); $arr['item_wall'] = 1; @@ -400,7 +400,7 @@ function photo_upload($channel, $observer, $args) { $arr['item_thread_top'] = 1; $arr['item_private'] = intval($acl->is_private()); $arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $arr['mid']; - $arr['body'] = $summary; + $arr['body'] = $summary; // this one is tricky because the item and the photo have the same permissions, those of the photo. -- cgit v1.2.3 From 9abd95fad3784a10fc48bc40f9b8a75d7d74edda Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 31 Mar 2016 16:06:03 -0700 Subject: static App --- include/photos.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/photos.php') diff --git a/include/photos.php b/include/photos.php index 5dd5f3c62..5838c013f 100644 --- a/include/photos.php +++ b/include/photos.php @@ -490,12 +490,12 @@ function photos_album_widget($channelx,$observer,$albums = null) { $o = ''; // If we weren't passed an album list, see if the photos module - // dropped one for us to find in $a->data['albums']. + // dropped one for us to find in App::$data['albums']. // If all else fails, load it. if(! $albums) { - if(array_key_exists('albums', get_app()->data)) - $albums = get_app()->data['albums']; + if(array_key_exists('albums', App::$data)) + $albums = App::$data['albums']; else $albums = photos_albums_list($channelx,$observer); } -- cgit v1.2.3 From 29363a185dea07dbb035ccdc027a48881d8e96fd Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 6 Apr 2016 18:07:29 -0700 Subject: file sync work --- include/photos.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/photos.php') diff --git a/include/photos.php b/include/photos.php index 5838c013f..312ea18d3 100644 --- a/include/photos.php +++ b/include/photos.php @@ -312,7 +312,7 @@ function photo_upload($channel, $observer, $args) { 'title' => $title, 'created' => $p['created'], 'edited' => $p['edited'], - 'id' => rawurlencode(z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash), + 'id' => z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash, 'link' => $link, 'body' => $obj_body ); @@ -320,7 +320,7 @@ function photo_upload($channel, $observer, $args) { $target = array( 'type' => ACTIVITY_OBJ_ALBUM, 'title' => (($album) ? $album : '/'), - 'id' => rawurlencode(z_root() . '/photos/' . $channel['channel_address'] . '/album/' . bin2hex($album)) + 'id' => z_root() . '/photos/' . $channel['channel_address'] . '/album/' . bin2hex($album) ); // Create item container -- cgit v1.2.3 From 861f5232d3b6c5bd2cf8bd895f57424b730ce270 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 6 Apr 2016 19:56:38 -0700 Subject: more work on file sync to clones, 60-70% test coverage, mostly working but many changes made during testing which themselves have not yet been tested --- include/photos.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/photos.php') diff --git a/include/photos.php b/include/photos.php index 312ea18d3..943d7d503 100644 --- a/include/photos.php +++ b/include/photos.php @@ -194,7 +194,7 @@ function photo_upload($channel, $observer, $args) { $link[0] = array( 'rel' => 'alternate', 'type' => 'text/html', - 'href' => $url = rawurlencode(z_root() . '/photo/' . $photo_hash . '-0.' . $ph->getExt()), + 'href' => z_root() . '/photo/' . $photo_hash . '-0.' . $ph->getExt(), 'width' => $ph->getWidth(), 'height' => $ph->getHeight() ); @@ -212,7 +212,7 @@ function photo_upload($channel, $observer, $args) { $link[1] = array( 'rel' => 'alternate', 'type' => 'text/html', - 'href' => $url = rawurlencode(z_root() . '/photo/' . $photo_hash . '-1.' . $ph->getExt()), + 'href' => z_root() . '/photo/' . $photo_hash . '-1.' . $ph->getExt(), 'width' => $ph->getWidth(), 'height' => $ph->getHeight() ); @@ -227,7 +227,7 @@ function photo_upload($channel, $observer, $args) { $link[2] = array( 'rel' => 'alternate', 'type' => 'text/html', - 'href' => $url = rawurlencode(z_root() . '/photo/' . $photo_hash . '-2.' . $ph->getExt()), + 'href' => z_root() . '/photo/' . $photo_hash . '-2.' . $ph->getExt(), 'width' => $ph->getWidth(), 'height' => $ph->getHeight() ); @@ -242,7 +242,7 @@ function photo_upload($channel, $observer, $args) { $link[3] = array( 'rel' => 'alternate', 'type' => 'text/html', - 'href' => $url = rawurlencode(z_root() . '/photo/' . $photo_hash . '-3.' . $ph->getExt()), + 'href' => z_root() . '/photo/' . $photo_hash . '-3.' . $ph->getExt(), 'width' => $ph->getWidth(), 'height' => $ph->getHeight() ); -- cgit v1.2.3