if($justme)
$sql_extra = " and `contact`.`self` = 1 ";
+ else
+ $sql_extra = " and `contact`.`self` = 0 ";
if($cid)
$sql_extra = sprintf(" and `contact`.`id` = %d ",intval($cid));
and uid in (select uid from pconfig where cat = 'system' and k = 'suggestme' and v = 1) ");
}
else {
- $r = q("SELECT count(*) as `total` from `contact` where `uid` = %d and blocked = 0 and pending = 0
+ $r = q("SELECT count(*) as `total` from `contact` where `uid` = %d and blocked = 0 and pending = 0 and hidden = 0 and archive = 0
$sql_extra ",
intval($user['uid'])
);
}
else {
- $r = q("SELECT * from `contact` where `uid` = %d and blocked = 0 and pending = 0
+ $r = q("SELECT * from `contact` where `uid` = %d and blocked = 0 and pending = 0 and hidden = 0 and archive = 0
$sql_extra LIMIT %d, %d",
intval($user['uid']),
intval($startIndex),
$entry['id'] = $rr['id'];
if($fields_ret['displayName'])
$entry['displayName'] = $rr['name'];
- if($fields_ret['urls'])
+ if($fields_ret['urls']) {
$entry['urls'] = array(array('value' => $rr['url'], 'type' => 'profile'));
+ if($rr['addr'] && ($rr['network'] !== NETWORK_MAIL))
+ $entry['urls'][] = array('value' => 'acct:' . $rr['addr'], 'type' => 'webfinger');
+ }
if($fields_ret['preferredUsername'])
$entry['preferredUsername'] = $rr['nick'];
if($fields_ret['photos'])
if($format === 'xml') {
header('Content-type: text/xml');
- echo replace_macros(get_markup_template('poco_xml.tpl'),array_xmlify(array('$response' => $ret)));
+
+ $includes = array(
+ '$poco_entry_xml' => 'poco_entry_xml.tpl'
+ );
+ $includes = set_template_includes($a->theme['template_engine'], $includes);
+
+ echo replace_macros(get_markup_template('poco_xml.tpl'),array_xmlify($includes + array('$response' => $ret)));
http_status_exit(500);
}
if($format === 'json') {
http_status_exit(500);
-}
\ No newline at end of file
+}