diff options
author | friendica <info@friendica.com> | 2012-12-31 23:00:37 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-12-31 23:00:37 -0800 |
commit | 3e5e8b420f17dbebb2f86c90e9ecbf68a8b69507 (patch) | |
tree | 0ad6b663df86e37e1f42ae49e458b95a4ae1d409 /mod | |
parent | f2a4ea7254ba36329f84d0ffb07d3012a8526376 (diff) | |
download | volse-hubzilla-3e5e8b420f17dbebb2f86c90e9ecbf68a8b69507.tar.gz volse-hubzilla-3e5e8b420f17dbebb2f86c90e9ecbf68a8b69507.tar.bz2 volse-hubzilla-3e5e8b420f17dbebb2f86c90e9ecbf68a8b69507.zip |
accept expire params if expire feature is enabled
Diffstat (limited to 'mod')
-rw-r--r-- | mod/item.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mod/item.php b/mod/item.php index 811537be2..b91563f45 100644 --- a/mod/item.php +++ b/mod/item.php @@ -278,6 +278,18 @@ function item_post(&$a) { } } + $expires = '0000-00-00 00:00:00'; + + if(feature_enabled($profile_uid,'expire')) { + // expire_quantity, e.g. '3' + // expire_units, e.g. days, weeks, months + if(x($_REQUEST,'expire_quantity') && (x($_REQUEST,'expire_units'))) { + $expire = datetime_convert(date_default_timezone_get(),'UTC', 'now + ' . $_REQUEST['expire_quantity'] . ' ' . $_REQUEST['expire_units']); + if($expires <= datetime_convert()) + $expires = '0000-00-00 00:00:00'; + } + } + // Work around doubled linefeeds in Tinymce 3.5b2 // First figure out if it's a status post that would've been @@ -510,6 +522,7 @@ function item_post(&$a) { $datarray['author_xchan'] = $observer['xchan_hash']; $datarray['created'] = datetime_convert(); $datarray['edited'] = datetime_convert(); + $datarray['expires'] = $expires; $datarray['commented'] = datetime_convert(); $datarray['received'] = datetime_convert(); $datarray['changed'] = datetime_convert(); |