more comprehensive XRD linkages

This commit is contained in:
Mike Macgirvin 2010-10-12 04:39:32 -07:00
parent 013d2604f8
commit dba866c689
3 changed files with 33 additions and 21 deletions

View file

@ -1,5 +1,5 @@
<?php <?php
header("Content-type: text/xml");
$tpl = file_get_contents('view/xrd_host.tpl'); $tpl = file_get_contents('view/xrd_host.tpl');
echo str_replace('$domain',$this->hostname,$tpl); echo str_replace('$domain',$this->hostname,$tpl);
session_write_close(); session_write_close();

View file

@ -20,16 +20,18 @@ function xrd_content(&$a) {
$salmon_key = salmon_key($r[0]['spubkey']); $salmon_key = salmon_key($r[0]['spubkey']);
header("Content-type: text/xml");
$tpl = load_view_file('view/xrd_person.tpl'); $tpl = load_view_file('view/xrd_person.tpl');
$o = replace_macros($tpl, array( $o = replace_macros($tpl, array(
'$accturi' => $uri, '$accturi' => $uri,
'$profile_url' => $a->get_baseurl() . '/profile/' . $r[0]['nickname'], '$profile_url' => $a->get_baseurl() . '/profile/' . $r[0]['nickname'],
'$photo' => $a->get_baseurl() . '/photo/profile/' . $r[0]['uid'], '$atom' => $a->get_baseurl() . '/dfrn_poll/' . $r[0]['nickname'],
'$salmon' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'] . '/mention', '$photo' => $a->get_baseurl() . '/photo/profile/' . $r[0]['uid'],
'$modexp' => 'data:application/magic-public-key,' . $salmon_key '$salmon' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'],
'$salmen' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'] . '/mention',
'$modexp' => 'data:application/magic-public-key,' . $salmon_key
)); ));
echo $o; echo $o;

View file

@ -1,20 +1,30 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'> <XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Subject>$accturi</Subject> <Subject>$accturi</Subject>
<Alias>$accturi</Alias>
<Alias>$profile_url</Alias> <Alias>$profile_url</Alias>
<Link rel='http://purl.org/macgirvin/dfrn/1.0' <Link rel="http://purl.org/macgirvin/dfrn/1.0"
href='$profile_url' /> href="$profile_url" />
<Link rel='http://webfinger.net/rel/profile-page' <Link rel="http://schemas.google.com/g/2010#updates-from"
type='text/html' type="application/atom+xml"
href='$profile_url' /> href="$atom" />
<Link rel='http://microformats.org/profile/hcard' <Link rel="http://webfinger.net/rel/profile-page"
type='text/html' type="text/html"
href='$profile_url' /> href="$profile_url" />
<Link rel='http://webfinger.net/rel/avatar' <Link rel="http://microformats.org/profile/hcard"
href='$photo' /> type="text/html"
<Link rel="salmon" href="$salmon" /> href="$profile_url" />
<Link rel="magic-public-key" href="$modexp" /> <Link rel="http://webfinger.net/rel/avatar"
href="$photo" />
<Link rel="salmon"
href="$salmon" />
<Link rel="http://salmon-protocol.org/ns/salmon-replies"
href="$salmon" />
<Link rel="http://salmon-protocol.org/ns/salmon-mention"
href="$salmen" />
<Link rel="magic-public-key"
href="$modexp" />
</XRD> </XRD>