aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-23 16:56:33 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-23 16:56:33 +0000
commitbfd49157afbdcb8ecc8e204ff7ab2b246d08be57 (patch)
tree4aa38bfe70a4054f9f2fe5645b2d18e9fc7f7c94
parent9d230309a4a8494ec7c409fd045def5ab918c378 (diff)
downloadelgg-bfd49157afbdcb8ecc8e204ff7ab2b246d08be57.tar.gz
elgg-bfd49157afbdcb8ecc8e204ff7ab2b246d08be57.tar.bz2
RSS for group topics, including fixes for annotation getURL() override
git-svn-id: https://code.elgg.org/elgg/trunk@2898 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/annotations.php4
-rw-r--r--mod/groups/start.php13
-rw-r--r--mod/groups/topicposts.php4
-rw-r--r--mod/groups/views/default/forum/topicposts.php1
-rw-r--r--mod/groups/views/rss/forum/topicposts.php3
-rw-r--r--mod/groups/views/rss/forum/viewposts.php12
-rw-r--r--views/rss/object/default.php5
7 files changed, 37 insertions, 5 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index 7e530eab9..8ad918180 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -105,7 +105,7 @@
*
* @return string
*/
- public function getURL() { return get_annotation_url($this->guid); }
+ public function getURL() { return get_annotation_url($this->id); }
// SYSTEM LOG INTERFACE ////////////////////////////////////////////////////////////
@@ -859,7 +859,7 @@
if ($extender = get_annotation($id)) {
return get_extender_url($extender);
- }
+ }
return false;
}
diff --git a/mod/groups/start.php b/mod/groups/start.php
index 1b3cc2e1e..62e786f6f 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -487,6 +487,19 @@
}
+ /**
+ * Overrides topic post getURL() value.
+ *
+ */
+ function group_topicpost_url($annotation) {
+ if ($parent = get_entity($annotation->entity_guid)) {
+ global $CONFIG;
+ return $CONFIG->wwwroot . 'mod/groups/topicposts.php?topic='.$parent->guid.'&amp;group_guid='.$parent->container_guid.'#' . $annotation->id;
+ }
+ }
+
+ register_extender_url_handler('group_topicpost_url','annotation', 'group_topic_post');
+
// Register a handler for create groups
register_elgg_event_handler('create', 'group', 'groups_create_event_listener');
diff --git a/mod/groups/topicposts.php b/mod/groups/topicposts.php
index 7a2efaa70..ea8a82bac 100644
--- a/mod/groups/topicposts.php
+++ b/mod/groups/topicposts.php
@@ -13,6 +13,10 @@
// Load Elgg engine
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+ // We now have RSS on topics
+ global $autofeed;
+ $autofeed = true;
+
//get_input('group_guid');
set_page_owner(get_input('group_guid'));
if (!(page_owner_entity() instanceof ElggGroup)) forward();
diff --git a/mod/groups/views/default/forum/topicposts.php b/mod/groups/views/default/forum/topicposts.php
index 5b259d13f..e9ddaa40e 100644
--- a/mod/groups/views/default/forum/topicposts.php
+++ b/mod/groups/views/default/forum/topicposts.php
@@ -20,6 +20,7 @@
<table width="100%">
<tr>
<td>
+ <a name="<?php echo $vars['entity']->id; ?>"></a>
<?php
//get infomation about the owner of the comment
if ($post_owner = get_user($vars['entity']->owner_guid)) {
diff --git a/mod/groups/views/rss/forum/topicposts.php b/mod/groups/views/rss/forum/topicposts.php
new file mode 100644
index 000000000..0165eb215
--- /dev/null
+++ b/mod/groups/views/rss/forum/topicposts.php
@@ -0,0 +1,3 @@
+<?php
+
+?> \ No newline at end of file
diff --git a/mod/groups/views/rss/forum/viewposts.php b/mod/groups/views/rss/forum/viewposts.php
index 157be91da..b537ffc83 100644
--- a/mod/groups/views/rss/forum/viewposts.php
+++ b/mod/groups/views/rss/forum/viewposts.php
@@ -10,7 +10,17 @@
* @link http://elgg.com/
*/
- echo elgg_view_entity($vars['entity']);
+ //display follow up comments
+ $count = $vars['entity']->countAnnotations('group_topic_post');
+ $offset = (int) get_input('offset',0);
+
+ foreach($vars['entity']->getAnnotations('group_topic_post', 50, $offset, "asc") as $post) {
+ $post->title = '';
+ $post->description = $post->value;
+ echo elgg_view('object/default', array('entity' => $post));
+ // echo elgg_view("forum/topicposts",array('entity' => $post));
+
+ }
?> \ No newline at end of file
diff --git a/views/rss/object/default.php b/views/rss/object/default.php
index 9174ff1b5..5e50971c9 100644
--- a/views/rss/object/default.php
+++ b/views/rss/object/default.php
@@ -13,8 +13,9 @@
$title = $vars['entity']->title;
if (empty($title)) {
- $title = substr($vars['entity']->description,0,32);
- if (strlen($vars['entity']->description) > 32)
+ $subtitle = strip_tags($vars['entity']->description);
+ $title = substr($subtitle,0,32);
+ if (strlen($subtitle) > 32)
$title .= " ...";
}