aboutsummaryrefslogtreecommitdiffstats
path: root/mod/settings.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-11-17 15:53:59 +0100
committerFabio Comuni <fabrix.xm@gmail.com>2011-11-17 15:53:59 +0100
commit79603e31463eb143392c5d27a5b2c87687b2460c (patch)
tree88783dde1e52edbb53d28ed1eb1aac1fac5ac140 /mod/settings.php
parent844a36e2b6c9cd8e934b57b7d56b7a9863f12929 (diff)
downloadvolse-hubzilla-79603e31463eb143392c5d27a5b2c87687b2460c.tar.gz
volse-hubzilla-79603e31463eb143392c5d27a5b2c87687b2460c.tar.bz2
volse-hubzilla-79603e31463eb143392c5d27a5b2c87687b2460c.zip
expire settings for items, notes and photos.
show default privacy acl in popup
Diffstat (limited to 'mod/settings.php')
-rw-r--r--mod/settings.php29
1 files changed, 27 insertions, 2 deletions
diff --git a/mod/settings.php b/mod/settings.php
index a073a5e98..f51a484c8 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -215,6 +215,12 @@ function settings_post(&$a) {
$openid = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url'])) : '');
$maxreq = ((x($_POST,'maxreq')) ? intval($_POST['maxreq']) : 0);
$expire = ((x($_POST,'expire')) ? intval($_POST['expire']) : 0);
+
+
+ $expire_items = ((x($_POST,'expire_items')) ? intval($_POST['expire_items']) : 0);
+ $expire_notes = ((x($_POST,'expire_notes')) ? intval($_POST['expire_notes']) : 0);
+ $expire_photos = ((x($_POST,'expire_photos'))? intval($_POST['expire_photos']) : 0);
+
$allow_location = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0);
$publish = (((x($_POST,'profile_in_directory')) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0);
@@ -297,6 +303,10 @@ function settings_post(&$a) {
$openidserver = '';
}
+ set_pconfig(local_user(),'expire','items', $expire_items);
+ set_pconfig(local_user(),'expire','notes', $expire_notes);
+ set_pconfig(local_user(),'expire','photos', $expire_photos);
+
$r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s', `maxreq` = %d, `expire` = %d, `openidserver` = '%s', `blockwall` = %d, `hidewall` = %d, `blocktags` = %d WHERE `uid` = %d LIMIT 1",
dbesc($username),
dbesc($email),
@@ -586,6 +596,15 @@ function settings_content(&$a) {
$blockwall = $a->user['blockwall'];
$blocktags = $a->user['blocktags'];
+ $expire_items = get_pconfig(local_user(), 'expire','items');
+ $expire_items = (($expire_items===false)?1:$expire_items); // default if not set: 1
+
+ $expire_notes = get_pconfig(local_user(), 'expire','notes');
+ $expire_notes = (($expire_notes===false)?1:$expire_notes); // default if not set: 1
+
+ $expire_photos = get_pconfig(local_user(), 'expire','photos');
+ $expire_photos = (($expire_photos===false)?0:$expire_photos); // default if not set: 0
+
if(! strlen($a->user['timezone']))
$timezone = date_default_timezone_get();
@@ -698,7 +717,13 @@ function settings_content(&$a) {
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
-
+ $expire_arr = array(
+ 'days' => array('expire', t("Automatically expire posts after days:"), $expire, t('If empty, posts will not expire. Expired posts will be deleted')),
+ 'advanced' => t('Advanced expire settings'),
+ 'items' => array('expire_items', t("Expire posts:"), $expire_items, '', array(t('No'),t('Yes'))),
+ 'notes' => array('expire_notes', t("Expire personal notes:"), $expire_notes, '', array(t('No'),t('Yes'))),
+ 'photos' => array('expire_photos', t("Expire photos:"), $expire_photos, '', array(t('No'),t('Yes'))),
+ );
$o .= replace_macros($stpl,array(
'$tabs' => $tabs,
@@ -736,7 +761,7 @@ function settings_content(&$a) {
'$blockwall'=> $blockwall, // array('blockwall', t('Allow friends to post to your profile page:'), !$blockwall, ''),
'$blocktags'=> $blocktags, // array('blocktags', t('Allow friends to tag your posts:'), !$blocktags, ''),
- '$expire' => array('expire', t("Automatically expire posts after days:"), $expire, t('If empty, posts will not expire. Expired posts will be deleted')),
+ '$expire' => $expire_arr,
'$profile_in_dir' => $profile_in_dir,
'$profile_in_net_dir' => $profile_in_net_dir,