aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/account.php3
-rw-r--r--include/conversation.php66
-rw-r--r--include/photos.php2
-rw-r--r--include/text.php2
4 files changed, 30 insertions, 43 deletions
diff --git a/include/account.php b/include/account.php
index c64197b49..5998609d4 100644
--- a/include/account.php
+++ b/include/account.php
@@ -591,6 +591,7 @@ function service_class_allows($uid, $property, $usage = false) {
if($limit === false)
return true; // No service class set => everything is allowed
+ $limit = engr_units_to_bytes($limit);
if($usage === false) {
// We use negative values for not allowed properties in a subscriber plan
return ((x($limit)) ? (bool) $limit : true);
@@ -627,6 +628,8 @@ function account_service_class_allows($aid, $property, $usage = false) {
if($limit === false)
return true; // No service class is set => everything is allowed
+ $limit = engr_units_to_bytes($limit);
+
if($usage === false) {
// We use negative values for not allowed properties in a subscriber plan
return ((x($limit)) ? (bool) $limit : true);
diff --git a/include/conversation.php b/include/conversation.php
index 7d80b08fc..b1b47df39 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1115,16 +1115,28 @@ function status_editor($a, $x, $popup = false) {
if($c && $c['channel_moved'])
return $o;
- $geotag = (($x['allow_location']) ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : '');
-
$plaintext = true;
// if(feature_enabled(local_channel(),'richtext'))
// $plaintext = false;
- $voting = feature_enabled(local_channel(), 'consensus_tools');
- if(x($x, 'novoting'))
- $voting = false;
+ $feature_voting = feature_enabled($x['profile_uid'], 'consensus_tools');
+ if(x($x, 'hide_voting'))
+ $feature_voting = false;
+
+ $feature_expire = ((feature_enabled($x['profile_uid'], 'content_expire') && (! $webpage)) ? true : false);
+ if(x($x, 'hide_expire'))
+ $feature_expire = false;
+
+ $feature_future = ((feature_enabled($x['profile_uid'], 'delayed_posting') && (! $webpage)) ? true : false);
+ if(x($x, 'hide_future'))
+ $feature_future = false;
+
+ $geotag = (($x['allow_location']) ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : '');
+ $setloc = t('Set your location');
+ $clearloc = ((get_pconfig($x['profile_uid'], 'system', 'use_browser_location')) ? t('Clear browser location') : '');
+ if(x($x, 'hide_location'))
+ $geotag = $setloc = $clearloc = '';
$mimeselect = '';
if(array_key_exists('mimetype', $x) && $x['mimetype']) {
@@ -1146,7 +1158,6 @@ function status_editor($a, $x, $popup = false) {
$layoutselect = '<input type="hidden" name="layout_mid" value="' . $x['layout'] . '" />';
}
-
if(array_key_exists('channel_select',$x) && $x['channel_select']) {
require_once('include/identity.php');
$id_select = identity_selector();
@@ -1154,26 +1165,19 @@ function status_editor($a, $x, $popup = false) {
else
$id_select = '';
-
$webpage = ((x($x,'webpage')) ? $x['webpage'] : '');
$tpl = get_markup_template('jot-header.tpl');
App::$page['htmlhead'] .= replace_macros($tpl, array(
- '$newpost' => 'true',
'$baseurl' => z_root(),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$pretext' => ((x($x,'pretext')) ? $x['pretext'] : ''),
'$geotag' => $geotag,
'$nickname' => $x['nickname'],
- '$ispublic' => t('Visible to <strong>everybody</strong>'),
'$linkurl' => t('Please enter a link URL:'),
- '$vidurl' => t('Please enter a video link/URL:'),
- '$audurl' => t('Please enter an audio link/URL:'),
'$term' => t('Tag term:'),
- '$fileas' => t('Save to Folder:'),
'$whereareu' => t('Where are you right now?'),
- '$expireswhen' => t('Expires YYYY-MM-DD HH:MM'),
'$editor_autocomplete'=> ((x($x,'editor_autocomplete')) ? $x['editor_autocomplete'] : ''),
'$bbco_autocomplete'=> ((x($x,'bbco_autocomplete')) ? $x['bbco_autocomplete'] : ''),
));
@@ -1181,10 +1185,8 @@ function status_editor($a, $x, $popup = false) {
$tpl = get_markup_template('jot.tpl');
$jotplugins = '';
- $jotnets = '';
$preview = t('Preview');
-// $preview = ((feature_enabled($x['profile_uid'],'preview')) ? t('Preview') : '');
if(x($x, 'nopreview'))
$preview = '';
@@ -1201,7 +1203,6 @@ function status_editor($a, $x, $popup = false) {
$cipher = 'aes256';
call_hooks('jot_tool', $jotplugins);
- call_hooks('jot_networks', $jotnets);
$o .= replace_macros($tpl, array(
'$return_path' => ((x($x, 'return_path')) ? $x['return_path'] : App::$query_string),
@@ -1218,42 +1219,25 @@ function status_editor($a, $x, $popup = false) {
'$underline' => t('Underline'),
'$quote' => t('Quote'),
'$code' => t('Code'),
- '$upload' => t('Upload photo'),
- '$shortupload' => t('upload photo'),
'$attach' => t('Attach file'),
- '$shortattach' => t('attach file'),
'$weblink' => t('Insert web link'),
- '$shortweblink' => t('web link'),
- '$video' => t('Insert video link'),
- '$shortvideo' => t('video link'),
- '$audio' => t('Insert audio link'),
- '$shortaudio' => t('audio link'),
- '$setloc' => t('Set your location'),
- '$shortsetloc' => t('set location'),
+ '$setloc' => $setloc,
'$voting' => t('Toggle voting'),
- '$feature_voting' => $voting,
+ '$feature_voting' => $feature_voting,
'$consensus' => 0,
- '$noloc' => ((get_pconfig($x['profile_uid'], 'system', 'use_browser_location')) ? t('Clear browser location') : ''),
- '$shortnoloc' => t('clear location'),
+ '$clearloc' => $clearloc,
'$title' => ((x($x, 'title')) ? htmlspecialchars($x['title'], ENT_COMPAT,'UTF-8') : ''),
'$placeholdertitle' => ((x($x, 'placeholdertitle')) ? $x['placeholdertitle'] : t('Title (optional)')),
- '$hidetitle' => ((x($x, 'hidetitle')) ? $x['hidetitle'] : false),
'$catsenabled' => ((feature_enabled($x['profile_uid'], 'categories') && (! $webpage)) ? 'categories' : ''),
- '$category' => "",
+ '$category' => ((x($x, 'category')) ? $x['category'] : ''),
'$placeholdercategory' => t('Categories (optional, comma-separated list)'),
- '$wait' => t('Please wait'),
'$permset' => t('Permission settings'),
- '$shortpermset' => t('permissions'),
- '$ptyp' => '',
+ '$ptyp' => ((x($x, 'ptyp')) ? $x['ptyp'] : ''),
'$content' => ((x($x,'body')) ? htmlspecialchars($x['body'], ENT_COMPAT,'UTF-8') : ''),
'$attachment' => ((x($x, 'attachment')) ? $x['attachment'] : ''),
- '$post_id' => '',
- '$baseurl' => z_root(),
+ '$post_id' => ((x($x, 'post_id')) ? $x['post_id'] : ''),
'$defloc' => $x['default_location'],
'$visitor' => $x['visitor'],
- '$public' => t('Public post'),
- '$jotnets' => $jotnets,
- '$emtitle' => t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $x['lockstate'],
'$acl' => $x['acl'],
'$mimeselect' => $mimeselect,
@@ -1265,10 +1249,10 @@ function status_editor($a, $x, $popup = false) {
'$source' => ((x($x, 'source')) ? $x['source'] : ''),
'$jotplugins' => $jotplugins,
'$defexpire' => $defexpire,
- '$feature_expire' => ((feature_enabled($x['profile_uid'], 'content_expire') && (! $webpage)) ? true : false),
+ '$feature_expire' => $feature_expire,
'$expires' => t('Set expiration date'),
'$defpublish' => $defpublish,
- '$feature_future' => ((feature_enabled($x['profile_uid'], 'delayed_posting') && (! $webpage)) ? true : false),
+ '$feature_future' => $feature_future,
'$future_txt' => t('Set publish date'),
'$feature_encrypt' => ((feature_enabled($x['profile_uid'], 'content_encrypt') && (! $webpage)) ? true : false),
'$encrypt' => t('Encrypt text'),
diff --git a/include/photos.php b/include/photos.php
index d088d455a..73a29d8eb 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -131,7 +131,7 @@ function photo_upload($channel, $observer, $args) {
intval($account_id)
);
- $limit = service_class_fetch($channel_id,'photo_upload_limit');
+ $limit = engr_units_to_bytes(service_class_fetch($channel_id,'photo_upload_limit'));
if (($r) && ($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) {
$ret['message'] = upgrade_message();
diff --git a/include/text.php b/include/text.php
index 926e2eed6..f1043909d 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1825,7 +1825,7 @@ function lang_selector() {
}
-function return_bytes ($size_str) {
+function engr_units_to_bytes ($size_str) {
switch (substr ($size_str, -1)) {
case 'M': case 'm': return (int)$size_str * 1048576;
case 'K': case 'k': return (int)$size_str * 1024;