From 7381326b7a7a271da52464d15774a1309adb2bd5 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 7 Nov 2013 00:47:50 -0800 Subject: provide expire feature on post and comments as well as private messages. This requires a feature setting and is currently unmaskable - if the author says it's gone, there's not a lot you can do to stop it or try and save it. It's gone. --- mod/editblock.php | 3 +++ mod/editlayout.php | 3 +++ mod/editpost.php | 6 +++++- mod/editwebpage.php | 4 ++++ mod/item.php | 8 +++----- mod/message.php | 6 ++++-- 6 files changed, 22 insertions(+), 8 deletions(-) (limited to 'mod') diff --git a/mod/editblock.php b/mod/editblock.php index a111f6666..9c691640b 100644 --- a/mod/editblock.php +++ b/mod/editblock.php @@ -144,6 +144,9 @@ function editblock_content(&$a) { '$preview' => ((feature_enabled(local_user(),'preview')) ? t('Preview') : ''), '$jotplugins' => $jotplugins, '$sourceapp' => t($a->sourcename), + '$defexpire' => '', + '$feature_expire' => 'none', + '$expires' => t('Set expiration date'), )); diff --git a/mod/editlayout.php b/mod/editlayout.php index 7bcd02512..f8906d981 100644 --- a/mod/editlayout.php +++ b/mod/editlayout.php @@ -129,6 +129,9 @@ function editlayout_content(&$a) { '$preview' => ((feature_enabled(local_user(),'preview')) ? t('Preview') : ''), '$jotplugins' => $jotplugins, '$sourceapp' => t($a->sourcename), + '$defexpire' => '', + '$feature_expire' => 'none', + '$expires' => t('Set expiration date'), )); $ob = get_observer_hash(); diff --git a/mod/editpost.php b/mod/editpost.php index 161e8f301..81eef2782 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -48,7 +48,8 @@ function editpost_content(&$a) { '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$ispublic' => ' ', // t('Visible to everybody'), '$geotag' => $geotag, - '$nickname' => $channel['channel_address'] + '$nickname' => $channel['channel_address'], + '$expireswhen' => t('Expires YYYY-MM-DD HH:MM'), )); @@ -126,6 +127,9 @@ function editpost_content(&$a) { '$jotplugins' => $jotplugins, '$sourceapp' => t($a->sourcename), '$catsenabled' => $catsenabled, + '$defexpire' => $itm[0]['expires'], + '$feature_expire' => 'none', + '$expires' => t('Set expiration date'), )); return $o; diff --git a/mod/editwebpage.php b/mod/editwebpage.php index 44ac0bc85..5a21aa78d 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -150,6 +150,10 @@ function editwebpage_content(&$a) { '$preview' => ((feature_enabled(local_user(),'preview')) ? t('Preview') : ''), '$jotplugins' => $jotplugins, '$sourceapp' => t($a->sourcename), + '$defexpire' => '', + '$feature_expire' => 'none', + '$expires' => t('Set expiration date'), + )); $ob = get_observer_hash(); diff --git a/mod/item.php b/mod/item.php index 2b8de1247..be24d242c 100644 --- a/mod/item.php +++ b/mod/item.php @@ -327,11 +327,9 @@ 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('UTC','UTC', 'now + ' . $_REQUEST['expire_quantity'] . ' ' . $_REQUEST['expire_units']); + if(feature_enabled($profile_uid,'content_expire')) { + if(x($_REQUEST,'expire')) { + $expires = datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['expire']); if($expires <= datetime_convert()) $expires = '0000-00-00 00:00:00'; } diff --git a/mod/message.php b/mod/message.php index e31d903a7..dbbe8836b 100644 --- a/mod/message.php +++ b/mod/message.php @@ -324,7 +324,8 @@ function message_content(&$a) { '$insert' => t('Insert web link'), '$wait' => t('Please wait'), '$submit' => t('Submit'), - '$expires' => t('Expires: (leave blank for never)') + '$expires' => t('Expires: (leave blank for never)'), + '$feature_expire' => ((feature_enabled(local_user(),'content_expire')) ? '1' : ''), )); return $o; @@ -499,7 +500,8 @@ function message_content(&$a) { '$insert' => t('Insert web link'), '$submit' => t('Submit'), '$wait' => t('Please wait'), - '$expires' => t('Expires: (leave blank for never)') + '$expires' => t('Expires: (leave blank for never)'), + '$feature_expire' => ((feature_enabled(local_user(),'content_expire')) ? '1' : ''), )); return $o; -- cgit v1.2.3