]> git.mxchange.org Git - friendica.git/blob - mod/hcard.php
fix account_type
[friendica.git] / mod / hcard.php
1 <?php
2
3 function hcard_init(&$a) {
4
5         $blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
6
7         if($a->argc > 1)
8                 $which = $a->argv[1];
9         else {
10                 notice( t('No profile') . EOL );
11                 $a->error = 404;
12                 return;
13         }
14
15         $profile = 0;
16         if((local_user()) && ($a->argc > 2) && ($a->argv[2] === 'view')) {
17                 $which = $a->user['nickname'];
18                 $profile = $a->argv[1];         
19         }
20
21         profile_load($a,$which,$profile);
22
23         if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) {
24                 $a->page['htmlhead'] .= '<meta name="friendica.community" content="true" />';
25         }
26         if(x($a->profile,'openidserver'))                               
27                 $a->page['htmlhead'] .= '<link rel="openid.server" href="' . $a->profile['openidserver'] . '" />' . "\r\n";
28         if(x($a->profile,'openid')) {
29                 $delegate = ((strstr($a->profile['openid'],'://')) ? $a->profile['openid'] : 'http://' . $a->profile['openid']);
30                 $a->page['htmlhead'] .= '<link rel="openid.delegate" href="' . $delegate . '" />' . "\r\n";
31         }
32
33         if(! $blocked) {
34                 $keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : '');
35                 $keywords = str_replace(array(',',' ',',,'),array(' ',',',','),$keywords);
36                 if(strlen($keywords))
37                         $a->page['htmlhead'] .= '<meta name="keywords" content="' . $keywords . '" />' . "\r\n" ;
38         }
39
40         $a->page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . (($a->profile['net-publish']) ? 'true' : 'false') . '" />' . "\r\n" ;
41         $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/dfrn_poll/' . $which .'" />' . "\r\n" ;
42         $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : ''));
43         $a->page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . $a->get_baseurl() . '/xrd/?uri=' . $uri . '" />' . "\r\n";
44         header('Link: <' . $a->get_baseurl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
45         
46         $dfrn_pages = array('request', 'confirm', 'notify', 'poll');
47         foreach($dfrn_pages as $dfrn)
48                 $a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"".$a->get_baseurl()."/dfrn_{$dfrn}/{$which}\" />\r\n";
49
50 }
51