From 9528beac34389f8d8f20de1816bca8d516a556cc Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 24 Jun 2012 16:51:39 -0700 Subject: sidebar photo album list not visible to anybody if user['hidewall'] set --- 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 d96bc135e..31046565d 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -38,8 +38,10 @@ function photos_init(&$a) { $o .= '
' . $a->data['user']['username'] . '
'; $o .= '
' . $a->data['user']['username'] . '
'; $o .= ''; - - if(! intval($a->data['user']['hidewall'])) { + + $albums_visible = ((intval($a->data['user']['hidewall']) && (! local_user()) && (! remote_user())) ? false : true); + + if($albums_visible) { $o .= ''; - + $r = q("select sum(octet_length(data)) as total from photo where uid = %d and scale = 0 and album != 'Contact Photos' ", + intval($a->data['user']['uid']) + ); + + + $limit = service_class_fetch($a->data['user']['uid'],'photo_upload_limit'); + if($limit !== false) { + $usage_message = sprintf( t("You have used %1$.2f Mbytes of %2$.2f Mbytes photo storage."), $r[0]['total'] / 1024000, $limit / 1024000 ); + } + else { + $usage_message = sprintf( t('You have used %1$.2f Mbytes of photo storage.'), $r[0]['total'] / 1024000 ); + } + $tpl = get_markup_template('photos_upload.tpl'); $o .= replace_macros($tpl,array( '$pagename' => t('Upload Photos'), '$sessid' => session_id(), + '$usage' => $usage_message, '$nickname' => $a->data['user']['nickname'], '$newalbum' => t('New album name: '), '$existalbumtext' => t('or existing album name: '), -- cgit v1.2.3 From 3fe5bdbd8de265ffe558fb3c91eac64ccdd2d158 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Thu, 28 Jun 2012 10:33:21 -0600 Subject: add ability to set maximum pixel length of uploaded pictures --- mod/photos.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mod/photos.php') diff --git a/mod/photos.php b/mod/photos.php index ea4d7f81f..624f0bdca 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -743,6 +743,12 @@ function photos_post(&$a) { $ph->orient($src); @unlink($src); + $max_length = get_config('system','max_image_length'); + if(! $max_length) + $max_length = MAX_IMAGE_LENGTH; + if($max_length > 0) + $ph->scaleImage($max_length); + $width = $ph->getWidth(); $height = $ph->getHeight(); -- cgit v1.2.3