- // move every contact using this profile as their default to the user default
-
- q("UPDATE `contact` SET `profile-id` = (SELECT `profile`.`id` AS `profile-id` FROM `profile` WHERE `profile`.`is-default` = 1 AND `profile`.`uid` = %d LIMIT 1) WHERE `profile-id` = %d AND `uid` = %d ",
- intval(local_user()),
- intval($a->argv[2]),
- intval(local_user())
- );
- q("DELETE FROM `profile` WHERE `id` = %d AND `uid` = %d",
- intval($a->argv[2]),
- intval(local_user())
- );
- if (DBA::isResult($r)) {
- info(DI::l10n()->t('Profile deleted.').EOL);
- }
-
- DI::baseUrl()->redirect('profiles');
- return; // NOTREACHED
- }
-
- if (($a->argc > 1) && ($a->argv[1] === 'new')) {
- '$default' => (($is_default) ? '<p id="profile-edit-default-desc">' . DI::l10n()->t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>' : ""),
- '$name' => ['name', DI::l10n()->t('Your Full Name:'), $r[0]['name']],
- '$about' => ['about', DI::l10n()->t('Tell us about yourself...'), $r[0]['about']],
- '$xmpp' => ['xmpp', DI::l10n()->t("XMPP \x28Jabber\x29 address:"), $r[0]['xmpp'], DI::l10n()->t("The XMPP address will be propagated to your contacts so that they can follow you.")],
- '$pub_keywords' => ['pub_keywords', DI::l10n()->t('Public Keywords:'), $r[0]['pub_keywords'], DI::l10n()->t("\x28Used for suggesting potential friends, can be seen by others\x29")],
- '$prv_keywords' => ['prv_keywords', DI::l10n()->t('Private Keywords:'), $r[0]['prv_keywords'], DI::l10n()->t("\x28Used for searching profiles, never shown to others\x29")],
- "SELECT DISTINCT(`parent-uri`) AS `uri`, `item`.`created`
- FROM `item`
- INNER JOIN `contact`
- ON `contact`.`id` = `item`.`contact-id`
- AND NOT `contact`.`blocked`
- AND NOT `contact`.`pending`
- WHERE `item`.`uid` = ?
- AND `item`.`visible`
- AND (NOT `item`.`deleted` OR `item`.`gravity` = ?)
- AND NOT `item`.`moderated`
- AND `item`.`wall`
- $sql_extra4
- $sql_extra
- ORDER BY `item`.`received` DESC",
- $a->profile['uid'],
- GRAVITY_ACTIVITY
- );
-
- if (!DBA::isResult($items_stmt)) {
- return '';
- }
-
- $pager = new Pager(DI::args()->getQueryString());
- } else {
- $sql_post_table = "";
-
- if (!empty($category)) {
- $sql_post_table = sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
- $sql_post_table .= sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
+ $sql_post_table = sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
+ $sql_post_table .= sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
+ '$default' => '<p id="profile-edit-default-desc">' . DI::l10n()->t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>',
+ '$about' => ['about', DI::l10n()->t('Tell us about yourself...'), $profile['about']],
+ '$xmpp' => ['xmpp', DI::l10n()->t('XMPP (Jabber) address:'), $profile['xmpp'], DI::l10n()->t('The XMPP address will be propagated to your contacts so that they can follow you.')],
+ '$pub_keywords' => ['pub_keywords', DI::l10n()->t('Public Keywords:'), $profile['pub_keywords'], DI::l10n()->t('(Used for suggesting potential friends, can be seen by others)')],
+ '$prv_keywords' => ['prv_keywords', DI::l10n()->t('Private Keywords:'), $profile['prv_keywords'], DI::l10n()->t('(Used for searching profiles, never shown to others)')],