else {
$this->module = 'home';
}
+
+ if($this->cmd == '.well-known/host-meta')
+ require_once('include/hostxrd.php');
+
$this->pager['page'] = ((x($_GET,'page')) ? $_GET['page'] : 1);
$this->pager['itemspage'] = 50;
$this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
--- /dev/null
+<?php
+
+ $tpl = file_get_contents('view/xrd_host.tpl');
+ echo str_replace('$domain',$this->hostname,$tpl);
+ session_write_close();
+ exit();
--- /dev/null
+<?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();
+
+}
\ No newline at end of file
--- /dev/null
+<?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>
--- /dev/null
+<?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>