5 changed files with 65 additions and 0 deletions
@ -0,0 +1,6 @@
|
||||
<?php |
||||
|
||||
$tpl = file_get_contents('view/xrd_host.tpl'); |
||||
echo str_replace('$domain',$this->hostname,$tpl); |
||||
session_write_close(); |
||||
exit(); |
@ -0,0 +1,27 @@
|
||||
<?php |
||||
|
||||
|
||||
function xrd_content(&$a) { |
||||
|
||||
$uri = notags(trim($_GET['uri'])); |
||||
$local = str_replace('acct:', '', $uri); |
||||
$name = substr($local,0,strpos($local,'@')); |
||||
|
||||
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1", |
||||
dbesc($name) |
||||
); |
||||
if(! count($r)) |
||||
killme(); |
||||
|
||||
$tpl = file_get_contents('view/xrd_person.tpl'); |
||||
|
||||
$o = replace_macros($tpl, array( |
||||
'$accturi' => $uri, |
||||
'$profile_url' => $a->get_baseurl() . '/profile/' . $r[0]['nickname'], |
||||
'$photo' => $a->get_baseurl() . '/photo/profile/' . $r[0]['uid'] |
||||
)); |
||||
|
||||
echo $o; |
||||
killme(); |
||||
|
||||
} |
@ -0,0 +1,11 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?> |
||||
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0' |
||||
xmlns:hm='http://host-meta.net/xrd/1.0'> |
||||
|
||||
<hm:Host>$domain</hm:Host> |
||||
|
||||
<Link rel='lrdd' |
||||
template='http://$domain/xrd/?uri={uri}'> |
||||
<Title>Resource Descriptor</Title> |
||||
</Link> |
||||
</XRD> |
@ -0,0 +1,17 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?> |
||||
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'> |
||||
|
||||
<Subject>$accturi</Subject> |
||||
<Alias>$profile_url</Alias> |
||||
|
||||
<Link rel='http://portablecontacts.net/spec/1.0' |
||||
href='http://example.com/api/people/' /> |
||||
<Link rel='http://webfinger.net/rel/profile-page' |
||||
type='text/html' |
||||
href='$profile_url' /> |
||||
<Link rel='http://microformats.org/profile/hcard' |
||||
type='text/html' |
||||
href='$profile_url' /> |
||||
<Link rel='http://webfinger.net/rel/avatar' |
||||
href='$photo' /> |
||||
</XRD> |
Loading…
Reference in new issue