move profile privacy settings to the Privacy section of the Settings page

This commit is contained in:
Friendika 2011-06-19 16:47:03 -07:00
parent 76ddbff0b5
commit c2dcff0d02
5 changed files with 45 additions and 26 deletions

View File

@ -15,7 +15,7 @@ function newmember_content(&$a) {
$o .= '<li>' . '<a href="settings">' . t('On your <em>Settings</em> page - change your initial password. Also make a note of your Identity Address. This will be useful in making friends.') . '</a></li>' . EOL;
$o .= '<li>' . '<a href="settings">' . t('Review the other settings, particularly the choice of publishing your profile to various directories. An unpublished directory is like an unlisted phone number. Great for privacy - but unless you inform all your friends, nobody can find you.') . '</a></li>' . EOL;
$o .= '<li>' . '<a href="settings">' . t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.') . '</a></li>' . EOL;
$o .= '<li>' . '<a href="profile_photo">' . t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.') . '</a></li>' . EOL;

View File

@ -129,8 +129,6 @@ function profiles_post(&$a) {
$work = escape_tags(trim($_POST['work']));
$education = escape_tags(trim($_POST['education']));
$hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
$hidewall = (($_POST['hidewall'] == 1) ? 1: 0);
$r = q("UPDATE `profile`
SET `profile-name` = '%s',
@ -161,8 +159,7 @@ function profiles_post(&$a) {
`romance` = '%s',
`work` = '%s',
`education` = '%s',
`hide-friends` = %d,
`hidewall` = %d
`hide-friends` = %d
WHERE `id` = %d AND `uid` = %d LIMIT 1",
dbesc($profile_name),
dbesc($name),
@ -193,7 +190,6 @@ function profiles_post(&$a) {
dbesc($work),
dbesc($education),
intval($hide_friends),
intval($hidewall),
intval($a->argv[1]),
intval($_SESSION['uid'])
);
@ -361,16 +357,6 @@ function profiles_content(&$a) {
'$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
));
$opt_tpl = get_markup_template("profile-hide-wall.tpl");
$hide_wall = replace_macros($opt_tpl,array(
'$desc' => t('Hide profile details and all your messages from unknown viewers?'),
'$yes_str' => t('Yes'),
'$no_str' => t('No'),
'$yes_selected' => (($r[0]['hidewall']) ? " checked=\"checked\" " : ""),
'$no_selected' => (($r[0]['hidewall'] == 0) ? " checked=\"checked\" " : "")
));
$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
$a->page['htmlhead'] .= "<script type=\"text/javascript\" src=\"include/country.js\" ></script>";
@ -426,7 +412,6 @@ function profiles_content(&$a) {
'$pdesc' => $r[0]['pdesc'],
'$dob' => dob($r[0]['dob']),
'$hide_friends' => $hide_friends,
'$hide_wall' => $hide_wall,
'$address' => $r[0]['address'],
'$locality' => $r[0]['locality'],
'$region' => $r[0]['region'],

View File

@ -99,6 +99,12 @@ function settings_post(&$a) {
$page_flags = (((x($_POST,'page-flags')) && (intval($_POST['page-flags']))) ? intval($_POST['page-flags']) : 0);
$blockwall = (((x($_POST,'blockwall')) && (intval($_POST['blockwall']) == 1)) ? 0: 1); // this setting is inverted!
$hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
$hidewall = (($_POST['hidewall'] == 1) ? 1: 0);
$mail_server = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : '');
$mail_port = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : '');
$mail_ssl = ((x($_POST,'mail_ssl')) ? strtolower(trim($_POST['mail_ssl'])) : '');
@ -248,10 +254,15 @@ function settings_post(&$a) {
info( t('Settings updated.') . EOL);
$r = q("UPDATE `profile`
SET `publish` = %d, `net-publish` = %d
SET `publish` = %d,
`net-publish` = %d,
`hide-friends` = %d,
`hidewall` = %d
WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
intval($publish),
intval($net_publish),
intval($hide_friends),
intval($hidewall),
intval(local_user())
);
@ -388,7 +399,7 @@ function settings_content(&$a) {
else {
$opt_tpl = get_markup_template("profile-in-directory.tpl");
$profile_in_dir = replace_macros($opt_tpl,array(
'$desc' => t('Publish your default profile in site directory?'),
'$desc' => t('Publish your default profile in your local site directory?'),
'$yes_str' => t('Yes'),
'$no_str' => t('No'),
'$yes_selected' => (($profile['publish']) ? " checked=\"checked\" " : ""),
@ -400,7 +411,7 @@ function settings_content(&$a) {
$opt_tpl = get_markup_template("profile-in-netdir.tpl");
$profile_in_net_dir = replace_macros($opt_tpl,array(
'$desc' => t('Publish your default profile in global social directory?'),
'$desc' => t('Publish your default profile in the global social directory?'),
'$yes_str' => t('Yes'),
'$no_str' => t('No'),
'$yes_selected' => (($profile['net-publish']) ? " checked=\"checked\" " : ""),
@ -410,6 +421,30 @@ function settings_content(&$a) {
else
$profile_in_net_dir = '';
$opt_tpl = get_markup_template("profile-hide-friends.tpl");
$hide_friends = replace_macros($opt_tpl,array(
'$desc' => t('Hide your contact/friend list from viewers of your default profile?'),
'$yes_str' => t('Yes'),
'$no_str' => t('No'),
'$yes_selected' => (($profile['hide-friends']) ? " checked=\"checked\" " : ""),
'$no_selected' => (($profile['hide-friends'] == 0) ? " checked=\"checked\" " : "")
));
$opt_tpl = get_markup_template("profile-hide-wall.tpl");
$hide_wall = replace_macros($opt_tpl,array(
'$desc' => t('Hide profile details and all your messages from unknown viewers?'),
'$yes_str' => t('Yes'),
'$no_str' => t('No'),
'$yes_selected' => (($profile['hidewall']) ? " checked=\"checked\" " : ""),
'$no_selected' => (($profile['hidewall'] == 0) ? " checked=\"checked\" " : "")
));
$loc_checked = (($a->user['allow_location'] == 1) ? " checked=\"checked\" " : "");
$invisible = (((! $profile['publish']) && (! $profile['net-publish']))
@ -486,6 +521,8 @@ function settings_content(&$a) {
'$lbl_pass4' => t('Confirm:'),
'$lbl_advn' => t('Advanced Page Settings'),
'$baseurl' => $a->get_baseurl(),
'$hide_friends' => $hide_friends,
'$hide_wall' => $hide_wall,
'$oidhtml' => $oidhtml,
'$uexport' => $uexport,
'$uid' => local_user(),

View File

@ -52,8 +52,6 @@ $dob $age
$hide_friends
$hide_wall
<div class="profile-edit-submit-wrapper" >
<input type="submit" name="submit" class="profile-edit-submit-button" value="$submit" />
</div>

View File

@ -100,12 +100,13 @@ $theme
<div id="settings-maxreq-end"></div>
$profile_in_dir
$profile_in_net_dir
$hide_friends
$hide_wall
<div id="settings-default-perms" class="settings-default-perms" >
<div id="settings-default-perms-menu" class="fakelink" onClick="openClose('settings-default-perms-select');" >$permissions $permdesc</div>
@ -125,8 +126,6 @@ $profile_in_net_dir
</div>
<div id="settings-blockw-end" ></div>
<div id="settings-expire-desc">$lbl_exp1 <input type="text" size="3" name="expire" value="$expire" /> $lbl_exp2</div>
<div id="settings-expire-end"></div>