blob: 8fb7558fe51a2f5f3c0298c6edbcc91e327bd88b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<?php
/**
* Elgg FOAF Entity export.
* Displays an ElggUser entity as FOAF.
*
* @package Elgg
* @subpackage Core
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Marcus Povey
* @copyright Curverider Ltd 2008
* @link http://elgg.org/
*/
global $CONFIG;
$entity = $vars['entity'];
if (!($entity instanceof ElggUser))
exit;
?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
<foaf:Person>
<foaf:name><?php echo $entity->name; ?></foaf:name>
<foaf:mbox rdf:resource="<?php echo $entity->email; ?>"/>
<foaf:nick><?php echo $entity->username; ?></foaf:nick>
<!-- TODO : more -->
<?php
// Get friends
$friends = get_entities_from_relationship("friend", $entity->guid);
// Iterate through and generate foaf:knows
if ($friends)
{
echo "<foaf:knows>\n";
foreach ($friends as $friend)
{
if ($friend instanceof ElggUser)
{
?>
<foaf:Person>
<foaf:name><?php echo $friend->name; ?></foaf:name>
<foaf:mbox rdf:resource="<?php echo $friend->email; ?>"/>
<rdfs:seeAlso rdf:resource="<?php echo guid_to_uuid($friend->guid); ?>?view=foaf"/>
</foaf:Person>
<?php
}
}
echo "</foaf:knows>\n";
}
?>
</foaf:Person>
</rdf:RDF>
|