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 .region` as `region`
* `.vcard .postal-code` as `postal-code` * `.vcard .postal-code` as `postal-code`
* `.vcard .country-name` as `country-name` * `.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. 3. If the `dfrn-global-visibility` value is set to false. Any existing records will be deleted.
And the process exits here. And the process exits here.

View file

@ -61,8 +61,6 @@ CREATE TABLE IF NOT EXISTS `profile` (
`region` char(255) NOT NULL, `region` char(255) NOT NULL,
`postal-code` char(32) NOT NULL, `postal-code` char(32) NOT NULL,
`country-name` char(255) NOT NULL, `country-name` char(255) NOT NULL,
`gender` char(32) NOT NULL,
`marital` char(255) NOT NULL,
`homepage` char(255) NOT NULL, `homepage` char(255) NOT NULL,
`photo` char(255) NOT NULL, `photo` char(255) NOT NULL,
`tags` mediumtext 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); $nodes_left = max(intval($max_nodes), $minNodes);
$items = $dom->getElementsByTagName('*'); $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); $targets_left = count($targets);
foreach($items as $item) { foreach($items as $item) {
if(attribute_contains($item->getAttribute('class'), 'vcard')) { if(attribute_contains($item->getAttribute('class'), 'vcard')) {
@ -141,16 +141,8 @@ function scrape_dfrn($url, $max_nodes=3500) {
$ret['country-name'] = $x->textContent; $ret['country-name'] = $x->textContent;
$targets_left = pop_scrape_target($targets, 'country-name'); $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--; $nodes_left--;
if($nodes_left <= 0 || $targets_left <= 0) break; if($nodes_left <= 0 || $targets_left <= 0) break;
} }

View file

@ -114,8 +114,6 @@ function run_submit($url) {
`region` = '%s', `region` = '%s',
`postal-code` = '%s', `postal-code` = '%s',
`country-name` = '%s', `country-name` = '%s',
`gender` = '%s',
`marital` = '%s',
`homepage` = '%s', `homepage` = '%s',
`nurl` = '%s', `nurl` = '%s',
`comm` = %d, `comm` = %d,
@ -129,8 +127,6 @@ function run_submit($url) {
$parms['region'], $parms['region'],
$parms['postal-code'], $parms['postal-code'],
$parms['country-name'], $parms['country-name'],
$parms['gender'],
$parms['marital'],
dbesc($url), dbesc($url),
dbesc($nurl), dbesc($nurl),
intval($parms['comm']), intval($parms['comm']),
@ -142,7 +138,7 @@ function run_submit($url) {
} }
else { 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' )", VALUES ( '%s', '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s' )",
$parms['fn'], $parms['fn'],
$parms['pdesc'], $parms['pdesc'],
@ -150,8 +146,6 @@ function run_submit($url) {
$parms['region'], $parms['region'],
$parms['postal-code'], $parms['postal-code'],
$parms['country-name'], $parms['country-name'],
$parms['gender'],
$parms['marital'],
dbesc($url), dbesc($url),
dbesc($nurl), dbesc($nurl),
intval($parms['comm']), intval($parms['comm']),

View file

@ -47,7 +47,7 @@ function directory_content(&$a) {
if($search) if($search)
$search = dbesc($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) " : ""); AGAINST ('$search' IN BOOLEAN MODE) " : "");
if($forums) if($forums)
@ -92,8 +92,6 @@ function directory_content(&$a) {
$details .= $rr['country-name']; $details .= $rr['country-name'];
} }
if(strlen($rr['gender']))
$details .= '<br />' . t('Gender: ') . $rr['gender'] ;
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$id' => $rr['id'], '$id' => $rr['id'],
@ -107,8 +105,7 @@ function directory_content(&$a) {
'$name' => $rr['name'], '$name' => $rr['name'],
'$pclass' => (($rr['comm']) ? ' group' : ''), '$pclass' => (($rr['comm']) ? ' group' : ''),
'$pgroup' => (($rr['comm']) ? '<div class="directory-group">' . t('[Public Group]') . '</div>' : ''), '$pgroup' => (($rr['comm']) ? '<div class="directory-group">' . t('[Public Group]') . '</div>' : ''),
'$details' => $pdesc . $details, '$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>' : '')

View file

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

View file

@ -48,7 +48,7 @@ function search_content(&$a) {
//Run our query. //Run our query.
if($search) if($search)
$search = dbesc($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) " : ""); AGAINST ('$search' IN BOOLEAN MODE) " : "");
if(!is_null($community)) if(!is_null($community))

View file

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

View file

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

View file

@ -42,19 +42,11 @@
<?php } ?> <?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'])) { ?> <?php if(strlen($profile['pubkey'])) { ?>
<div class="key" style="display: none"><?php echo $profile['pubkey']; ?></div> <div class="key" style="display: none"><?php echo $profile['pubkey']; ?></div>
<?php } ?> <?php } ?>
</div> </div>
<?php } ?> <?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'])) { ?> <?php if(strlen($profile['url'])) { ?>
<div class="homepage"><span class="homepage-label">Homepage: </span><span class="homepage-url"><?php echo $profile['homepage']; ?></span></div> <div class="homepage"><span class="homepage-label">Homepage: </span><span class="homepage-url"><?php echo $profile['homepage']; ?></span></div>
<?php } ?> <?php } ?>

View file

@ -19,16 +19,6 @@ $o .= <<< EOT
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']) { if($a->profile['dob']) {
$o .= <<< EOT $o .= <<< EOT
<div id="advanced-profile-dob-wrapper" > <div id="advanced-profile-dob-wrapper" >
@ -57,16 +47,6 @@ $o .= <<< EOT
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']) { if($a->profile['sexual']) {
$o .= <<< EOT $o .= <<< EOT
<div id="advanced-profile-sexual-wrapper" > <div id="advanced-profile-sexual-wrapper" >

View file

@ -29,12 +29,6 @@ $default
</div> </div>
<div id="profile-edit-name-end"></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" > <div id="profile-edit-dob-wrapper" >
<label id="profile-edit-dob-label" for="dob-select" >Birthday (y/m/d): </label> <label id="profile-edit-dob-label" for="dob-select" >Birthday (y/m/d): </label>
<div id="profile-edit-dob" > <div id="profile-edit-dob" >
@ -94,12 +88,6 @@ $hide_friends
</div> </div>
<div class="profile-edit-submit-end"></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" > <div id="profile-edit-sexual-wrapper" >
<label id="profile-edit-sexual-label" for="sexual-select" >Sexual Preference: </label> <label id="profile-edit-sexual-label" for="sexual-select" >Sexual Preference: </label>
$sexual $sexual

View file

@ -1,18 +1,6 @@
<?php <?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="") { function sexpref_selector($current="",$suffix="") {
$select = array('', t('Males'), t('Females'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Nonsexual')); $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>'; $o .= '</select>';
return $o; 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-profile-name-label,
#profile-edit-name-label, #profile-edit-name-label,
#profile-edit-gender-label,
#profile-edit-dob-label, #profile-edit-dob-label,
#profile-edit-address-label, #profile-edit-address-label,
#profile-edit-locality-label, #profile-edit-locality-label,
#profile-edit-region-label, #profile-edit-region-label,
#profile-edit-postal-code-label, #profile-edit-postal-code-label,
#profile-edit-country-name-label, #profile-edit-country-name-label,
#profile-edit-marital-label,
#profile-edit-sexual-label, #profile-edit-sexual-label,
#profile-edit-politic-label, #profile-edit-politic-label,
#profile-edit-religion-label, #profile-edit-religion-label,
@ -562,14 +560,12 @@ input#dfrn-url {
#profile-edit-profile-name, #profile-edit-profile-name,
#profile-edit-name, #profile-edit-name,
#gender-select,
#profile-edit-dob, #profile-edit-dob,
#profile-edit-address, #profile-edit-address,
#profile-edit-locality, #profile-edit-locality,
#profile-edit-region, #profile-edit-region,
#profile-edit-postal-code, #profile-edit-postal-code,
#profile-edit-country-name, #profile-edit-country-name,
#marital-select,
#sexual-select, #sexual-select,
#profile-edit-politic, #profile-edit-politic,
#profile-edit-religion, #profile-edit-religion,
@ -597,14 +593,12 @@ input#dfrn-url {
#profile-edit-profile-name-end, #profile-edit-profile-name-end,
#profile-edit-name-end, #profile-edit-name-end,
#profile-edit-gender-end,
#profile-edit-dob-end, #profile-edit-dob-end,
#profile-edit-address-end, #profile-edit-address-end,
#profile-edit-locality-end, #profile-edit-locality-end,
#profile-edit-region-end, #profile-edit-region-end,
#profile-edit-postal-code-end, #profile-edit-postal-code-end,
#profile-edit-country-name-end, #profile-edit-country-name-end,
#profile-edit-marital-end,
#profile-edit-sexual-end, #profile-edit-sexual-end,
#profile-edit-politic-end, #profile-edit-politic-end,
#profile-edit-religion-end, #profile-edit-religion-end,
@ -619,8 +613,7 @@ input#dfrn-url {
#sexual-select {
#gender-select, #marital-select, #sexual-select {
width: 220px; width: 220px;
} }
@ -896,7 +889,7 @@ input#dfrn-url {
margin-top: 10px; margin-top: 10px;
margin-left: 35px; margin-left: 35px;
} }
.directory-details, .marital { .directory-details {
font-size: 0.7em; font-size: 0.7em;
text-align: center; text-align: center;
margin-left: 5px; margin-left: 5px;
@ -956,10 +949,8 @@ input#dfrn-url {
#advanced-profile-name-wrapper, #advanced-profile-name-wrapper,
#advanced-profile-gender-wrapper,
#advanced-profile-dob-wrapper, #advanced-profile-dob-wrapper,
#advanced-profile-age-wrapper, #advanced-profile-age-wrapper,
#advanced-profile-marital-wrapper,
#advanced-profile-sexual-wrapper, #advanced-profile-sexual-wrapper,
#advanced-profile-homepage-wrapper, #advanced-profile-homepage-wrapper,
#advanced-profile-politic-wrapper, #advanced-profile-politic-wrapper,
@ -978,10 +969,8 @@ input#dfrn-url {
} }
#advanced-profile-name-text, #advanced-profile-name-text,
#advanced-profile-gender-text,
#advanced-profile-dob-text, #advanced-profile-dob-text,
#advanced-profile-age-text, #advanced-profile-age-text,
#advanced-profile-marital-text,
#advanced-profile-sexual-text, #advanced-profile-sexual-text,
#advanced-profile-homepage-text, #advanced-profile-homepage-text,
#advanced-profile-politic-text, #advanced-profile-politic-text,
@ -1001,10 +990,8 @@ input#dfrn-url {
} }
#advanced-profile-name-end, #advanced-profile-name-end,
#advanced-profile-gender-end,
#advanced-profile-dob-end, #advanced-profile-dob-end,
#advanced-profile-age-end, #advanced-profile-age-end,
#advanced-profile-marital-end,
#advanced-profile-sexual-end, #advanced-profile-sexual-end,
#advanced-profile-homepage-end, #advanced-profile-homepage-end,
#advanced-profile-politic-end, #advanced-profile-politic-end,
@ -1027,10 +1014,8 @@ input#dfrn-url {
} }
#advanced-profile-name, #advanced-profile-name,
#advanced-profile-gender,
#advanced-profile-dob, #advanced-profile-dob,
#advanced-profile-age, #advanced-profile-age,
#advanced-profile-marital,
#advanced-profile-sexual, #advanced-profile-sexual,
#advanced-profile-homepage, #advanced-profile-homepage,
#advanced-profile-politic, #advanced-profile-politic,