From a7dd0173a735291bee4d57bb3d9adcf064feb34d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 27 Jan 2020 22:01:12 -0500 Subject: [PATCH 1/4] Remove obsolete profile_id parameter in Model\Profile::load --- mod/common.php | 2 +- mod/crepair.php | 2 +- mod/display.php | 2 +- mod/follow.php | 2 +- mod/unfollow.php | 2 +- src/Model/Profile.php | 3 +-- src/Module/AllFriends.php | 2 +- src/Module/Contact.php | 4 ++-- src/Module/HoverCard.php | 4 +--- src/Module/NoScrape.php | 4 +--- 10 files changed, 11 insertions(+), 16 deletions(-) diff --git a/mod/common.php b/mod/common.php index d2e7baecae..7e1dcc1859 100644 --- a/mod/common.php +++ b/mod/common.php @@ -41,7 +41,7 @@ function common_content(App $a) if (DBA::isResult($contact)) { DI::page()['aside'] = ""; - Model\Profile::load($a, "", 0, Model\Contact::getDetailsByURL($contact["url"])); + Model\Profile::load($a, "", Model\Contact::getDetailsByURL($contact["url"])); } } else { $contact = DBA::selectFirst('contact', ['name', 'url', 'photo', 'uid', 'id'], ['self' => true, 'uid' => $uid]); diff --git a/mod/crepair.php b/mod/crepair.php index aec1b60471..a3caf95e66 100644 --- a/mod/crepair.php +++ b/mod/crepair.php @@ -108,7 +108,7 @@ function crepair_content(App $a) if (DBA::isResult($contact)) { $a->data['contact'] = $contact; - Model\Profile::load($a, "", 0, Model\Contact::getDetailsByURL($contact["url"])); + Model\Profile::load($a, "", Model\Contact::getDetailsByURL($contact["url"])); } $warning = DI::l10n()->t('WARNING: This is highly advanced and if you enter incorrect information your communications with this contact may stop working.'); diff --git a/mod/display.php b/mod/display.php index 582bcde28e..6784a20c49 100644 --- a/mod/display.php +++ b/mod/display.php @@ -114,7 +114,7 @@ function display_init(App $a) } } - Profile::load($a, $nick, 0, $profiledata); + Profile::load($a, $nick, $profiledata); } function display_fetchauthor($a, $item) diff --git a/mod/follow.php b/mod/follow.php index 5ab3d35264..cdd7b4904e 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -192,7 +192,7 @@ function follow_content(App $a) $profiledata = Contact::getDetailsByURL($ret['url']); if ($profiledata) { - Profile::load($a, '', 0, $profiledata, false); + Profile::load($a, '', $profiledata, false); } if ($gcontact_id <> 0) { diff --git a/mod/unfollow.php b/mod/unfollow.php index f64c2a4c96..0d13c73afc 100644 --- a/mod/unfollow.php +++ b/mod/unfollow.php @@ -141,7 +141,7 @@ function unfollow_content(App $a) ]); DI::page()['aside'] = ''; - Profile::load($a, '', 0, Contact::getDetailsByURL($contact['url'])); + Profile::load($a, '', Contact::getDetailsByURL($contact['url'])); $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), ['$title' => DI::l10n()->t('Status Messages and Posts')]); diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 18b09225e7..a8f3f6ac6f 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -121,13 +121,12 @@ class Profile * * @param App $a * @param string $nickname string - * @param int $profile_id int * @param array $profiledata array * @param boolean $show_connect Show connect link * @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \ImagickException */ - public static function load(App $a, $nickname, $profile_id = 0, array $profiledata = [], $show_connect = true) + public static function load(App $a, $nickname, array $profiledata = [], $show_connect = true) { $user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_removed' => false]); diff --git a/src/Module/AllFriends.php b/src/Module/AllFriends.php index 662dc17e4c..ffb57ccf6f 100644 --- a/src/Module/AllFriends.php +++ b/src/Module/AllFriends.php @@ -44,7 +44,7 @@ class AllFriends extends BaseModule } DI::page()['aside'] = ""; - Model\Profile::load($app, "", 0, Model\Contact::getDetailsByURL($contact["url"])); + Model\Profile::load($app, "", Model\Contact::getDetailsByURL($contact["url"])); $total = Model\GContact::countAllFriends(local_user(), $cid); diff --git a/src/Module/Contact.php b/src/Module/Contact.php index d087634e48..7ce47b9cd7 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -957,7 +957,7 @@ class Contact extends BaseModule $profiledata = Model\Contact::getDetailsByURL($contact['url']); - Model\Profile::load($a, '', 0, $profiledata, true); + Model\Profile::load($a, '', $profiledata, true); $o .= Model\Contact::getPostsFromUrl($contact['url'], true, $update); } @@ -979,7 +979,7 @@ class Contact extends BaseModule $profiledata['remoteconnect'] = DI::baseUrl() . '/follow?url=' . urlencode($profiledata['url']); } - Model\Profile::load($a, '', 0, $profiledata, true); + Model\Profile::load($a, '', $profiledata, true); $o .= Model\Contact::getPostsFromUrl($contact['url']); } diff --git a/src/Module/HoverCard.php b/src/Module/HoverCard.php index 8f4186b03b..c2b1d6b46d 100644 --- a/src/Module/HoverCard.php +++ b/src/Module/HoverCard.php @@ -21,16 +21,14 @@ class HoverCard extends BaseModule if ((local_user()) && ($parameters['action'] ?? '') === 'view') { // A logged in user views a profile of a user $nickname = $a->user['nickname']; - $profile = $parameters['profile']; } elseif (empty($parameters['action'])) { // Show the profile hovercard $nickname = $parameters['profile']; - $profile = 0; } else { throw new NotFoundException(DI::l10n()->t('No profile')); } - Profile::load($a, $nickname, $profile); + Profile::load($a, $nickname); $page = DI::page(); diff --git a/src/Module/NoScrape.php b/src/Module/NoScrape.php index 99b55f273d..c8b701e403 100644 --- a/src/Module/NoScrape.php +++ b/src/Module/NoScrape.php @@ -25,17 +25,15 @@ class NoScrape extends BaseModule if (isset($parameters['nick'])) { // Get infos about a specific nick (public) $which = $parameters['nick']; - $profile = 0; } elseif (local_user() && isset($parameters['profile']) && DI::args()->get(2) == 'view') { // view infos about a known profile (needs a login) $which = $a->user['nickname']; - $profile = $parameters['profile']; } else { System::jsonError(403, 'Authentication required'); exit(); } - Profile::load($a, $which, $profile); + Profile::load($a, $nickname); $json_info = [ 'addr' => $a->profile['addr'], From 8e2910976f126ee7c728ba4716f317ac496f377b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 27 Jan 2020 23:00:18 -0500 Subject: [PATCH 2/4] Remove usage of profile.gender --- doc/API-Entities.md | 126 -------------------------------- doc/Addons.md | 3 - doc/database/db_profile.md | 42 +++++------ doc/de/Addons.md | 3 - src/Content/ContactSelector.php | 40 ---------- src/Model/Contact.php | 4 +- src/Model/GContact.php | 2 +- src/Model/Profile.php | 2 - src/Module/Directory.php | 2 - src/Module/NoScrape.php | 2 +- 10 files changed, 25 insertions(+), 201 deletions(-) diff --git a/doc/API-Entities.md b/doc/API-Entities.md index da59de77b0..b234912acd 100644 --- a/doc/API-Entities.md +++ b/doc/API-Entities.md @@ -1181,54 +1181,6 @@ Mutually exclusive with link. - -hometown -String - - - - -gender -String - - - - -marital -String - - - - -marital_with -String - - - - -marital_since -String (Date) - - - - -sexual -String - - - - -politic -String - - - - -religion -String - - - public_keywords String @@ -1241,90 +1193,12 @@ Mutually exclusive with link. Comma-separated list of words meant to be used for search only. - -likes -String (Plaintext) - - - - -dislikes -String (Plaintext) - - - - -about -String (Plaintext) - - - - -music -String (Plaintext) - - - - -book -String (Plaintext) - - - - -tv -String (Plaintext) - - - - -film -String (Plaintext) - - - - -interest -String (Plaintext) - - - - -romance -String (Plaintext) - - - - -work -String (Plaintext) - - - - -education -String (Plaintext) - - - - -social_networks -String (Plaintext) - - - homepage String (URL) - -users -List of Contacts -If populated, only these contacts have access to the profile. - - diff --git a/doc/Addons.md b/doc/Addons.md index 171f58ff4a..bf8f9eef45 100644 --- a/doc/Addons.md +++ b/doc/Addons.md @@ -695,9 +695,6 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep- ### src/Content/ContactSelector.php Hook::callAll('network_to_name', $nets); - Hook::callAll('gender_selector', $select); - Hook::callAll('sexpref_selector', $select); - Hook::callAll('marital_selector', $select); ### src/Content/OEmbed.php diff --git a/doc/database/db_profile.md b/doc/database/db_profile.md index 265eb1c58b..6b9689d124 100644 --- a/doc/database/db_profile.md +++ b/doc/database/db_profile.md @@ -16,29 +16,29 @@ Table profile | region | | varchar(255) | NO | | | | | postal-code | | varchar(32) | NO | | | | | country-name | | varchar(255) | NO | | | | -| hometown | | varchar(255) | NO | MUL | | | -| gender | | varchar(32) | NO | | | | -| marital | | varchar(255) | NO | | | | -| with | | text | NO | | NULL | | -| howlong | | datetime | NO | | 0001-01-01 00:00:00 | | -| sexual | | varchar(255) | NO | | | | -| politic | | varchar(255) | NO | | | | -| religion | | varchar(255) | NO | | | | +| hometown | Deprecated | varchar(255) | NO | MUL | | | +| gender | Deprecated | varchar(32) | NO | | | | +| marital | Deprecated | varchar(255) | NO | | | | +| with | Deprecated | text | NO | | NULL | | +| howlong | Deprecated | datetime | NO | | 0001-01-01 00:00:00 | | +| sexual | Deprecated | varchar(255) | NO | | | | +| politic | Deprecated | varchar(255) | NO | | | | +| religion | Deprecated | varchar(255) | NO | | | | | pub_keywords | | text | NO | | NULL | | | prv_keywords | | text | NO | | NULL | | -| likes | | text | NO | | NULL | | -| dislikes | | text | NO | | NULL | | -| about | | text | NO | | NULL | | -| summary | | varchar(255) | NO | | | | -| music | | text | NO | | NULL | | -| book | | text | NO | | NULL | | -| tv | | text | NO | | NULL | | -| film | | text | NO | | NULL | | -| interest | | text | NO | | NULL | | -| romance | | text | NO | | NULL | | -| work | | text | NO | | NULL | | -| education | | text | NO | | NULL | | -| contact | | text | NO | | NULL | | +| likes | Deprecated | text | NO | | NULL | | +| dislikes | Deprecated | text | NO | | NULL | | +| about | Deprecated | text | NO | | NULL | | +| summary | Deprecated | varchar(255) | NO | | | | +| music | Deprecated | text | NO | | NULL | | +| book | Deprecated | text | NO | | NULL | | +| tv | Deprecated | text | NO | | NULL | | +| film | Deprecated | text | NO | | NULL | | +| interest | Deprecated | text | NO | | NULL | | +| romance | Deprecated | text | NO | | NULL | | +| work | Deprecated | text | NO | | NULL | | +| education | Deprecated | text | NO | | NULL | | +| contact | Deprecated | text | NO | | NULL | | | homepage | | varchar(255) | NO | | | | | photo | | varchar(255) | NO | | | | | thumb | | varchar(255) | NO | | | | diff --git a/doc/de/Addons.md b/doc/de/Addons.md index 37bf114d2a..aba36bbea4 100644 --- a/doc/de/Addons.md +++ b/doc/de/Addons.md @@ -408,9 +408,6 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap ### src/Content/ContactSelector.php Hook::callAll('network_to_name', $nets); - Hook::callAll('gender_selector', $select); - Hook::callAll('sexpref_selector', $select); - Hook::callAll('marital_selector', $select); ### src/Content/OEmbed.php diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index a9c6bc269d..64a2b5be9e 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -196,46 +196,6 @@ class ContactSelector return $network_icon; } - /** - * @param string $current optional, default empty - * @param string $suffix optionsl, default empty - * @return string - * @throws \Friendica\Network\HTTPException\InternalServerErrorException - */ - public static function gender($current = "", $suffix = "") - { - $o = ''; - $select = [ - '' => DI::l10n()->t('No answer'), - 'Male' => DI::l10n()->t('Male'), - 'Female' => DI::l10n()->t('Female'), - 'Currently Male' => DI::l10n()->t('Currently Male'), - 'Currently Female' => DI::l10n()->t('Currently Female'), - 'Mostly Male' => DI::l10n()->t('Mostly Male'), - 'Mostly Female' => DI::l10n()->t('Mostly Female'), - 'Transgender' => DI::l10n()->t('Transgender'), - 'Intersex' => DI::l10n()->t('Intersex'), - 'Transsexual' => DI::l10n()->t('Transsexual'), - 'Hermaphrodite' => DI::l10n()->t('Hermaphrodite'), - 'Neuter' => DI::l10n()->t('Neuter'), - 'Non-specific' => DI::l10n()->t('Non-specific'), - 'Other' => DI::l10n()->t('Other'), - 'Undecided' => DI::l10n()->t('Undecided'), - ]; - - Hook::callAll('gender_selector', $select); - - $o .= "'; - return $o; - } - /** * @param string $current optional, default empty * @param string $suffix optionsl, default empty diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 2014474379..112a3f3fb1 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -722,7 +722,7 @@ class Contact } $fields = ['name', 'photo', 'thumb', 'about', 'address', 'locality', 'region', - 'country-name', 'gender', 'pub_keywords', 'xmpp', 'net-publish']; + 'country-name', 'pub_keywords', 'xmpp', 'net-publish']; $profile = DBA::selectFirst('profile', $fields, ['uid' => $uid]); if (!DBA::isResult($profile)) { return; @@ -733,7 +733,7 @@ class Contact $fields = ['name' => $profile['name'], 'nick' => $user['nickname'], 'avatar-date' => $self['avatar-date'], 'location' => Profile::formatLocation($profile), 'about' => $profile['about'], 'keywords' => $profile['pub_keywords'], - 'gender' => $profile['gender'], 'contact-type' => $user['account-type'], + 'gender' => '', 'contact-type' => $user['account-type'], 'xmpp' => $profile['xmpp']]; $avatar = Photo::selectFirst(['resource-id', 'type'], ['uid' => $uid, 'profile' => true]); diff --git a/src/Model/GContact.php b/src/Model/GContact.php index f669138d76..05f20ec5b8 100644 --- a/src/Model/GContact.php +++ b/src/Model/GContact.php @@ -1117,7 +1117,7 @@ class GContact ); $gcontact = ['name' => $userdata['name'], 'location' => $location, 'about' => $userdata['about'], - 'gender' => $userdata['gender'], 'keywords' => $userdata['pub_keywords'], + 'gender' => '', 'keywords' => $userdata['pub_keywords'], 'birthday' => $userdata['dob'], 'photo' => $userdata['photo'], "notify" => $userdata['notify'], 'url' => $userdata['url'], "hide" => ($userdata['hidewall'] || !$userdata['net-publish']), diff --git a/src/Model/Profile.php b/src/Model/Profile.php index a8f3f6ac6f..0da9fbf359 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -919,7 +919,6 @@ class Profile (`profile`.`locality` LIKE ?) OR (`profile`.`region` LIKE ?) OR (`profile`.`country-name` LIKE ?) OR - (`profile`.`gender` LIKE ?) OR (`profile`.`marital` LIKE ?) OR (`profile`.`sexual` LIKE ?) OR (`profile`.`about` LIKE ?) OR @@ -961,7 +960,6 @@ class Profile (`profile`.`locality` LIKE ?) OR (`profile`.`region` LIKE ?) OR (`profile`.`country-name` LIKE ?) OR - (`profile`.`gender` LIKE ?) OR (`profile`.`marital` LIKE ?) OR (`profile`.`sexual` LIKE ?) OR (`profile`.`about` LIKE ?) OR diff --git a/src/Module/Directory.php b/src/Module/Directory.php index cc12e9dd21..54fbb01ac8 100644 --- a/src/Module/Directory.php +++ b/src/Module/Directory.php @@ -137,7 +137,6 @@ class Directory extends BaseModule $location = ''; } - $gender = (!empty($profile['gender']) ? DI::l10n()->t('Gender:') : false); $marital = (!empty($profile['marital']) ? DI::l10n()->t('Status:') : false); $homepage = (!empty($profile['homepage']) ? DI::l10n()->t('Homepage:') : false); $about = (!empty($profile['about']) ? DI::l10n()->t('About:') : false); @@ -160,7 +159,6 @@ class Directory extends BaseModule 'profile' => $profile, 'location' => $location_e, 'tags' => $contact['pub_keywords'], - 'gender' => $gender, 'pdesc' => $pdesc, 'marital' => $marital, 'homepage' => $homepage, diff --git a/src/Module/NoScrape.php b/src/Module/NoScrape.php index c8b701e403..1df049525d 100644 --- a/src/Module/NoScrape.php +++ b/src/Module/NoScrape.php @@ -103,7 +103,7 @@ class NoScrape extends BaseModule $json_info['last-activity'] = date('o-W', $last_active); //These are optional fields. - $profile_fields = ['pdesc', 'locality', 'region', 'postal-code', 'country-name', 'gender', 'marital', 'about']; + $profile_fields = ['pdesc', 'locality', 'region', 'postal-code', 'country-name', 'marital', 'about']; foreach ($profile_fields as $field) { if (!empty($a->profile[$field])) { $json_info["$field"] = $a->profile[$field]; From e69497454b062305db904a4cd4bcae3453de7a48 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 27 Jan 2020 23:01:25 -0500 Subject: [PATCH 3/4] Remove uses of profile.marital --- src/Content/ContactSelector.php | 55 ------------------- src/Model/Profile.php | 8 --- src/Module/Directory.php | 2 - src/Module/NoScrape.php | 2 +- view/templates/profile/vcard.tpl | 2 - .../duepuntozero/templates/profile/vcard.tpl | 2 - view/theme/frio/templates/profile/vcard.tpl | 7 --- .../theme/quattro/templates/profile/vcard.tpl | 2 - view/theme/vier/templates/profile/vcard.tpl | 2 - 9 files changed, 1 insertion(+), 81 deletions(-) diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index 64a2b5be9e..2fd9f61fe4 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -234,59 +234,4 @@ class ContactSelector $o .= ''; return $o; } - - /** - * @param string $current optional, default empty - * @return string - * @throws \Friendica\Network\HTTPException\InternalServerErrorException - */ - public static function maritalStatus($current = "") - { - $o = ''; - $select = [ - '' => DI::l10n()->t('No answer'), - 'Single' => DI::l10n()->t('Single'), - 'Lonely' => DI::l10n()->t('Lonely'), - 'In a relation' => DI::l10n()->t('In a relation'), - 'Has crush' => DI::l10n()->t('Has crush'), - 'Infatuated' => DI::l10n()->t('Infatuated'), - 'Dating' => DI::l10n()->t('Dating'), - 'Unfaithful' => DI::l10n()->t('Unfaithful'), - 'Sex Addict' => DI::l10n()->t('Sex Addict'), - 'Friends' => DI::l10n()->t('Friends'), - 'Friends/Benefits' => DI::l10n()->t('Friends/Benefits'), - 'Casual' => DI::l10n()->t('Casual'), - 'Engaged' => DI::l10n()->t('Engaged'), - 'Married' => DI::l10n()->t('Married'), - 'Imaginarily married' => DI::l10n()->t('Imaginarily married'), - 'Partners' => DI::l10n()->t('Partners'), - 'Cohabiting' => DI::l10n()->t('Cohabiting'), - 'Common law' => DI::l10n()->t('Common law'), - 'Happy' => DI::l10n()->t('Happy'), - 'Not looking' => DI::l10n()->t('Not looking'), - 'Swinger' => DI::l10n()->t('Swinger'), - 'Betrayed' => DI::l10n()->t('Betrayed'), - 'Separated' => DI::l10n()->t('Separated'), - 'Unstable' => DI::l10n()->t('Unstable'), - 'Divorced' => DI::l10n()->t('Divorced'), - 'Imaginarily divorced' => DI::l10n()->t('Imaginarily divorced'), - 'Widowed' => DI::l10n()->t('Widowed'), - 'Uncertain' => DI::l10n()->t('Uncertain'), - 'It\'s complicated' => DI::l10n()->t('It\'s complicated'), - 'Don\'t care' => DI::l10n()->t('Don\'t care'), - 'Ask me' => DI::l10n()->t('Ask me'), - ]; - - Hook::callAll('marital_selector', $select); - - $o .= ''; - return $o; - } } diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 0da9fbf359..ff1575695d 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -370,7 +370,6 @@ class Profile } $gender = !empty($profile['gender']) ? DI::l10n()->t('Gender:') : false; - $marital = !empty($profile['marital']) ? DI::l10n()->t('Status:') : false; $homepage = !empty($profile['homepage']) ? DI::l10n()->t('Homepage:') : false; $about = !empty($profile['about']) ? DI::l10n()->t('About:') : false; $xmpp = !empty($profile['xmpp']) ? DI::l10n()->t('XMPP:') : false; @@ -449,10 +448,6 @@ class Profile $p['gender'] = DI::l10n()->t($p['gender']); } - if (isset($p['marital'])) { - $p['marital'] = DI::l10n()->t($p['marital']); - } - if (isset($p['photo'])) { $p['photo'] = ProxyUtils::proxifyUrl($p['photo'], false, ProxyUtils::SIZE_SMALL); } @@ -474,7 +469,6 @@ class Profile '$account_type' => $account_type, '$location' => $location, '$gender' => $gender, - '$marital' => $marital, '$homepage' => $homepage, '$about' => $about, '$network' => DI::l10n()->t('Network:'), @@ -919,7 +913,6 @@ class Profile (`profile`.`locality` LIKE ?) OR (`profile`.`region` LIKE ?) OR (`profile`.`country-name` LIKE ?) OR - (`profile`.`marital` LIKE ?) OR (`profile`.`sexual` LIKE ?) OR (`profile`.`about` LIKE ?) OR (`profile`.`romance` LIKE ?) OR @@ -960,7 +953,6 @@ class Profile (`profile`.`locality` LIKE ?) OR (`profile`.`region` LIKE ?) OR (`profile`.`country-name` LIKE ?) OR - (`profile`.`marital` LIKE ?) OR (`profile`.`sexual` LIKE ?) OR (`profile`.`about` LIKE ?) OR (`profile`.`romance` LIKE ?) OR diff --git a/src/Module/Directory.php b/src/Module/Directory.php index 54fbb01ac8..7a6b65cf78 100644 --- a/src/Module/Directory.php +++ b/src/Module/Directory.php @@ -137,7 +137,6 @@ class Directory extends BaseModule $location = ''; } - $marital = (!empty($profile['marital']) ? DI::l10n()->t('Status:') : false); $homepage = (!empty($profile['homepage']) ? DI::l10n()->t('Homepage:') : false); $about = (!empty($profile['about']) ? DI::l10n()->t('About:') : false); @@ -160,7 +159,6 @@ class Directory extends BaseModule 'location' => $location_e, 'tags' => $contact['pub_keywords'], 'pdesc' => $pdesc, - 'marital' => $marital, 'homepage' => $homepage, 'about' => $about, 'photo_menu' => $photo_menu, diff --git a/src/Module/NoScrape.php b/src/Module/NoScrape.php index 1df049525d..07ecf23d8a 100644 --- a/src/Module/NoScrape.php +++ b/src/Module/NoScrape.php @@ -103,7 +103,7 @@ class NoScrape extends BaseModule $json_info['last-activity'] = date('o-W', $last_active); //These are optional fields. - $profile_fields = ['pdesc', 'locality', 'region', 'postal-code', 'country-name', 'marital', 'about']; + $profile_fields = ['pdesc', 'locality', 'region', 'postal-code', 'country-name', 'about']; foreach ($profile_fields as $field) { if (!empty($a->profile[$field])) { $json_info["$field"] = $a->profile[$field]; diff --git a/view/templates/profile/vcard.tpl b/view/templates/profile/vcard.tpl index 1ee3302669..826074a313 100644 --- a/view/templates/profile/vcard.tpl +++ b/view/templates/profile/vcard.tpl @@ -43,8 +43,6 @@ {{if $updated}}{{/if}} - {{if $marital}}
{{$marital}}
{{$profile.marital}}
{{/if}} - {{if $homepage}}
{{$homepage}}
{{$profile.homepage}}
{{/if}} {{if $about}}
{{$about}}
{{$profile.about nofilter}}
{{/if}} diff --git a/view/theme/duepuntozero/templates/profile/vcard.tpl b/view/theme/duepuntozero/templates/profile/vcard.tpl index 3c933c8333..4a835961b6 100644 --- a/view/theme/duepuntozero/templates/profile/vcard.tpl +++ b/view/theme/duepuntozero/templates/profile/vcard.tpl @@ -30,8 +30,6 @@ {{if $profile.pubkey}}{{/if}} - {{if $marital}}
{{$marital}}
{{$profile.marital}}
{{/if}} - {{if $homepage}}
{{$homepage}}
{{$profile.homepage}}
{{/if}} {{include file="diaspora_vcard.tpl"}} diff --git a/view/theme/frio/templates/profile/vcard.tpl b/view/theme/frio/templates/profile/vcard.tpl index 1673a9c999..5ac982fa25 100644 --- a/view/theme/frio/templates/profile/vcard.tpl +++ b/view/theme/frio/templates/profile/vcard.tpl @@ -115,13 +115,6 @@ {{if $updated}}{{/if}} - {{if $marital}} -
- - {{$profile.marital}} -
- {{/if}} - {{if $homepage}}
diff --git a/view/theme/quattro/templates/profile/vcard.tpl b/view/theme/quattro/templates/profile/vcard.tpl index fd455fba58..5e7b3efc86 100644 --- a/view/theme/quattro/templates/profile/vcard.tpl +++ b/view/theme/quattro/templates/profile/vcard.tpl @@ -49,8 +49,6 @@ {{if $profile.pubkey}}{{/if}} - {{if $marital}}
{{$marital}}
{{$profile.marital}}
{{/if}} - {{if $homepage}}
{{$homepage}}
{{$profile.homepage}}
diff --git a/view/theme/vier/templates/profile/vcard.tpl b/view/theme/vier/templates/profile/vcard.tpl index 6331e84c4e..7511988cba 100644 --- a/view/theme/vier/templates/profile/vcard.tpl +++ b/view/theme/vier/templates/profile/vcard.tpl @@ -54,8 +54,6 @@ {{if $updated}}{{/if}} - {{if $marital}}
{{$marital}}
{{$profile.marital}}
{{/if}} - {{if $homepage}}
{{$homepage}}
{{$profile.homepage}}
{{/if}} {{if $about}}
{{$about}}
{{$profile.about nofilter}}
{{/if}} From 7b0ec6252f1169427068a25bd8655c573af04abc Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 27 Jan 2020 23:05:57 -0500 Subject: [PATCH 4/4] Remove uses of the rest of deprecated profile fields --- src/Content/ContactSelector.php | 45 +------ src/Model/Contact.php | 2 +- src/Model/Profile.php | 10 -- src/Module/Directory.php | 2 - src/Module/NoScrape.php | 2 +- src/Network/Probe.php | 3 - view/templates/settings/profile/index.tpl | 2 +- view/theme/duepuntozero/style.css | 137 +--------------------- view/theme/quattro/dark/style.css | 16 --- view/theme/quattro/green/style.css | 16 --- view/theme/quattro/lilac/style.css | 16 --- view/theme/quattro/quattro.less | 16 --- view/theme/smoothly/style.css | 21 ---- 13 files changed, 10 insertions(+), 278 deletions(-) diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index 2fd9f61fe4..38227bc6e2 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -19,7 +19,7 @@ class ContactSelector /** * @param string $current current * @param boolean $disabled optional, default false - * @return object + * @return string */ public static function pollInterval($current, $disabled = false) { @@ -47,7 +47,7 @@ class ContactSelector /** * @param string $profile Profile URL * @return string Server URL - * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws \Exception */ private static function getServerURLForProfile($profile) { @@ -147,7 +147,7 @@ class ContactSelector * @param string $network network * @param string $profile optional, default empty * @return string - * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws \Exception */ public static function networkToIcon($network, $profile = "") { @@ -195,43 +195,4 @@ class ContactSelector return $network_icon; } - - /** - * @param string $current optional, default empty - * @param string $suffix optionsl, default empty - * @return string - * @throws \Friendica\Network\HTTPException\InternalServerErrorException - */ - public static function sexualPreference($current = "", $suffix = "") - { - $o = ''; - $select = [ - '' => DI::l10n()->t('No answer'), - 'Males' => DI::l10n()->t('Males'), - 'Females' => DI::l10n()->t('Females'), - 'Gay' => DI::l10n()->t('Gay'), - 'Lesbian' => DI::l10n()->t('Lesbian'), - 'No Preference' => DI::l10n()->t('No Preference'), - 'Bisexual' => DI::l10n()->t('Bisexual'), - 'Autosexual' => DI::l10n()->t('Autosexual'), - 'Abstinent' => DI::l10n()->t('Abstinent'), - 'Virgin' => DI::l10n()->t('Virgin'), - 'Deviant' => DI::l10n()->t('Deviant'), - 'Fetish' => DI::l10n()->t('Fetish'), - 'Oodles' => DI::l10n()->t('Oodles'), - 'Nonsexual' => DI::l10n()->t('Nonsexual'), - ]; - - Hook::callAll('sexpref_selector', $select); - - $o .= "'; - return $o; - } } diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 112a3f3fb1..7b43145856 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -721,7 +721,7 @@ class Contact return; } - $fields = ['name', 'photo', 'thumb', 'about', 'address', 'locality', 'region', + $fields = ['name', 'photo', 'thumb', 'pdesc' => 'about', 'address', 'locality', 'region', 'country-name', 'pub_keywords', 'xmpp', 'net-publish']; $profile = DBA::selectFirst('profile', $fields, ['uid' => $uid]); if (!DBA::isResult($profile)) { diff --git a/src/Model/Profile.php b/src/Model/Profile.php index ff1575695d..caf0b0869d 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -913,11 +913,6 @@ class Profile (`profile`.`locality` LIKE ?) OR (`profile`.`region` LIKE ?) OR (`profile`.`country-name` LIKE ?) OR - (`profile`.`sexual` LIKE ?) OR - (`profile`.`about` LIKE ?) OR - (`profile`.`romance` LIKE ?) OR - (`profile`.`work` LIKE ?) OR - (`profile`.`education` LIKE ?) OR (`profile`.`pub_keywords` LIKE ?) OR (`profile`.`prv_keywords` LIKE ?))", $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm, @@ -953,11 +948,6 @@ class Profile (`profile`.`locality` LIKE ?) OR (`profile`.`region` LIKE ?) OR (`profile`.`country-name` LIKE ?) OR - (`profile`.`sexual` LIKE ?) OR - (`profile`.`about` LIKE ?) OR - (`profile`.`romance` LIKE ?) OR - (`profile`.`work` LIKE ?) OR - (`profile`.`education` LIKE ?) OR (`profile`.`pub_keywords` LIKE ?) OR (`profile`.`prv_keywords` LIKE ?)) $order LIMIT ?,?", diff --git a/src/Module/Directory.php b/src/Module/Directory.php index 7a6b65cf78..8335fb0cd4 100644 --- a/src/Module/Directory.php +++ b/src/Module/Directory.php @@ -138,7 +138,6 @@ class Directory extends BaseModule } $homepage = (!empty($profile['homepage']) ? DI::l10n()->t('Homepage:') : false); - $about = (!empty($profile['about']) ? DI::l10n()->t('About:') : false); $location_e = $location; @@ -160,7 +159,6 @@ class Directory extends BaseModule 'tags' => $contact['pub_keywords'], 'pdesc' => $pdesc, 'homepage' => $homepage, - 'about' => $about, 'photo_menu' => $photo_menu, ]; diff --git a/src/Module/NoScrape.php b/src/Module/NoScrape.php index 07ecf23d8a..2a705ff6ea 100644 --- a/src/Module/NoScrape.php +++ b/src/Module/NoScrape.php @@ -103,7 +103,7 @@ class NoScrape extends BaseModule $json_info['last-activity'] = date('o-W', $last_active); //These are optional fields. - $profile_fields = ['pdesc', 'locality', 'region', 'postal-code', 'country-name', 'about']; + $profile_fields = ['pdesc', 'locality', 'region', 'postal-code', 'country-name']; foreach ($profile_fields as $field) { if (!empty($a->profile[$field])) { $json_info["$field"] = $a->profile[$field]; diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 4cd32b91ae..91d894d2ee 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -833,9 +833,6 @@ class Probe if (!empty($profile['country'])) { $loc['country-name'] = $profile['country']; } - if (!empty($profile['hometown'])) { - $loc['locality'] = $profile['hometown']; - } $location = Profile::formatLocation($loc); if (!empty($location)) { $data['location'] = $location; diff --git a/view/templates/settings/profile/index.tpl b/view/templates/settings/profile/index.tpl index bf98bb1587..c55928127e 100644 --- a/view/templates/settings/profile/index.tpl +++ b/view/templates/settings/profile/index.tpl @@ -64,7 +64,7 @@
-
+
diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 3e8151c5ac..b30a7d4ed8 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -733,21 +733,15 @@ input#dfrn-url { #profile-edit-profile-name-label, #profile-edit-name-label, #profile-edit-pdesc-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, #profile-edit-pubkeywords-label, #profile-edit-prvkeywords-label, -#profile-edit-homepage-label, -#profile-edit-hometown-label { +#profile-edit-homepage-label { float: left; width: 175px; } @@ -755,17 +749,12 @@ input#dfrn-url { #profile-edit-profile-name, #profile-edit-name, #profile-edit-pdesc, -#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, #profile-edit-pubkeywords, #profile-edit-prvkeywords, #profile-in-dir-yes, @@ -842,7 +831,7 @@ input#dfrn-url { } -#profile-edit-homepage, #profile-edit-hometown { +#profile-edit-homepage { float: left; margin-bottom: 35px; } @@ -865,24 +854,17 @@ input#dfrn-url { margin-bottom: 20px } -#profile-edit-profile-name-end, #profile-edit-name-end, #profile-edit-pdesc-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, #profile-edit-pubkeywords-end, #profile-edit-prvkeywords-end, #profile-edit-homepage-end, -#profile-edit-hometown-end, #profile-in-dir-break, #profile-in-dir-end, #profile-in-netdir-break, @@ -909,10 +891,6 @@ input#dfrn-url { } -#gender-select, #marital-select, #sexual-select { - width: 220px; -} - #profile-edit-profile-name-wrapper .required { color: #FF0000; float: left; @@ -1589,113 +1567,6 @@ blockquote.shared_content { } -#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, -#advanced-profile-religion-wrapper, -#advanced-profile-about-wrapper, -#advanced-profile-interest-wrapper, -#advanced-profile-contact-wrapper, -#advanced-profile-music-wrapper, -#advanced-profile-book-wrapper, -#advanced-profile-tv-wrapper, -#advanced-profile-film-wrapper, -#advanced-profile-romance-wrapper, -#advanced-profile-work-wrapper, -#advanced-profile-education-wrapper { - margin-top: 20px; -} - -#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, -#advanced-profile-religion-text, -#advanced-profile-about-text, -#advanced-profile-interest-text, -#advanced-profile-contact-text, -#advanced-profile-music-text, -#advanced-profile-book-text, -#advanced-profile-tv-text, -#advanced-profile-film-text, -#advanced-profile-romance-text, -#advanced-profile-work-text, -#advanced-profile-education-text { - width: 300px; - float: left; -} - -#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, -#advanced-profile-religion-end { - height: 10px; -} - -#advanced-profile-about-end, -#advanced-profile-interest-end, -#advanced-profile-contact-end, -#advanced-profile-music-end, -#advanced-profile-book-end, -#advanced-profile-tv-end, -#advanced-profile-film-end, -#advanced-profile-romance-end, -#advanced-profile-work-end, -#advanced-profile-education-end { - - -} - -#advanced-profile-name, -#advanced-profile-gender, -#advanced-profile-dob, -#advanced-profile-age, -#advanced-profile-marital, -#advanced-profile-sexual, -#advanced-profile-homepage, -#advanced-profile-politic, -#advanced-profile-religion { - float: left; - -} - - -#advanced-profile-about, -#advanced-profile-interest, -#advanced-profile-contact, -#advanced-profile-music, -#advanced-profile-book, -#advanced-profile-tv, -#advanced-profile-film, -#advanced-profile-romance, -#advanced-profile-work, -#advanced-profile-education { - margin-top: 10px; - margin-left: 50px; - margin-right: 20px; - padding: 10px; - border: 1px solid #CCCCCC; -} - -#advanced-profile-with { - float: left; - margin-left: 15px; -} - #contact-edit-wrapper { margin-top: 10px; } @@ -2446,14 +2317,14 @@ aside input[type='text'] { margin-bottom: 25px; } -.location-label, .gender-label, .marital-label, .homepage-label, .network-label { +.location-label, .gender-label, .homepage-label, .network-label { float: left; text-align: right; display: block; width: 65px; } -.adr, .x-gender, .marital-text, .homepage-url, .x-network { +.adr, .homepage-url, .x-network { float: left; display: block; margin-left: 8px; diff --git a/view/theme/quattro/dark/style.css b/view/theme/quattro/dark/style.css index 64e4840e86..5f9e233c98 100644 --- a/view/theme/quattro/dark/style.css +++ b/view/theme/quattro/dark/style.css @@ -1973,45 +1973,29 @@ ul.tabs li .active { background-color: #FFEEEE; padding: 7px; } -#profile-edit-profile-name-label, #profile-edit-name-label, #profile-edit-pdesc-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-with-label, -#profile-edit-sexual-label, -#profile-edit-politic-label, -#profile-edit-religion-label, #profile-edit-pubkeywords-label, #profile-edit-prvkeywords-label, -#profile-edit-gender-select, #profile-edit-homepage-label { float: left; width: 175px; padding-top: 7px; } -#profile-edit-profile-name, #profile-edit-name, -#gender-select, #profile-edit-pdesc, -#profile-edit-gender, #profile-edit-dob, #profile-edit-address, #profile-edit-locality, #profile-edit-region, #profile-edit-postal-code, #profile-edit-country-name, -#profile-edit-marital, -#profile-edit-with, -#profile-edit-sexual, -#profile-edit-politic, -#profile-edit-religion, #profile-edit-pubkeywords, #profile-edit-prvkeywords, #profile-edit-homepage { diff --git a/view/theme/quattro/green/style.css b/view/theme/quattro/green/style.css index 40a0c71617..81a30cf088 100644 --- a/view/theme/quattro/green/style.css +++ b/view/theme/quattro/green/style.css @@ -1973,45 +1973,29 @@ ul.tabs li .active { background-color: #FFEEEE; padding: 7px; } -#profile-edit-profile-name-label, #profile-edit-name-label, #profile-edit-pdesc-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-with-label, -#profile-edit-sexual-label, -#profile-edit-politic-label, -#profile-edit-religion-label, #profile-edit-pubkeywords-label, #profile-edit-prvkeywords-label, -#profile-edit-gender-select, #profile-edit-homepage-label { float: left; width: 175px; padding-top: 7px; } -#profile-edit-profile-name, #profile-edit-name, -#gender-select, #profile-edit-pdesc, -#profile-edit-gender, #profile-edit-dob, #profile-edit-address, #profile-edit-locality, #profile-edit-region, #profile-edit-postal-code, #profile-edit-country-name, -#profile-edit-marital, -#profile-edit-with, -#profile-edit-sexual, -#profile-edit-politic, -#profile-edit-religion, #profile-edit-pubkeywords, #profile-edit-prvkeywords, #profile-edit-homepage { diff --git a/view/theme/quattro/lilac/style.css b/view/theme/quattro/lilac/style.css index 16887f1e6a..7585877ae2 100644 --- a/view/theme/quattro/lilac/style.css +++ b/view/theme/quattro/lilac/style.css @@ -1973,45 +1973,29 @@ ul.tabs li .active { background-color: #FFEEEE; padding: 7px; } -#profile-edit-profile-name-label, #profile-edit-name-label, #profile-edit-pdesc-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-with-label, -#profile-edit-sexual-label, -#profile-edit-politic-label, -#profile-edit-religion-label, #profile-edit-pubkeywords-label, #profile-edit-prvkeywords-label, -#profile-edit-gender-select, #profile-edit-homepage-label { float: left; width: 175px; padding-top: 7px; } -#profile-edit-profile-name, #profile-edit-name, -#gender-select, #profile-edit-pdesc, -#profile-edit-gender, #profile-edit-dob, #profile-edit-address, #profile-edit-locality, #profile-edit-region, #profile-edit-postal-code, #profile-edit-country-name, -#profile-edit-marital, -#profile-edit-with, -#profile-edit-sexual, -#profile-edit-politic, -#profile-edit-religion, #profile-edit-pubkeywords, #profile-edit-prvkeywords, #profile-edit-homepage { diff --git a/view/theme/quattro/quattro.less b/view/theme/quattro/quattro.less index ce5c038d7d..5f435241c9 100644 --- a/view/theme/quattro/quattro.less +++ b/view/theme/quattro/quattro.less @@ -1267,45 +1267,29 @@ ul.tabs { background-color: #FFEEEE; padding: 7px; } -#profile-edit-profile-name-label, #profile-edit-name-label, #profile-edit-pdesc-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-with-label, -#profile-edit-sexual-label, -#profile-edit-politic-label, -#profile-edit-religion-label, #profile-edit-pubkeywords-label, #profile-edit-prvkeywords-label, -#profile-edit-gender-select, #profile-edit-homepage-label { float: left; width: 175px; padding-top: 7px; } -#profile-edit-profile-name, #profile-edit-name, -#gender-select, #profile-edit-pdesc, -#profile-edit-gender, #profile-edit-dob, #profile-edit-address, #profile-edit-locality, #profile-edit-region, #profile-edit-postal-code, #profile-edit-country-name, -#profile-edit-marital, -#profile-edit-with, -#profile-edit-sexual, -#profile-edit-politic, -#profile-edit-religion, #profile-edit-pubkeywords, #profile-edit-prvkeywords, #profile-edit-homepage { diff --git a/view/theme/smoothly/style.css b/view/theme/smoothly/style.css index 52324c0a97..081f1710a9 100644 --- a/view/theme/smoothly/style.css +++ b/view/theme/smoothly/style.css @@ -2046,20 +2046,6 @@ pre code { /* = Profile = */ /* =========== */ -.advanced-profile-content { - margin-top: 5px; - margin-bottom: 10px; - margin-left: 30px; - width: 60%; -} - -.advanced-profile-label { - margin-top: 10px; - margin-bottom: 0px; - padding-bottom: 5px; - font-size: 18px; -} - div[id$="wrapper"] { height: 100%; } @@ -2068,10 +2054,6 @@ div[id$="wrapper"] br { clear: left; } -#advanced-profile-with { - margin-left: 20px; -} - #profile-listing-desc, #profile-listing-new-link-wrapper { float: left; @@ -4524,7 +4506,6 @@ hr.line-dots { .location, .location-label, .gender-label, -.marital-label, .homepage-label, .network-label { float: left; @@ -4534,8 +4515,6 @@ hr.line-dots { } .adr, -.x-gender, -.marital-text, .homepage-url, .x-network { float: left;