aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-04 15:05:29 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-04 15:05:29 +0000
commit0f53ed87dc17446f295f7333c05c65ceec0bc528 (patch)
tree4df9949510359663b8a3359ac8301e906c2d4419 /mod
parent6eedf9ee17e022858491ff2396f6b9b9aa4b2cf7 (diff)
downloadelgg-0f53ed87dc17446f295f7333c05c65ceec0bc528.tar.gz
elgg-0f53ed87dc17446f295f7333c05c65ceec0bc528.tar.bz2
Added pagination to group topic posts. Fixes #704
git-svn-id: https://code.elgg.org/elgg/trunk@2644 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r--mod/groups/views/default/forum/viewposts.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/mod/groups/views/default/forum/viewposts.php b/mod/groups/views/default/forum/viewposts.php
index a05443b6a..ba30f5b60 100644
--- a/mod/groups/views/default/forum/viewposts.php
+++ b/mod/groups/views/default/forum/viewposts.php
@@ -14,12 +14,26 @@
<div id="topic_posts"><!-- open the topic_posts div -->
<div id="pages_breadcrumbs"><b><a href="<?php echo $vars['url']; ?>pg/groups/forum/<?php echo $vars['entity']->container_guid; ?>/"><?php echo elgg_echo("groups:forum"); ?></a></b> > <?php echo $vars['entity']->title; ?></div>
- <!-- grab the topic title -->
- <div id="content_area_group_title"><h2><?php echo $vars['entity']->title; ?></h2></div>
<?php
//display follow up comments
- foreach($vars['entity']->getAnnotations('group_topic_post', 50, 0, "asc") as $post) {
+ $count = $vars['entity']->countAnnotations('group_topic_post');
+ $offset = (int) get_input('offset',0);
+
+ $baseurl = $vars['url'] . "mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$vars['entity']->container_guid}";
+ echo elgg_view('navigation/pagination',array(
+ 'limit' => 50,
+ 'offset' => $offset,
+ 'baseurl' => $baseurl,
+ 'count' => $count,
+ ));
+
+?>
+ <!-- grab the topic title -->
+ <div id="content_area_group_title"><h2><?php echo $vars['entity']->title; ?></h2></div>
+<?php
+
+ foreach($vars['entity']->getAnnotations('group_topic_post', 50, $offset, "asc") as $post) {
echo elgg_view("forum/topicposts",array('entity' => $post));