Removed gender and marital status for better privacy

This commit is contained in:
hauke 2015-12-24 08:42:48 +01:00
parent 3f5da87485
commit cd976b8dcc
14 changed files with 9 additions and 119 deletions

View File

@ -70,8 +70,6 @@ You can check the backlog of this queue at the `/admin` page.
* `.vcard .region` as `region`
* `.vcard .postal-code` as `postal-code`
* `.vcard .country-name` as `country-name`
* `.vcard .x-gender` as `gender`
* `.marital-text` as `marital`
3. If the `dfrn-global-visibility` value is set to false. Any existing records will be deleted.
And the process exits here.

View File

@ -61,8 +61,6 @@ CREATE TABLE IF NOT EXISTS `profile` (
`region` char(255) NOT NULL,
`postal-code` char(32) NOT NULL,
`country-name` char(255) NOT NULL,
`gender` char(32) NOT NULL,
`marital` char(255) NOT NULL,
`homepage` char(255) NOT NULL,
`photo` char(255) NOT NULL,
`tags` mediumtext NOT NULL,

View File

@ -103,7 +103,7 @@ function scrape_dfrn($url, $max_nodes=3500) {
$nodes_left = max(intval($max_nodes), $minNodes);
$items = $dom->getElementsByTagName('*');
$targets = array('fn', 'pdesc', 'photo', 'key', 'locality', 'region', 'postal-code', 'country-name', 'gender', 'marital');
$targets = array('fn', 'pdesc', 'photo', 'key', 'locality', 'region', 'postal-code', 'country-name');
$targets_left = count($targets);
foreach($items as $item) {
if(attribute_contains($item->getAttribute('class'), 'vcard')) {
@ -141,16 +141,8 @@ function scrape_dfrn($url, $max_nodes=3500) {
$ret['country-name'] = $x->textContent;
$targets_left = pop_scrape_target($targets, 'country-name');
}
if(attribute_contains($x->getAttribute('class'),'x-gender')){
$ret['gender'] = $x->textContent;
$targets_left = pop_scrape_target($targets, 'gender');
}
}
}
if(attribute_contains($item->getAttribute('class'),'marital-text')){
$ret['marital'] = $item->textContent;
$targets_left = pop_scrape_target($targets, 'marital');
}
$nodes_left--;
if($nodes_left <= 0 || $targets_left <= 0) break;
}

View File

@ -114,8 +114,6 @@ function run_submit($url) {
`region` = '%s',
`postal-code` = '%s',
`country-name` = '%s',
`gender` = '%s',
`marital` = '%s',
`homepage` = '%s',
`nurl` = '%s',
`comm` = %d,
@ -129,8 +127,6 @@ function run_submit($url) {
$parms['region'],
$parms['postal-code'],
$parms['country-name'],
$parms['gender'],
$parms['marital'],
dbesc($url),
dbesc($nurl),
intval($parms['comm']),
@ -142,7 +138,7 @@ function run_submit($url) {
}
else {
$r = q("INSERT INTO `profile` ( `name`, `pdesc`, `locality`, `region`, `postal-code`, `country-name`, `gender`, `marital`, `homepage`, `nurl`, `comm`, `tags`, `created`, `updated` )
$r = q("INSERT INTO `profile` ( `name`, `pdesc`, `locality`, `region`, `postal-code`, `country-name`, `homepage`, `nurl`, `comm`, `tags`, `created`, `updated` )
VALUES ( '%s', '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s' )",
$parms['fn'],
$parms['pdesc'],
@ -150,8 +146,6 @@ function run_submit($url) {
$parms['region'],
$parms['postal-code'],
$parms['country-name'],
$parms['gender'],
$parms['marital'],
dbesc($url),
dbesc($nurl),
intval($parms['comm']),

View File

@ -47,7 +47,7 @@ function directory_content(&$a) {
if($search)
$search = dbesc($search . '*');
$sql_extra = ((strlen($search)) ? " AND MATCH (`name`, `pdesc`, `homepage`, `locality`, `region`, `country-name`, `gender`, `marital`, `tags` )
$sql_extra = ((strlen($search)) ? " AND MATCH (`name`, `pdesc`, `homepage`, `locality`, `region`, `country-name`, `tags` )
AGAINST ('$search' IN BOOLEAN MODE) " : "");
if($forums)
@ -92,8 +92,6 @@ function directory_content(&$a) {
$details .= $rr['country-name'];
}
if(strlen($rr['gender']))
$details .= '<br />' . t('Gender: ') . $rr['gender'] ;
$o .= replace_macros($tpl,array(
'$id' => $rr['id'],
@ -107,8 +105,7 @@ function directory_content(&$a) {
'$name' => $rr['name'],
'$pclass' => (($rr['comm']) ? ' group' : ''),
'$pgroup' => (($rr['comm']) ? '<div class="directory-group">' . t('[Public Group]') . '</div>' : ''),
'$details' => $pdesc . $details,
'$marital' => ((strlen($rr['marital'])) ? '<div class="marital"><span class="marital-label"><span class="heart">&hearts;</span> ' . t('Status:') . ' </span><span class="marital-text">' . $rr['marital'] . '</span></div>' : '')
'$details' => $pdesc . $details

View File

@ -107,9 +107,6 @@ function moderate_content(&$a) {
$details .= $rr['country-name'];
}
if(strlen($rr['gender']))
$details .= '<br />' . t('Gender: ') . t($rr['gender']) ;
$o .= replace_macros($tpl,array(
'$id' => $rr['id'],
'$mod' => '',
@ -120,8 +117,7 @@ function moderate_content(&$a) {
'$star' => '',
'$pclass' => (($rr['comm']) ? ' group' : ''),
'$pgroup' => (($rr['comm']) ? '<div class="directory-group">' . t('[Public Group]') . '</div>' : ''),
'$details' => $pdesc . $details,
'$marital' => ((strlen($rr['marital'])) ? '<div class="marital"><span class="marital-label"><span class="heart">&hearts;</span> Status: </span><span class="marital-text">' . $rr['marital'] . '</span></div>' : '')
'$details' => $pdesc . $details

View File

@ -48,7 +48,7 @@ function search_content(&$a) {
//Run our query.
if($search)
$search = dbesc($search . '*');
$sql_extra = ((strlen($search)) ? " AND MATCH (`name`, `pdesc`, `homepage`, `locality`, `region`, `country-name`, `gender`, `marital`, `tags` )
$sql_extra = ((strlen($search)) ? " AND MATCH (`name`, `pdesc`, `homepage`, `locality`, `region`, `country-name`, `tags` )
AGAINST ('$search' IN BOOLEAN MODE) " : "");
if(!is_null($community))

View File

@ -178,10 +178,6 @@ msgstr ""
msgid "Search for: "
msgstr ""
#: ../../mod/directory.php:96 ../../mod/moderate.php:109
msgid "Gender: "
msgstr ""
#: ../../mod/directory.php:100
msgid "Flag this entry"
msgstr ""

View File

@ -13,6 +13,5 @@ $star
$pgroup
<div class="directory-name-end"></div>
<div class="directory-details">$details</div>
$marital
<div class="directory-item-end"></div>
</div>

View File

@ -42,19 +42,11 @@
<?php } ?>
<?php if(strlen($profile['gender'])) { ?>
<div class="mf">Gender: <span class="x-gender"><?php echo $profile['gender']; ?></span></div>
<?php } ?>
<?php if(strlen($profile['pubkey'])) { ?>
<div class="key" style="display: none"><?php echo $profile['pubkey']; ?></div>
<?php } ?>
</div>
<?php } ?>
<?php if(strlen($profile['marital'])) { ?>
<div class="marital"><span class="marital-label"><span class="heart">&hearts;</span> Status: </span><span class="marital-text"><?php echo $profile['marital']; ?></span></div>
<?php } ?>
<?php if(strlen($profile['url'])) { ?>
<div class="homepage"><span class="homepage-label">Homepage: </span><span class="homepage-url"><?php echo $profile['homepage']; ?></span></div>
<?php } ?>

View File

@ -19,16 +19,6 @@ $o .= <<< EOT
EOT;
}
if($a->profile['gender']) {
$o .= <<< EOT
<div id="advanced-profile-gender-wrapper" >
<div id="advanced-profile-gender-text">Gender:</div>
<div id="advanced-profile-gender">{$a->profile['gender']}</div>
</div>
<div id="advanced-profile-gender-end"></div>
EOT;
}
if($a->profile['dob']) {
$o .= <<< EOT
<div id="advanced-profile-dob-wrapper" >
@ -57,16 +47,6 @@ $o .= <<< EOT
EOT;
}
if($a->profile['marital']) {
$o .= <<< EOT
<div id="advanced-profile-marital-wrapper" >
<div id="advanced-profile-marital-text"><span class="heart">&hearts;</span> Status:</div>
<div id="advanced-profile-marital">{$a->profile['marital']}</div>
</div>
<div id="advanced-profile-marital-end"></div>
EOT;
}
if($a->profile['sexual']) {
$o .= <<< EOT
<div id="advanced-profile-sexual-wrapper" >

View File

@ -29,12 +29,6 @@ $default
</div>
<div id="profile-edit-name-end"></div>
<div id="profile-edit-gender-wrapper" >
<label id="profile-edit-gender-label" for="gender-select" >Your Gender: </label>
$gender
</div>
<div id="profile-edit-gender-end"></div>
<div id="profile-edit-dob-wrapper" >
<label id="profile-edit-dob-label" for="dob-select" >Birthday (y/m/d): </label>
<div id="profile-edit-dob" >
@ -94,12 +88,6 @@ $hide_friends
</div>
<div class="profile-edit-submit-end"></div>
<div id="profile-edit-marital-wrapper" >
<label id="profile-edit-marital-label" for="profile-edit-marital" >Marital Status: </label>
$marital
</div>
<div id="profile-edit-marital-end"></div>
<div id="profile-edit-sexual-wrapper" >
<label id="profile-edit-sexual-label" for="sexual-select" >Sexual Preference: </label>
$sexual

View File

@ -1,18 +1,6 @@
<?php
function gender_selector($current="",$suffix="") {
$select = array('', t('Male'), t('Female'), t('Transsexual'), t('Hermaphrodite'), t('Neuter'), t('Other'), t('Undecided'));
$o .= "<select name=\"gender$suffix\" id=\"gender-select$suffix\" size=\"1\" >";
foreach($select as $selection) {
$selected = (($selection == $current) ? ' selected="selected" ' : '');
$o .= "<option value=\"$selection\" $selected >$selection</option>";
}
$o .= '</select>';
return $o;
}
function sexpref_selector($current="",$suffix="") {
$select = array('', t('Males'), t('Females'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Nonsexual'));
@ -23,17 +11,4 @@ function sexpref_selector($current="",$suffix="") {
}
$o .= '</select>';
return $o;
}
function marital_selector($current="",$suffix="") {
$select = array('', t('Single'), t('Lonely'), t('Available'), t('Unavailable'), t('Dating'), t('Unfaithful'), t('Sex Addict'), t('Friends'), t('Friends/Benefits'), t('Casual'), t('Engaged'), t('Married'), t('Partners'), t('Cohabiting'), t('Happy'), t('Not Looking'), t('Swinger'), t('Betrayed'), t('Separated'), t('Unstable'), t('Divorced'), t('Widowed'), t('Uncertain'), t('Complicated'), t('Don\'t care'), t('Ask me') );
$o .= "<select name=\"marital[]\" id=\"marital-select\" multiple=\"multiple\" size=\"2\" >";
foreach($select as $selection) {
$selected = (($selection == $current) ? ' selected="selected" ' : '');
$o .= "<option value=\"$selection\" $selected >$selection</option>";
}
$o .= '</select>';
return $o;
}
}

View File

@ -544,14 +544,12 @@ input#dfrn-url {
#profile-edit-profile-name-label,
#profile-edit-name-label,
#profile-edit-gender-label,
#profile-edit-dob-label,
#profile-edit-address-label,
#profile-edit-locality-label,
#profile-edit-region-label,
#profile-edit-postal-code-label,
#profile-edit-country-name-label,
#profile-edit-marital-label,
#profile-edit-sexual-label,
#profile-edit-politic-label,
#profile-edit-religion-label,
@ -562,14 +560,12 @@ input#dfrn-url {
#profile-edit-profile-name,
#profile-edit-name,
#gender-select,
#profile-edit-dob,
#profile-edit-address,
#profile-edit-locality,
#profile-edit-region,
#profile-edit-postal-code,
#profile-edit-country-name,
#marital-select,
#sexual-select,
#profile-edit-politic,
#profile-edit-religion,
@ -597,14 +593,12 @@ input#dfrn-url {
#profile-edit-profile-name-end,
#profile-edit-name-end,
#profile-edit-gender-end,
#profile-edit-dob-end,
#profile-edit-address-end,
#profile-edit-locality-end,
#profile-edit-region-end,
#profile-edit-postal-code-end,
#profile-edit-country-name-end,
#profile-edit-marital-end,
#profile-edit-sexual-end,
#profile-edit-politic-end,
#profile-edit-religion-end,
@ -619,8 +613,7 @@ input#dfrn-url {
#gender-select, #marital-select, #sexual-select {
#sexual-select {
width: 220px;
}
@ -896,7 +889,7 @@ input#dfrn-url {
margin-top: 10px;
margin-left: 35px;
}
.directory-details, .marital {
.directory-details {
font-size: 0.7em;
text-align: center;
margin-left: 5px;
@ -956,10 +949,8 @@ input#dfrn-url {
#advanced-profile-name-wrapper,
#advanced-profile-gender-wrapper,
#advanced-profile-dob-wrapper,
#advanced-profile-age-wrapper,
#advanced-profile-marital-wrapper,
#advanced-profile-sexual-wrapper,
#advanced-profile-homepage-wrapper,
#advanced-profile-politic-wrapper,
@ -978,10 +969,8 @@ input#dfrn-url {
}
#advanced-profile-name-text,
#advanced-profile-gender-text,
#advanced-profile-dob-text,
#advanced-profile-age-text,
#advanced-profile-marital-text,
#advanced-profile-sexual-text,
#advanced-profile-homepage-text,
#advanced-profile-politic-text,
@ -1001,10 +990,8 @@ input#dfrn-url {
}
#advanced-profile-name-end,
#advanced-profile-gender-end,
#advanced-profile-dob-end,
#advanced-profile-age-end,
#advanced-profile-marital-end,
#advanced-profile-sexual-end,
#advanced-profile-homepage-end,
#advanced-profile-politic-end,
@ -1027,10 +1014,8 @@ input#dfrn-url {
}
#advanced-profile-name,
#advanced-profile-gender,
#advanced-profile-dob,
#advanced-profile-age,
#advanced-profile-marital,
#advanced-profile-sexual,
#advanced-profile-homepage,
#advanced-profile-politic,