Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

55 lines
2.2 KiB

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