if (!DBM::is_result($contact)) {
// The link could be provided as http although we stored it as https
$ssl_url = str_replace('http://', 'https://', $url);
- $r = dba::select('contact', array('id', 'avatar-date'), array('`alias` IN (?, ?, ?) AND `uid` = ?', $url, normalise_link($url), $ssl_url, $uid), array('limit' => 1));
+ $r = dba::select('contact', array('id', 'avatar', 'avatar-date'), array('`alias` IN (?, ?, ?) AND `uid` = ?', $url, normalise_link($url), $ssl_url, $uid), array('limit' => 1));
$contact = dba::fetch($r);
dba::close($r);
}
$update_contact = ($contact['avatar-date'] < datetime_convert('', '', 'now -7 days'));
// We force the update if the avatar is empty
- if ($contact['avatar'] == '') {
+ if (!x($contact, 'avatar')) {
$update_contact = true;
}
$contact = ($r[0]["contact-type"] == ACCOUNT_TYPE_COMMUNITY ? 'owner-id' : 'author-id');
$r = q(item_query() . " AND `item`.`" . $contact . "` = %d AND " . $sql .
- " ORDER BY `item`.`created` DESC LIMIT %d, %d", intval($author_id), intval(local_user()), intval($a->pager['start']), intval($a->pager['itemspage'])
+ " AND `item`.`verb` = '%s' ORDER BY `item`.`created` DESC LIMIT %d, %d",
+ intval($author_id), intval(local_user()), dbesc(ACTIVITY_POST),
+ intval($a->pager['start']), intval($a->pager['itemspage'])
);
- $o = conversation($a, $r, 'community', false);
+ $o = conversation($a, $r, 'contact-posts', false);
$o .= alt_pager($a, count($r));