From bb96f44861c66e9eb334e18e4b4b659685433008 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 28 Apr 2016 21:02:27 -0700 Subject: allow engineering units (e.g. 400M, 1G) as service class limits --- Zotlabs/Module/Item.php | 4 ++-- Zotlabs/Module/Photos.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 74fbeed67..93570fdec 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -1243,14 +1243,14 @@ class Item extends \Zotlabs\Web\Controller { } if (!$iswebpage) { - $max = service_class_fetch($channel_id,'total_items'); + $max = engr_units_to_bytes(service_class_fetch($channel_id,'total_items')); if(! service_class_allows($channel_id,'total_items',$r[0]['total'])) { $result['message'] .= upgrade_message() . sprintf( t('You have reached your limit of %1$.0f top level posts.'),$max); return $result; } } else { - $max = service_class_fetch($channel_id,'total_pages'); + $max = engr_units_to_bytes(service_class_fetch($channel_id,'total_pages')); if(! service_class_allows($channel_id,'total_pages',$r[0]['total'])) { $result['message'] .= upgrade_message() . sprintf( t('You have reached your limit of %1$.0f webpages.'),$max); return $result; diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index ce350666f..15a1f4d9c 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -615,7 +615,7 @@ class Photos extends \Zotlabs\Web\Controller { ); - $limit = service_class_fetch(\App::$data['channel']['channel_id'],'photo_upload_limit'); + $limit = engr_units_to_bytes(service_class_fetch(\App::$data['channel']['channel_id'],'photo_upload_limit')); if($limit !== false) { $usage_message = sprintf( t("%1$.2f MB of %2$.2f MB photo storage used."), $r[0]['total'] / 1024000, $limit / 1024000 ); } -- cgit v1.2.3