aboutsummaryrefslogtreecommitdiffstats
path: root/mod/profiles.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-08-19 22:04:18 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-08-19 22:04:18 -0700
commitcac8aa7a693574292fc408c204472f2ef267a930 (patch)
tree9bf5709fec4e322fe30a55518e74a35e37bd5a8c /mod/profiles.php
parentf9f284ba708c7f135931f87a922e7716a3dabb85 (diff)
downloadvolse-hubzilla-cac8aa7a693574292fc408c204472f2ef267a930.tar.gz
volse-hubzilla-cac8aa7a693574292fc408c204472f2ef267a930.tar.bz2
volse-hubzilla-cac8aa7a693574292fc408c204472f2ef267a930.zip
increase visibility of visibility settings
Diffstat (limited to 'mod/profiles.php')
-rw-r--r--mod/profiles.php43
1 files changed, 7 insertions, 36 deletions
diff --git a/mod/profiles.php b/mod/profiles.php
index 853aac6de..3cf2aca80 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -72,10 +72,7 @@ function profiles_post(&$a) {
$romance = escape_tags(trim($_POST['romance']));
$work = escape_tags(trim($_POST['work']));
$education = escape_tags(trim($_POST['education']));
- if(x($_POST,'profile_in_directory'))
- $publish = (($_POST['profile_in_directory'] == 1) ? 1: 0);
- if(x($_POST,'profile_in_netdirectory'))
- $net_publish = (($_POST['profile_in_netdirectory'] == 1) ? 1: 0);
+ $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
$r = q("UPDATE `profile`
@@ -102,7 +99,8 @@ function profiles_post(&$a) {
`film` = '%s',
`romance` = '%s',
`work` = '%s',
- `education` = '%s'
+ `education` = '%s',
+ `hide-friends` = %d
WHERE `id` = %d AND `uid` = %d LIMIT 1",
dbesc($profile_name),
dbesc($name),
@@ -128,6 +126,7 @@ function profiles_post(&$a) {
dbesc($romance),
dbesc($work),
dbesc($education),
+ intval($hide_friends),
intval($a->argv[1]),
intval($_SESSION['uid'])
);
@@ -136,23 +135,13 @@ function profiles_post(&$a) {
notice( t('Profile updated.') . EOL);
- if($is_default) {
- $r = q("UPDATE `profile`
- SET `publish` = %d, `net-publish` = %d
- WHERE `id` = %d AND `uid` = %d LIMIT 1",
- intval($publish),
- intval($net_publish),
- intval($a->argv[1]),
- intval($_SESSION['uid'])
-
- );
- }
if($namechanged && $is_default) {
$r = q("UPDATE `contact` SET `name-date` = '%s' WHERE `self` = 1 AND `uid` = %d LIMIT 1",
dbesc(datetime_convert()),
intval($_SESSION['uid'])
);
}
+
if($is_default) {
// Update global directory in background
$php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
@@ -253,6 +242,7 @@ function profiles_content(&$a) {
unset($r1[0]['id']);
$r1[0]['is-default'] = 0;
$r1[0]['publish'] = 0;
+ $r1[0]['net-publish'] = 0;
$r1[0]['profile-name'] = dbesc($name);
dbesc_array($r1[0]);
@@ -291,23 +281,6 @@ function profiles_content(&$a) {
require_once('view/profile_selectors.php');
$tpl = file_get_contents('view/profed_head.tpl');
- $opt_tpl = file_get_contents("view/profile-in-directory.tpl");
- $profile_in_dir = replace_macros($opt_tpl,array(
- '$yes_selected' => (($r[0]['publish']) ? " checked=\"checked\" " : ""),
- '$no_selected' => (($r[0]['publish'] == 0) ? " checked=\"checked\" " : "")
- ));
-
- if(strlen(get_config('system','directory_submit_url'))) {
- $opt_tpl = file_get_contents("view/profile-in-netdir.tpl");
-
- $profile_in_net_dir = replace_macros($opt_tpl,array(
- '$yes_selected' => (($r[0]['net-publish']) ? " checked=\"checked\" " : ""),
- '$no_selected' => (($r[0]['net-publish'] == 0) ? " checked=\"checked\" " : "")
- ));
- }
- else
- $profile_in_net_dir = '';
-
$opt_tpl = file_get_contents("view/profile-hide-friends.tpl");
$hide_friends = replace_macros($opt_tpl,array(
@@ -355,9 +328,7 @@ function profiles_content(&$a) {
'$romance' => $r[0]['romance'],
'$work' => $r[0]['work'],
'$education' => $r[0]['education'],
- '$contact' => $r[0]['contact'],
- '$profile_in_dir' => (($is_default) ? $profile_in_dir : ''),
- '$profile_in_net_dir' => (($is_default) ? $profile_in_net_dir : '')
+ '$contact' => $r[0]['contact']
));
return $o;