From 69a750eb7b2a3c7a09369a3714bfaa9ef028f086 Mon Sep 17 00:00:00 2001 From: dave Date: Thu, 7 Aug 2008 15:02:05 +0000 Subject: groups now have forums git-svn-id: https://code.elgg.org/elgg/trunk@1761 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/groups/views/default/forum/topicposts.php | 65 +++++++++++++ mod/groups/views/default/forum/topics.php | 128 ++++++++++++++++++++++++++ mod/groups/views/default/forum/viewposts.php | 44 +++++++++ 3 files changed, 237 insertions(+) create mode 100644 mod/groups/views/default/forum/topicposts.php create mode 100644 mod/groups/views/default/forum/topics.php create mode 100644 mod/groups/views/default/forum/viewposts.php (limited to 'mod/groups/views/default/forum') diff --git a/mod/groups/views/default/forum/topicposts.php b/mod/groups/views/default/forum/topicposts.php new file mode 100644 index 000000000..53c45a6d0 --- /dev/null +++ b/mod/groups/views/default/forum/topicposts.php @@ -0,0 +1,65 @@ + + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + * + * @uses $vars['entity'] The posted comment to view + */ + +?> + +
+ + + + + + +
+ owner_guid); + + //display the user icon + echo "
" . elgg_view("profile/icon",array('entity' => $post_owner, 'size' => 'small')) . "
"; + + //display the user name + echo "

" . $post_owner->name . "
"; + + //display the date of the comment + echo "" . friendly_time($vars['entity']->time_created) . "

"; + ?> +
+ " . parse_urls(elgg_view("output/longtext",array("value" => $vars['entity']->value))) . "

"; + ?> +
+ canEdit()) { + ?> +

+ $vars['url'] . "action/groups/forums/deletetopic?topic=" . $vars['entity']->entity_guid . "&group=" . (int)get_input('group_guid'), + 'text' => elgg_echo('delete'), + 'confirm' => elgg_echo('deleteconfirm'), + )); + + ?> +

+ + + +
\ No newline at end of file diff --git a/mod/groups/views/default/forum/topics.php b/mod/groups/views/default/forum/topics.php new file mode 100644 index 000000000..9fa80db79 --- /dev/null +++ b/mod/groups/views/default/forum/topics.php @@ -0,0 +1,128 @@ + + +

+
+ +isMember($vars['user'])){ + +?> + +

[]

+ + + +

title; ?>

+ + + + + + + + + +
+ + + 0) { + + foreach($vars['entity'] as $topic) { + + //This function controls the alternating background on table cells for topics + $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; + //get the last reply annotation posted and the user who posted it + //this is used to display the time and person who made the last post + $last_post = $topic->getAnnotations("group_topic_post", 1, 0, "desc"); + //get the time and user + foreach($last_post as $last){ + $last_time = $last->time_created; + $last_user = $last->owner_guid; + } + + //display the divs + echo "
"; +?> + + + + + + + +
+ title; ?> + + canEdit()) { + + ?> + + $vars['url'] . "action/groups/deletetopic?topic=" . $topic->getGUID() . "&group=" . $topic->container_guid, + 'text' => elgg_echo('delete'), + 'confirm' => elgg_echo('deleteconfirm'), + )); + + ?> + + +

countAnnotations("group_topic_post")); + ?>

+
+

+ name; + ?> +

+
+

+ +

+
+ + +
+ +". elgg_echo("grouptopic:notcreated") . "

"; + + } + +?> + +
\ No newline at end of file diff --git a/mod/groups/views/default/forum/viewposts.php b/mod/groups/views/default/forum/viewposts.php new file mode 100644 index 000000000..20f56ec8d --- /dev/null +++ b/mod/groups/views/default/forum/viewposts.php @@ -0,0 +1,44 @@ + + +
+

» title; ?>

+ +

title; ?>

+ +getAnnotations('group_topic_post', 50, 0, "asc") as $post) { + + echo elgg_view("forum/topicposts",array('entity' => $post)); + + } + + // check to find out the status of the topic and act + if($vars['entity']->status != "closed" && page_owner_entity()->isMember($vars['user'])){ + + //display the add comment form, this will appear after all the existing comments + echo elgg_view("forms/forums/addpost", array('entity' => $vars['entity'])); + + } elseif($vars['entity']->status == "closed") { + + //this topic has been closed by the owner + echo "

" . elgg_echo("groups:topicisclosed") . "

"; + echo "

" . elgg_echo("groups:topiccloseddesc") . "

"; + + } else { + } + +?> +
\ No newline at end of file -- cgit v1.2.3