From c49c96962fdcdb69a06d4f7e641d6ab9768b7ca4 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 23 Jan 2015 03:25:40 -0800 Subject: provide pref to set default photo resolution for posts to something other than 2. The only acceptable option is 1. (640) --- include/photos.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/photos.php') diff --git a/include/photos.php b/include/photos.php index 2393153c6..2e5e22968 100644 --- a/include/photos.php +++ b/include/photos.php @@ -256,6 +256,15 @@ function photo_upload($channel, $observer, $args) { else $tag = '[zmg]'; + $preferred = intval(get_pconfig($channel['channel_id'],'system','post_photores')); + if($preferred == 1) { + $tag = '[zmg]'; + if($r2) + $smallest = 1; + else + $smallest = 0; + } + $arr['body'] = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']' . $tag . z_root() . "/photo/{$photo_hash}-{$smallest}.".$ph->getExt() . '[/zmg]' . '[/zrl]'; -- cgit v1.2.3 From f78a061406fab7fce44f73c6efcc690494347b96 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 25 Jan 2015 13:49:10 -0800 Subject: turn "large photo thumbnails" into a feature. --- include/photos.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'include/photos.php') diff --git a/include/photos.php b/include/photos.php index 2e5e22968..ee94bac60 100644 --- a/include/photos.php +++ b/include/photos.php @@ -251,19 +251,24 @@ function photo_upload($channel, $observer, $args) { $arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $arr['mid']; - if ($width_x_height) - $tag = '[zmg=' . $width_x_height. ']'; - else - $tag = '[zmg]'; + // We should also put a width_x_height on large photos. Left as an exercise for + // devs looking fo simple stuff to fix. - $preferred = intval(get_pconfig($channel['channel_id'],'system','post_photores')); - if($preferred == 1) { + $larger = feature_enabled($channel['channel_id'],'large_photos'); + if($larger) { $tag = '[zmg]'; if($r2) $smallest = 1; else $smallest = 0; } + else { + if ($width_x_height) + $tag = '[zmg=' . $width_x_height. ']'; + else + $tag = '[zmg]'; + } + $arr['body'] = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']' . $tag . z_root() . "/photo/{$photo_hash}-{$smallest}.".$ph->getExt() . '[/zmg]' -- cgit v1.2.3