blob: e47afec4a16295d34f9a2f0633324a67095a9e1c (
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
|
<?php
/**
* Search comment view for RSS feeds.
*
* @uses $vars['entity']
*/
$entity = $vars['entity'];
$comments_data = $entity->getVolatileData('search_comments_data');
$comment_data = array_shift($comments_data);
$entity->setVolatileData('search_comments_data', $comments_data);
$author_name = '';
$comment_author_guid = $comment_data['owner_guid'];
$author = get_user($comment_author_guid);
if ($author) {
$author_name = $author->name;
}
// @todo Sometimes we find comments on entities we can't display...
if ($entity->getVolatileData('search_unavailable_entity')) {
$title = elgg_echo('search:comment_on', array(elgg_echo('search:unavailable_entity')));
} else {
if ($entity->getType() == 'object') {
$title = $entity->title;
} else {
$title = $entity->name;
}
if (!$title) {
$title = elgg_echo('item:' . $entity->getType() . ':' . $entity->getSubtype());
}
if (!$title) {
$title = elgg_echo('item:' . $entity->getType());
}
$title = elgg_echo('search:comment_on', array($title));
$title .= ' ' . elgg_echo('search:comment_by') . ' ' . $author_name;
$url = $entity->getURL() . '#annotation-' . $comment_data['annotation_id'];
}
$description = $comment_data['text'];
$tc = $comment_data['time_created'];
?>
<item>
<guid isPermaLink='true'><?php echo htmlspecialchars($url); ?></guid>
<pubDate><?php echo date("r", $tc) ?></pubDate>
<link><?php echo htmlspecialchars($url); ?></link>
<title><![CDATA[<?php echo $title; ?>]]></title>
<description><![CDATA[<?php echo $description; ?>]]></description>
</item>
|