Scrape now contains the number of contacts as well.
This commit is contained in:
parent
7d2da9be02
commit
842ac46857
4 changed files with 31 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue