Scrape now contains the number of contacts as well.

This commit is contained in:
Michael Vogel 2015-02-08 23:35:29 +01:00
commit 842ac46857
4 changed files with 31 additions and 1 deletions

View file

@ -31,6 +31,19 @@ function noscrape_init(&$a) {
'tags' => $keywords
);
if(is_array($a->profile) AND !$a->profile['hide-friends']) {
$r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0
AND `network` IN ('%s', '%s', '%s', '%s', '')",
intval($a->profile['uid']),
dbesc(NETWORK_DFRN),
dbesc(NETWORK_DIASPORA),
dbesc(NETWORK_OSTATUS),
dbesc(NETWORK_STATUSNET)
);
if(count($r))
$json_info["contacts"] = intval($r[0]['total']);
}
//These are optional fields.
$profile_fields = array('pdesc', 'locality', 'region', 'postal-code', 'country-name', 'gender', 'marital', 'about');
foreach($profile_fields as $field)