Review updates

Update function name, descriptive variable names.
This commit is contained in:
Adam Magness 2018-01-14 23:44:39 -05:00
commit 430bd7c6ac
8 changed files with 29 additions and 25 deletions

View file

@ -33,14 +33,14 @@ function allfriends_content(App $a)
$uid = $a->user['uid'];
$c = dba::selectFirst('contact', ['name', 'url', 'photo'], ['id' => $cid, 'uid' => local_user()]);
$contact = dba::selectFirst('contact', ['name', 'url', 'photo'], ['id' => $cid, 'uid' => local_user()]);
if (!DBM::is_result($c)) {
if (!DBM::is_result($contact)) {
return;
}
$a->page['aside'] = "";
Profile::load($a, "", 0, Contact::getDetailsByURL($c[0]["url"]));
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
$total = GContact::countAllFriends(local_user(), $cid);

View file

@ -45,7 +45,7 @@ function cal_init(App $a)
return;
}
$profile = Profile::getProfiledataByNick($nick, $a->profile_uid);
$profile = Profile::getByNickname($nick, $a->profile_uid);
$account_type = Contact::getAccountType($profile);

View file

@ -36,19 +36,19 @@ function common_content(App $a)
}
if ($cmd === 'loc' && $cid) {
$c = dba::selectFirst('contact', ['name', 'url', 'photo'], ['id' => $cid, 'uid' => $uid]);
$contact = dba::selectFirst('contact', ['name', 'url', 'photo'], ['id' => $cid, 'uid' => $uid]);
if (DBM::is_result($c)) {
if (DBM::is_result($contact)) {
$a->page['aside'] = "";
Profile::load($a, "", 0, Contact::getDetailsByURL($c["url"]));
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
}
} else {
$c = dba::selectFirst('contact', ['name', 'url', 'photo'], ['self' => true, 'uid' => $uid]);
$contact = dba::selectFirst('contact', ['name', 'url', 'photo'], ['self' => true, 'uid' => $uid]);
if (DBM::is_result($c)) {
if (DBM::is_result($contact)) {
$vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), array(
'$name' => htmlentities($c['name']),
'$photo' => $c['photo'],
'$name' => htmlentities($contact['name']),
'$photo' => $contact['photo'],
'url' => 'contacts/' . $cid
));
@ -59,7 +59,7 @@ function common_content(App $a)
}
}
if (!DBM::is_result($c)) {
if (!DBM::is_result($contact)) {
return;
}

View file

@ -9,7 +9,7 @@ use Friendica\Model\Profile;
function hcard_init(App $a)
{
$blocked = (((Config::get('system', 'block_public')) && (! local_user()) && (! remote_user())) ? true : false);
$blocked = Config::get('system', 'block_public') && !local_user() && !remote_user();
if ($a->argc > 1) {
$which = $a->argv[1];
@ -38,7 +38,7 @@ function hcard_init(App $a)
$a->page['htmlhead'] .= '<link rel="openid.delegate" href="' . $delegate . '" />' . "\r\n";
}
if (! $blocked) {
if (!$blocked) {
$keywords = ((x($a->profile, 'pub_keywords')) ? $a->profile['pub_keywords'] : '');
$keywords = str_replace(array(',',' ',',,'), array(' ',',',','), $keywords);
if (strlen($keywords)) {

View file

@ -34,7 +34,7 @@ function noscrape_init(App $a)
$keywords = str_replace(array('#',',',' ',',,'), array('',' ',',',','), $keywords);
$keywords = explode(',', $keywords);
$r = dba::selectFirst('contact', ['photo'], ['self' => true, 'uid' => $a->profile['uid']]);
$contactPhoto = dba::selectFirst('contact', ['photo'], ['self' => true, 'uid' => $a->profile['uid']]);
$json_info = array(
'fn' => $a->profile['name'],
@ -44,7 +44,7 @@ function noscrape_init(App $a)
'key' => $a->profile['pubkey'],
'homepage' => System::baseUrl()."/profile/{$which}",
'comm' => (x($a->profile, 'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY),
'photo' => $r["photo"],
'photo' => $contactPhoto["photo"],
'tags' => $keywords
);

View file

@ -49,7 +49,7 @@ function photos_init(App $a) {
$a->profile_uid = $user[0]['uid'];
$is_owner = (local_user() && (local_user() == $a->profile_uid));
$profile = Profile::getProfiledataByNick($nick, $a->profile_uid);
$profile = Profile::getByNickname($nick, $a->profile_uid);
$account_type = Contact::getAccountType($profile);

View file

@ -42,7 +42,7 @@ function videos_init(App $a) {
$a->data['user'] = $user[0];
$a->profile_uid = $user[0]['uid'];
$profile = Profile::getProfiledataByNick($nick, $a->profile_uid);
$profile = Profile::getByNickname($nick, $a->profile_uid);
$account_type = Contact::getAccountType($profile);