1
1
Fork 0

browser_update settings

This commit is contained in:
friendica 2011-12-11 21:03:33 -08:00
parent 4f254ffb5b
commit a38d3b82b9
2 changed files with 12 additions and 3 deletions

View file

@ -223,7 +223,12 @@ function settings_post(&$a) {
$expire_notes = ((x($_POST,'expire_notes')) ? intval($_POST['expire_notes']) : 0); $expire_notes = ((x($_POST,'expire_notes')) ? intval($_POST['expire_notes']) : 0);
$expire_starred = ((x($_POST,'expire_starred')) ? intval($_POST['expire_starred']) : 0); $expire_starred = ((x($_POST,'expire_starred')) ? intval($_POST['expire_starred']) : 0);
$expire_photos = ((x($_POST,'expire_photos'))? intval($_POST['expire_photos']) : 0); $expire_photos = ((x($_POST,'expire_photos'))? intval($_POST['expire_photos']) : 0);
$browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0);
$browser_update = $browser_update * 1000;
if($browser_update < 10000)
$browser_update = 30000;
$allow_location = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 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); $publish = (((x($_POST,'profile_in_directory')) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0);
@ -313,6 +318,7 @@ function settings_post(&$a) {
set_pconfig(local_user(),'expire','photos', $expire_photos); set_pconfig(local_user(),'expire','photos', $expire_photos);
set_pconfig(local_user(),'system','suggestme', $suggestme); set_pconfig(local_user(),'system','suggestme', $suggestme);
set_pconfig(local_user(),'system','update_interval', $browser_update);
$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", $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($username),
@ -618,6 +624,9 @@ function settings_content(&$a) {
$suggestme = get_pconfig(local_user(), 'system','suggestme'); $suggestme = get_pconfig(local_user(), 'system','suggestme');
$suggestme = (($suggestme===false)?0:$suggestme); // default if not set: 0 $suggestme = (($suggestme===false)?0:$suggestme); // default if not set: 0
$browser_update = get_pconfig(local_user(), 'system','update_interval');
$browser_update = (($browser_update===false)? 30 : $browser_update / 1000); // default if not set: 30 seconds
if(! strlen($a->user['timezone'])) if(! strlen($a->user['timezone']))
$timezone = date_default_timezone_get(); $timezone = date_default_timezone_get();
@ -770,8 +779,7 @@ function settings_content(&$a) {
'$defloc' => array('defloc', t('Default Post Location:'), $defloc, ''), '$defloc' => array('defloc', t('Default Post Location:'), $defloc, ''),
'$allowloc' => array('allow_location', t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''), '$allowloc' => array('allow_location', t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''),
'$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes), '$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes),
'$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')),
'$h_prv' => t('Security and Privacy Settings'), '$h_prv' => t('Security and Privacy Settings'),

View file

@ -29,6 +29,7 @@ $nickname_block
{{inc field_input.tpl with $field=$defloc }}{{endinc}} {{inc field_input.tpl with $field=$defloc }}{{endinc}}
{{inc field_checkbox.tpl with $field=$allowloc }}{{endinc}} {{inc field_checkbox.tpl with $field=$allowloc }}{{endinc}}
{{inc field_select.tpl with $field=$theme }}{{endinc}} {{inc field_select.tpl with $field=$theme }}{{endinc}}
{{inc field_input.tpl with $field=$ajaxint }}{{endinc}}
<div class="settings-submit-wrapper" > <div class="settings-submit-wrapper" >