3 require_once('salmon.php');
5 function xrd_content(&$a) {
7 $uri = urldecode(notags(trim($_GET['uri'])));
9 if(substr($uri,0,4) === 'http')
10 $name = basename($uri);
12 $local = str_replace('acct:', '', $uri);
13 if(substr($local,0,2) == '//')
14 $local = substr($local,2);
16 $name = substr($local,0,strpos($local,'@'));
19 $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
25 $salmon_key = salmon_key($r[0]['spubkey']);
28 header("Content-type: text/xml");
30 $tpl = file_get_contents('view/xrd_person.tpl');
32 $o = replace_macros($tpl, array(
34 '$profile_url' => $a->get_baseurl() . '/profile/' . $r[0]['nickname'],
35 '$atom' => $a->get_baseurl() . '/dfrn_poll/' . $r[0]['nickname'],
36 '$photo' => $a->get_baseurl() . '/photo/profile/' . $r[0]['uid'] . '.jpg',
37 '$salmon' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'],
38 '$salmen' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'] . '/mention',
39 '$modexp' => 'data:application/magic-public-key,' . $salmon_key
43 $arr = array('user' => $r[0], 'xml' => $o);
44 call_hooks('personal_xrd', $arr);