fix sql query and provide setting to hide online status
This commit is contained in:
parent
6e22aa25cc
commit
8efac0cfd6
@ -50,6 +50,7 @@ function ping_init(&$a) {
|
|||||||
if($r) {
|
if($r) {
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
q("update chatpresence set cp_last = '%s' where cp_id = %d limit 1",
|
q("update chatpresence set cp_last = '%s' where cp_id = %d limit 1",
|
||||||
|
dbesc(datetime_convert()),
|
||||||
intval($rr['cp_id'])
|
intval($rr['cp_id'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -67,7 +68,6 @@ function ping_init(&$a) {
|
|||||||
|
|
||||||
q("delete from chatpresence where cp_last < UTC_TIMESTAMP() - INTERVAL 2 MINUTE");
|
q("delete from chatpresence where cp_last < UTC_TIMESTAMP() - INTERVAL 2 MINUTE");
|
||||||
|
|
||||||
|
|
||||||
if((! local_user()) || ($result['invalid'])) {
|
if((! local_user()) || ($result['invalid'])) {
|
||||||
echo json_encode($result);
|
echo json_encode($result);
|
||||||
killme();
|
killme();
|
||||||
|
@ -266,6 +266,7 @@ function settings_post(&$a) {
|
|||||||
$expire_network_only = ((x($_POST,'expire_network_only'))? intval($_POST['expire_network_only']) : 0);
|
$expire_network_only = ((x($_POST,'expire_network_only'))? intval($_POST['expire_network_only']) : 0);
|
||||||
|
|
||||||
$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);
|
||||||
|
$hide_presence = (((x($_POST,'hide_presence')) && (intval($_POST['hide_presence']) == 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);
|
||||||
$page_flags = (((x($_POST,'page-flags')) && (intval($_POST['page-flags']))) ? intval($_POST['page-flags']) : 0);
|
$page_flags = (((x($_POST,'page-flags')) && (intval($_POST['page-flags']))) ? intval($_POST['page-flags']) : 0);
|
||||||
@ -395,6 +396,7 @@ function settings_post(&$a) {
|
|||||||
set_pconfig(local_user(),'system','post_joingroup', $post_joingroup);
|
set_pconfig(local_user(),'system','post_joingroup', $post_joingroup);
|
||||||
set_pconfig(local_user(),'system','post_profilechange', $post_profilechange);
|
set_pconfig(local_user(),'system','post_profilechange', $post_profilechange);
|
||||||
set_pconfig(local_user(),'system','blocktags',$blocktags);
|
set_pconfig(local_user(),'system','blocktags',$blocktags);
|
||||||
|
set_pconfig(local_user(),'system','hide_online_status',$hide_presence);
|
||||||
|
|
||||||
|
|
||||||
$r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d, channel_default_group = '%s', channel_r_stream = %d, channel_r_profile = %d, channel_r_photos = %d, channel_r_abook = %d, channel_w_stream = %d, channel_w_wall = %d, channel_w_tagwall = %d, channel_w_comment = %d, channel_w_mail = %d, channel_w_photos = %d, channel_w_chat = %d, channel_a_delegate = %d, channel_r_storage = %d, channel_w_storage = %d, channel_r_pages = %d, channel_w_pages = %d, channel_a_republish = %d, channel_allow_cid = '%s', channel_allow_gid = '%s', channel_deny_cid = '%s', channel_deny_gid = '%s' where channel_id = %d limit 1",
|
$r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d, channel_default_group = '%s', channel_r_stream = %d, channel_r_profile = %d, channel_r_photos = %d, channel_r_abook = %d, channel_w_stream = %d, channel_w_wall = %d, channel_w_tagwall = %d, channel_w_comment = %d, channel_w_mail = %d, channel_w_photos = %d, channel_w_chat = %d, channel_a_delegate = %d, channel_r_storage = %d, channel_w_storage = %d, channel_r_pages = %d, channel_w_pages = %d, channel_a_republish = %d, channel_allow_cid = '%s', channel_allow_gid = '%s', channel_deny_cid = '%s', channel_deny_gid = '%s' where channel_id = %d limit 1",
|
||||||
@ -821,6 +823,9 @@ function settings_content(&$a) {
|
|||||||
$unkmail = $a->user['unkmail'];
|
$unkmail = $a->user['unkmail'];
|
||||||
$cntunkmail = $a->user['cntunkmail'];
|
$cntunkmail = $a->user['cntunkmail'];
|
||||||
|
|
||||||
|
$hide_presence = intval(get_pconfig(local_user(), 'system','hide_online_status'));
|
||||||
|
|
||||||
|
|
||||||
$expire_items = get_pconfig(local_user(), 'expire','items');
|
$expire_items = get_pconfig(local_user(), 'expire','items');
|
||||||
$expire_items = (($expire_items===false)? '1' : $expire_items); // default if not set: 1
|
$expire_items = (($expire_items===false)? '1' : $expire_items); // default if not set: 1
|
||||||
|
|
||||||
@ -918,6 +923,8 @@ function settings_content(&$a) {
|
|||||||
|
|
||||||
'$h_prv' => t('Security and Privacy Settings'),
|
'$h_prv' => t('Security and Privacy Settings'),
|
||||||
|
|
||||||
|
'$hide_presence' => array('hide_presence', t('Hide my online presence'),$hide_presence, t('Prevents showing if you are available for chat')),
|
||||||
|
|
||||||
'$lbl_pmacro' => t('Quick Privacy Settings:'),
|
'$lbl_pmacro' => t('Quick Privacy Settings:'),
|
||||||
'$pmacro3' => t('Very Public - extremely permissive'),
|
'$pmacro3' => t('Very Public - extremely permissive'),
|
||||||
'$pmacro2' => t('Typical - default public, privacy when desired'),
|
'$pmacro2' => t('Typical - default public, privacy when desired'),
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
|
|
||||||
<h3 class="settings-heading">{{$h_prv}}</h3>
|
<h3 class="settings-heading">{{$h_prv}}</h3>
|
||||||
|
|
||||||
|
{{include file="field_checkbox.tpl" field=$hide_presence}}
|
||||||
|
|
||||||
|
|
||||||
<div id="settings-privacy-macros">{{$lbl_pmacro}}</div>
|
<div id="settings-privacy-macros">{{$lbl_pmacro}}</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#" onclick="channel_privacy_macro(3); return false" id="settings_pmacro3">{{$pmacro3}}</a></li>
|
<li><a href="#" onclick="channel_privacy_macro(3); return false" id="settings_pmacro3">{{$pmacro3}}</a></li>
|
||||||
|
Reference in New Issue
Block a user