3 function noscrape_init(&$a) {
5 if(get_config('system','disable_noscrape'))
14 if((local_user()) && ($a->argc > 2) && ($a->argv[2] === 'view')) {
15 $which = $a->user['nickname'];
16 $profile = $a->argv[1];
19 profile_load($a,$which,$profile);
21 if(!$a->profile['net-publish'])
24 $keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : '');
25 $keywords = str_replace(array('#',',',' ',',,'),array('',' ',',',','),$keywords);
26 $keywords = explode(',', $keywords);
29 'fn' => $a->profile['name'],
30 'key' => $a->profile['pubkey'],
31 'homepage' => $a->get_baseurl()."/profile/{$which}",
32 'comm' => (x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY),
33 'photo' => $a->profile['photo'],
37 //These are optional fields.
38 $profile_fields = array('pdesc', 'locality', 'region', 'postal-code', 'country-name', 'gender', 'marital', 'about');
39 foreach($profile_fields as $field)
40 if(!empty($a->profile[$field])) $json_info["$field"] = $a->profile[$field];
42 $dfrn_pages = array('request', 'confirm', 'notify', 'poll');
43 foreach($dfrn_pages as $dfrn)
44 $json_info["dfrn-{$dfrn}"] = $a->get_baseurl()."/dfrn_{$dfrn}/{$which}";
46 //Output all the JSON!
47 header('Content-type: application/json; charset=utf-8');
48 echo json_encode($json_info);