diff options
author | friendica <info@friendica.com> | 2015-01-25 13:49:10 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-01-25 13:49:10 -0800 |
commit | f78a061406fab7fce44f73c6efcc690494347b96 (patch) | |
tree | 17e31691548c6ba7e2b223dc3f9ee0311cf892c1 /include | |
parent | 4ca2ec7638664dd0514beddd982c9d7b541522eb (diff) | |
download | volse-hubzilla-f78a061406fab7fce44f73c6efcc690494347b96.tar.gz volse-hubzilla-f78a061406fab7fce44f73c6efcc690494347b96.tar.bz2 volse-hubzilla-f78a061406fab7fce44f73c6efcc690494347b96.zip |
turn "large photo thumbnails" into a feature.
Diffstat (limited to 'include')
-rw-r--r-- | include/features.php | 1 | ||||
-rw-r--r-- | include/photos.php | 17 |
2 files changed, 12 insertions, 6 deletions
diff --git a/include/features.php b/include/features.php index 1a4b2654f..6b4bc34c6 100644 --- a/include/features.php +++ b/include/features.php @@ -57,6 +57,7 @@ function get_features() { t('Post Composition Features'), // array('richtext', t('Richtext Editor'), t('Enable richtext editor'),false), array('markdown', t('Use Markdown'), t('Allow use of "Markdown" to format posts'),false), + array('large_photos', t('Large Photos'), t('Include large (640px) photo thumbnails in posts. If not enabled, use small (320px) photo thumbnails'),false), array('channel_sources', t('Channel Sources'), t('Automatically import channel content from other channels or feeds'),false), array('content_encrypt', t('Even More Encryption'), t('Allow optional encryption of content end-to-end with a shared secret key'),false), array('adult_photo_flagging', t('Flag Adult Photos'), t('Provide photo edit option to hide adult photos from default album view'),false), 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]' |