diff options
author | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-29 13:12:24 +0000 |
---|---|---|
committer | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-29 13:12:24 +0000 |
commit | a7add808c43b0758a90791359bed0c075b0c35e6 (patch) | |
tree | d9a752f5caa5503fc484a06d3e973173be1b1b1a /mod/profile/views/default/profile | |
parent | b77d118819ec7b31a399326c166a3681fb20d9da (diff) | |
download | elgg-a7add808c43b0758a90791359bed0c075b0c35e6.tar.gz elgg-a7add808c43b0758a90791359bed0c075b0c35e6.tar.bz2 |
simple comment wall added to profiles
git-svn-id: http://code.elgg.org/elgg/trunk@5537 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/profile/views/default/profile')
5 files changed, 91 insertions, 1 deletions
diff --git a/mod/profile/views/default/profile/commentwall/commentwall.php b/mod/profile/views/default/profile/commentwall/commentwall.php new file mode 100644 index 000000000..9c1ff3fdb --- /dev/null +++ b/mod/profile/views/default/profile/commentwall/commentwall.php @@ -0,0 +1,22 @@ +<?php
+/**
+ * Elgg Commentwall display page
+ */
+
+// If there is any content to view, view it
+if (is_array($vars['annotation']) && sizeof($vars['annotation']) > 0) {
+
+ //start the div which will wrap all the message board contents
+ echo "<div id=\"messageboard_wrapper\">";
+
+ //loop through all annotations and display
+ foreach($vars['annotation'] as $content) {
+ echo elgg_view("profile/commentwall/commentwall_content", array('annotation' => $content));
+ }
+
+ //close the wrapper div
+ echo "</div>";
+
+} else {
+ echo "<div class='ContentWrapper'>" . elgg_echo("profile:commentwall:none") . "</div>";
+}
\ No newline at end of file diff --git a/mod/profile/views/default/profile/commentwall/commentwall_content.php b/mod/profile/views/default/profile/commentwall/commentwall_content.php new file mode 100644 index 000000000..d2a313d93 --- /dev/null +++ b/mod/profile/views/default/profile/commentwall/commentwall_content.php @@ -0,0 +1,32 @@ +<?php
+/**
+* Elgg Message board individual item display page
+ */
+?>
+<div class="messageboard"><!-- start of messageboard div -->
+ <!-- display the user icon of the user that posted the message -->
+ <div class="message_sender">
+ <?php
+ echo elgg_view("profile/icon",array('entity' => get_entity($vars['annotation']->owner_guid), 'size' => 'tiny'));
+ ?>
+ </div>
+ <!-- display the user's name who posted and the date/time -->
+ <p class="message_item_timestamp">
+ <?php echo get_entity($vars['annotation']->owner_guid)->name . " " . friendly_time($vars['annotation']->time_created); ?>
+ </p>
+ <!-- output the actual comment -->
+ <div class="message"><?php echo elgg_view("output/longtext",array("value" => parse_urls($vars['annotation']->value))); ?></div>
+ <div class="message_buttons">
+ <?php
+ // if the user looking at the comment can edit, show the delete link
+ if ($vars['annotation']->canEdit()) {
+ echo "<div class='delete_message'>" . elgg_view("output/confirmlink",array(
+ 'href' => $vars['url'] . "action/profile/deletecomment?annotation_id=" . $vars['annotation']->id,
+ 'text' => elgg_echo('delete'),
+ 'confirm' => elgg_echo('deleteconfirm'),
+ )) . "</div>";
+ } //end of can edit if statement
+ ?>
+ </div>
+<div class="clearfloat"></div>
+</div><!-- end of messageboard div -->
diff --git a/mod/profile/views/default/profile/commentwall/commentwalladd.php b/mod/profile/views/default/profile/commentwall/commentwalladd.php new file mode 100644 index 000000000..0d696b955 --- /dev/null +++ b/mod/profile/views/default/profile/commentwall/commentwalladd.php @@ -0,0 +1,18 @@ +<?php
+/**
+ * Elgg profile comment wall add
+ */
+?>
+<div id="mb_input_wrapper">
+<form action="<?php echo $vars['url']; ?>action/profile/addcomment" method="post" name="messageboardForm">
+ <!-- textarea for the contents -->
+ <textarea name="message_content" value="" class="commentwall" style="width:500px;height:20px;"></textarea><br />
+ <!-- the person posting an item on the message board -->
+ <input type="hidden" name="guid" value="<?php echo $_SESSION['guid']; ?>" />
+ <!-- the page owner, this will be the profile owner -->
+ <input type="hidden" name="pageOwner" value="<?php echo page_owner(); ?>" />
+ <?php echo elgg_view('input/securitytoken'); ?>
+ <!-- submit messages input -->
+ <input type="submit" id="postit" value="<?php echo elgg_echo('profile:commentwall:add'); ?>">
+</form>
+</div>
diff --git a/mod/profile/views/default/profile/profile_contents/commentwall.php b/mod/profile/views/default/profile/profile_contents/commentwall.php new file mode 100644 index 000000000..c13c16331 --- /dev/null +++ b/mod/profile/views/default/profile/profile_contents/commentwall.php @@ -0,0 +1,13 @@ +<?php
+/**
+ * Elgg profile comment wall
+ */
+?>
+<div id="profile_content">
+<?php
+if(isloggedin()){
+ echo elgg_view("profile/commentwall/commentwalladd");
+}
+echo elgg_view("profile/commentwall/commentwall", array('annotation' => $vars['comments']));
+?>
+</div>
\ No newline at end of file diff --git a/mod/profile/views/default/profile/profile_navigation.php b/mod/profile/views/default/profile/profile_navigation.php index c6ba3054a..1c2c782c7 100755 --- a/mod/profile/views/default/profile/profile_navigation.php +++ b/mod/profile/views/default/profile/profile_navigation.php @@ -26,6 +26,10 @@ switch($section){ case 'twitter': $twitter = 'class="selected"'; break; + + case 'commentwall': + $commentwall = 'class="selected"'; + break; case 'activity': default: @@ -39,6 +43,7 @@ switch($section){ <li <?php echo $activity; ?>><a href="<?php echo $url; ?>">Activity</a></li> <li <?php echo $details; ?>><a href="<?php echo $url . 'details'; ?>">Details</a></li> <li <?php echo $friends; ?>><a href="<?php echo $url . 'friends'; ?>">Friends</a></li> + <li <?php echo $commentwall; ?>><a href="<?php echo $url . 'commentwall'; ?>">Comment Wall</a></li> <?php //check to see if the twitter username is set if($vars['entity']->twitter){ @@ -50,4 +55,4 @@ switch($section){ echo elgg_view('profilenav/extend', $profile); ?> </ul> -</div> +</div>
\ No newline at end of file |