$tz = 'UTC';
}
- $profile = DBA::selectFirst('profile', ['dob'], ['is-default' => true, 'uid' => $uid]);
+ $profile = DBA::selectFirst('profile', ['dob'], ['uid' => $uid]);
if (DBA::isResult($profile)) {
$tmp_dob = substr($profile['dob'], 5);
if (intval($tmp_dob)) {
if ($nickname != $a->user["nickname"]) {
$profile = DBA::fetchFirst("SELECT `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
- WHERE `user`.`nickname` = ? AND `profile`.`is-default` AND `contact`.`self` LIMIT 1",
+ WHERE `user`.`nickname` = ? AND `contact`.`self` LIMIT 1",
$nickname
);
if (DBA::isResult($profile)) {
"SELECT COUNT(*) AS `total`
FROM `profile`
JOIN `user` ON `user`.`uid` = `profile`.`uid`
- WHERE `is-default` = 1
- AND `user`.`hidewall` = 0
+ WHERE `user`.`hidewall` = 0
AND MATCH(`pub_keywords`) AGAINST (?)",
$search
);
"SELECT `pub_keywords`, `username`, `nickname`, `user`.`uid`
FROM `user`
JOIN `profile` ON `user`.`uid` = `profile`.`uid`
- WHERE `is-default` = 1
- AND `user`.`hidewall` = 0
+ WHERE `user`.`hidewall` = 0
AND MATCH(`pub_keywords`) AGAINST (?)
LIMIT ?, ?",
$search,
if (! $system_mode && ! $global) {
$users = q("SELECT `user`.*,`profile`.`hide-friends` from user left join profile on `user`.`uid` = `profile`.`uid`
- where `user`.`nickname` = '%s' and `profile`.`is-default` = 1 limit 1",
+ where `user`.`nickname` = '%s' limit 1",
DBA::escape($nickname)
);
if (! DBA::isResult($users) || $users[0]['hidewall'] || $users[0]['hide-friends']) {
`profile`.`postal-code` AS `ppostalcode`, `profile`.`country-name` AS `pcountry`, `user`.`account-type`
FROM `contact` INNER JOIN `profile` ON `profile`.`uid` = `contact`.`uid`
INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
- WHERE `self` = 1 AND `profile`.`is-default`
+ WHERE `self` = 1
AND `contact`.`uid` IN (SELECT `uid` FROM `pconfig` WHERE `cat` = 'system' AND `k` = 'suggestme' AND `v` = 1) LIMIT %d, %d",
intval($startIndex),
intval($itemsPerPage)
DBA::update('user', ['blocked' => false, 'verified' => true], ['uid' => $register['uid']]);
- $profile = DBA::selectFirst('profile', ['net-publish'], ['uid' => $register['uid'], 'is-default' => true]);
+ $profile = DBA::selectFirst('profile', ['net-publish'], ['uid' => $register['uid']]);
if (DBA::isResult($profile) && $profile['net-publish'] && DI::config()->get('system', 'directory')) {
$url = DI::baseUrl() . '/profile/' . $user['nickname'];
`name` = '%s',
`net-publish` = %d,
`hide-friends` = %d
- WHERE `is-default` = 1 AND `uid` = %d",
+ WHERE `uid` = %d",
intval($publish),
DBA::escape($username),
intval($net_publish),
* ACCOUNT SETTINGS
*/
- $profile = DBA::selectFirst('profile', [], ['is-default' => true, 'uid' => local_user()]);
+ $profile = DBA::selectFirst('profile', [], ['uid' => local_user()]);
if (!DBA::isResult($profile)) {
notice(DI::l10n()->t('Unable to find your profile. Please contact your admin.') . EOL);
return;
$fields = ['name', 'photo', 'thumb', 'about', 'address', 'locality', 'region',
'country-name', 'gender', 'pub_keywords', 'xmpp', 'net-publish'];
- $profile = DBA::selectFirst('profile', $fields, ['uid' => $uid, 'is-default' => true]);
+ $profile = DBA::selectFirst('profile', $fields, ['uid' => $uid]);
if (!DBA::isResult($profile)) {
return;
}
// Update the profile
$fields = ['photo' => DI::baseUrl() . '/photo/profile/' .$uid . '.' . $file_suffix,
'thumb' => DI::baseUrl() . '/photo/avatar/' . $uid .'.' . $file_suffix];
- DBA::update('profile', $fields, ['uid' => $uid, 'is-default' => true]);
+ DBA::update('profile', $fields, ['uid' => $uid]);
}
}
*/
public static function getByUID($uid)
{
- $profile = DBA::selectFirst('profile', [], ['uid' => $uid, 'is-default' => true]);
- return $profile;
+ return DBA::selectFirst('profile', [], ['uid' => $uid]);
}
/**
}
}
- $profile = self::getByNickname($nickname, $user['uid'], $profile_id);
+ $profile = self::getByNickname($nickname, $user['uid']);
if (empty($profile) && empty($profiledata)) {
Logger::log('profile error: ' . DI::args()->getQueryString(), Logger::DEBUG);
}
if (empty($profile)) {
- $profile = ['uid' => 0, 'is-default' => false,'name' => $nickname];
- }
-
- // fetch user tags if this isn't the default profile
-
- if (!$profile['is-default']) {
- $condition = ['uid' => $profile['uid'], 'is-default' => true];
- $profile_id = DBA::selectFirst('profile', ['pub_keywords'], $condition);
- if (DBA::isResult($profile_id)) {
- $profile['pub_keywords'] = $profile_id['pub_keywords'];
- }
+ $profile = ['uid' => 0, 'name' => $nickname];
}
$a->profile = $profile;
*/
public static function searchProfiles($start = 0, $count = 100, $search = null)
{
- $publish = (DI::config()->get('system', 'publish_all') ? '' : " AND `publish` = 1 ");
+ $publish = (DI::config()->get('system', 'publish_all') ? '' : "`publish` = 1");
$total = 0;
if (!empty($search)) {
$cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total`
FROM `profile`
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
- WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed`
+ WHERE $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed`
AND ((`profile`.`name` LIKE ?) OR
(`user`.`nickname` LIKE ?) OR
(`profile`.`pdesc` LIKE ?) OR
$cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total`
FROM `profile`
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
- WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed`");
+ WHERE $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed`");
}
if (DBA::isResult($cnt)) {
FROM `profile`
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
LEFT JOIN `contact` ON `contact`.`uid` = `user`.`uid`
- WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `contact`.`self`
+ WHERE $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `contact`.`self`
AND ((`profile`.`name` LIKE ?) OR
(`user`.`nickname` LIKE ?) OR
(`profile`.`pdesc` LIKE ?) OR
FROM `profile`
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
LEFT JOIN `contact` ON `contact`.`uid` = `user`.`uid`
- WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `contact`.`self`
+ WHERE $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `contact`.`self`
$order LIMIT ?,?",
$start, $count
);
'photo' => DI::baseUrl() . "/photo/profile/{$uid}.jpg",
'thumb' => DI::baseUrl() . "/photo/avatar/{$uid}.jpg",
'publish' => $publish,
- 'is-default' => 1,
'net-publish' => $netpublish,
- 'profile-name' => DI::l10n()->t('default')
]);
if (!$insert_result) {
DBA::delete('user', ['uid' => $uid]);
$userStmt = DBA::p("SELECT `user`.`uid`, `user`.`login_date`, `contact`.`last-item`
FROM `user`
- INNER JOIN `profile` ON `profile`.`uid` = `user`.`uid` AND `profile`.`is-default`
+ INNER JOIN `profile` ON `profile`.`uid` = `user`.`uid`
INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self`
WHERE (`profile`.`publish` OR `profile`.`net-publish`) AND `user`.`verified`
AND NOT `user`.`blocked` AND NOT `user`.`account_removed`
'prv_keywords' => $prv_keywords,
'hide-friends' => $hide_friends,
],
- [
- 'uid' => local_user(),
- 'is-default' => true,
- ]
+ ['uid' => local_user()]
);
if ($result) {
}
$fields = ['locality', 'region', 'country-name'];
- $profile = DBA::selectFirst('profile', $fields, ['uid' => $uid, 'is-default' => true]);
+ $profile = DBA::selectFirst('profile', $fields, ['uid' => $uid]);
if (!DBA::isResult($profile)) {
return [];
}
`profile`.`pub_keywords`, `profile`.`xmpp`, `profile`.`dob`
FROM `profile`
INNER JOIN `user` ON `user`.`uid` = `profile`.`uid`
- WHERE `profile`.`is-default` AND NOT `user`.`hidewall` AND `user`.`uid` = %d",
+ WHERE NOT `user`.`hidewall` AND `user`.`uid` = %d",
intval($owner['uid'])
);
if (DBA::isResult($r)) {
FROM `profile`
INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
INNER JOIN `contact` ON `profile`.`uid` = `contact`.`uid`
- WHERE `user`.`uid` = %d AND `profile`.`is-default` AND `contact`.`self` LIMIT 1",
+ WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
intval($uid)
);
*/
private static function addAuthor(DOMDocument $doc, array $owner, $show_profile = true)
{
- $profile = DBA::selectFirst('profile', ['homepage', 'publish'], ['uid' => $owner['uid'], 'is-default' => true]);
+ $profile = DBA::selectFirst('profile', ['homepage', 'publish'], ['uid' => $owner['uid']]);
$author = $doc->createElement("author");
XML::addElement($doc, $author, "id", $owner["url"]);
if ($owner['account-type'] == User::ACCOUNT_TYPE_COMMUNITY) {
$r = q("SELECT `url` FROM `contact`
INNER JOIN `profile` ON `profile`.`uid` = `contact`.`uid`
INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
- WHERE `contact`.`self` AND `profile`.`net-publish` AND `profile`.`is-default` AND
+ WHERE `contact`.`self` AND `profile`.`net-publish` AND
NOT `user`.`account_expired` AND `user`.`verified`");
if (DBA::isResult($r)) {
// last 9 users
if ($show_lastusers) {
- $publish = (DI::config()->get('system', 'publish_all') ? '' : " AND `publish` = 1 ");
+ $publish = (DI::config()->get('system', 'publish_all') ? '' : "`publish` = 1");
$order = " ORDER BY `register_date` DESC ";
$tpl = Renderer::getMarkupTemplate('ch_directory_item.tpl');
$r = q("SELECT `profile`.*, `user`.`nickname`
FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
- WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $order LIMIT %d , %d ",
+ WHERE $publish AND `user`.`blocked` = 0 $order LIMIT %d , %d ",
0,
9
);