--- /dev/null
+<?php\r
+/**\r
+ * Elgg profile commentwall: add message action\r
+ */\r
+\r
+// Make sure we're logged in; forward to the front page if not\r
+if (!isloggedin()) forward();\r
+ \r
+// Get input\r
+$message_content = get_input('message_content'); // the actual message\r
+$page_owner = get_input("pageOwner"); // the message board owner\r
+$message_owner = get_input("guid"); // the user posting the message\r
+$user = get_entity($page_owner); // the commentwall owner details\r
+ \r
+// Let's see if we can get a user entity from the specified page_owner\r
+if ($user && !empty($message_content)) {\r
+ \r
+ // If posting the comment was successful, say so\r
+ if ($user->annotate('commentwall',$message_content,$user->access_id, $_SESSION['user']->getGUID())) {\r
+ \r
+ global $CONFIG;\r
+ \r
+ if ($user->getGUID() != $_SESSION['user']->getGUID())\r
+ notify_user($user->getGUID(), $_SESSION['user']->getGUID(), elgg_echo('profile:comment:subject'), \r
+ sprintf(\r
+ elgg_echo('profile:comment:body'),\r
+ $_SESSION['user']->name,\r
+ $message_content,\r
+ $CONFIG->wwwroot . "pg/profile/" . $user->username,\r
+ $_SESSION['user']->name,\r
+ $_SESSION['user']->getURL()\r
+ )\r
+ ); \r
+ \r
+ system_message(elgg_echo("profile:commentwall:posted"));\r
+ // add to river\r
+ add_to_river('river/object/profile/commentwall/create','commentwall',$_SESSION['user']->guid,$user->guid);\r
+ \r
+ } else {\r
+ register_error(elgg_echo("profile:commentwall:failure"));\r
+ }\r
+ \r
+} else {\r
+ register_error(elgg_echo("profile:commentwall:blank"));\r
+}\r
+ \r
+// Forward back to the messageboard\r
+forward($_SERVER['HTTP_REFERER']);
\ No newline at end of file
--- /dev/null
+<?php\r
+/**\r
+ * Elgg profile commentwall: delete message action\r
+ */\r
+\r
+// Ensure we're logged in\r
+if (!isloggedin()) forward();\r
+ \r
+// Make sure we can get the comment in question\r
+$annotation_id = (int) get_input('annotation_id');\r
+ \r
+//make sure that there is a message on the commentwall matching the passed id\r
+if ($message = get_annotation($annotation_id)) {\r
+ //grab the user or group entity\r
+ $entity = get_entity($message->entity_guid);\r
+ //check to make sure the current user can actually edit the commentwall\r
+ if ($message->canEdit()) {\r
+ //delete the comment\r
+ $message->delete();\r
+ //display message\r
+ system_message(elgg_echo("profile:commentwall:deleted"));\r
+ forward($_SERVER['HTTP_REFERER']);\r
+ }\r
+ \r
+} else {\r
+ system_message(elgg_echo("profile:commentwall:notdeleted"));\r
+}\r
+ \r
+forward($_SERVER['HTTP_REFERER']);
\ No newline at end of file
<?php
/**
* Elgg profile plugin language pack
- *
- * @package ElggProfile
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
*/
$english = array(
'profile:saved' => "Your profile was successfully saved.",
'profile:icon:uploaded' => "Your profile picture was successfully uploaded.",
+
+/**
+ * Profile comment wall
+ **/
+ 'profile:commentwall:add' => "Add to the wall",
+ 'profile:commentwall:posted' => "You successfully posted on the comment wall.",
+ 'profile:commentwall:deleted' => "You successfully deleted the message.",
+ 'profile:commentwall:blank' => "Sorry; you need to actually put something in the message area before we can save it.",
+ 'profile:commentwall:notfound' => "Sorry; we could not find the specified item.",
+ 'profile:commentwall:notdeleted' => "Sorry; we could not delete this message.",
+ 'profile:commentwall:somethingwentwrong' => "Something went wrong when trying to save your message, make sure you actually wrote a message.",
+ 'profile:commentwall:failure' => "An unexpected error occurred when adding your message. Please try again.",
+
+/**
+ * Email messages commentwall
+ */
+
+ 'profile:comment:subject' => 'You have a new message board comment!',
+ 'profile:comment:body' => "You have a new message board comment from %s. It reads:
+
+
+%s
+
+
+To view your message board comments, click here:
+
+ %s
+
+To view %s's profile, click here:
+
+ %s
+
+You cannot reply to this email.",
/**
* Profile error messages
case 'twitter':
$body .= elgg_view('profile/profile_contents/twitter', $view_options);
break;
-
+ case 'commentwall':
+ $comments = $user->getAnnotations('commentwall', 200, 0, 'desc');
+ $body .= elgg_view('profile/profile_contents/commentwall', array("entity" => $user, "comments" => $comments));
+ break;
case 'details':
$body .= elgg_view('profile/profile_contents/details', $view_options);
break;
register_action("profile/cropicon",false,$CONFIG->pluginspath . "profile/actions/cropicon.php");
register_action("profile/editdefault",false,$CONFIG->pluginspath . "profile/actions/editdefault.php", true);
register_action("profile/editdefault/delete",false,$CONFIG->pluginspath . "profile/actions/deletedefaultprofileitem.php", true);
-register_action("profile/editdefault/reset",false,$CONFIG->pluginspath . "profile/actions/resetdefaultprofile.php", true);
\ No newline at end of file
+register_action("profile/editdefault/reset",false,$CONFIG->pluginspath . "profile/actions/resetdefaultprofile.php", true);
+register_action("profile/addcomment",false,$CONFIG->pluginspath . "profile/actions/addcomment.php");
+register_action("profile/deletecomment",false,$CONFIG->pluginspath . "profile/actions/deletecomment.php");
\ No newline at end of file
--- /dev/null
+<?php\r
+/**\r
+ * Elgg Commentwall display page\r
+ */\r
+ \r
+// If there is any content to view, view it\r
+if (is_array($vars['annotation']) && sizeof($vars['annotation']) > 0) {\r
+ \r
+ //start the div which will wrap all the message board contents\r
+ echo "<div id=\"messageboard_wrapper\">";\r
+ \r
+ //loop through all annotations and display\r
+ foreach($vars['annotation'] as $content) {\r
+ echo elgg_view("profile/commentwall/commentwall_content", array('annotation' => $content));\r
+ }\r
+ \r
+ //close the wrapper div\r
+ echo "</div>";\r
+ \r
+} else {\r
+ echo "<div class='ContentWrapper'>" . elgg_echo("profile:commentwall:none") . "</div>";\r
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+/**\r
+* Elgg Message board individual item display page\r
+ */\r
+?>\r
+<div class="messageboard"><!-- start of messageboard div -->\r
+ <!-- display the user icon of the user that posted the message -->\r
+ <div class="message_sender"> \r
+ <?php\r
+ echo elgg_view("profile/icon",array('entity' => get_entity($vars['annotation']->owner_guid), 'size' => 'tiny'));\r
+ ?>\r
+ </div>\r
+ <!-- display the user's name who posted and the date/time -->\r
+ <p class="message_item_timestamp">\r
+ <?php echo get_entity($vars['annotation']->owner_guid)->name . " " . friendly_time($vars['annotation']->time_created); ?>\r
+ </p> \r
+ <!-- output the actual comment -->\r
+ <div class="message"><?php echo elgg_view("output/longtext",array("value" => parse_urls($vars['annotation']->value))); ?></div>\r
+ <div class="message_buttons"> \r
+ <?php\r
+ // if the user looking at the comment can edit, show the delete link\r
+ if ($vars['annotation']->canEdit()) {\r
+ echo "<div class='delete_message'>" . elgg_view("output/confirmlink",array(\r
+ 'href' => $vars['url'] . "action/profile/deletecomment?annotation_id=" . $vars['annotation']->id,\r
+ 'text' => elgg_echo('delete'),\r
+ 'confirm' => elgg_echo('deleteconfirm'),\r
+ )) . "</div>";\r
+ } //end of can edit if statement\r
+ ?>\r
+ </div>\r
+<div class="clearfloat"></div>\r
+</div><!-- end of messageboard div -->\r
--- /dev/null
+<?php\r
+/**\r
+ * Elgg profile comment wall add\r
+ */ \r
+?>\r
+<div id="mb_input_wrapper">\r
+<form action="<?php echo $vars['url']; ?>action/profile/addcomment" method="post" name="messageboardForm">\r
+ <!-- textarea for the contents -->\r
+ <textarea name="message_content" value="" class="commentwall" style="width:500px;height:20px;"></textarea><br />\r
+ <!-- the person posting an item on the message board -->\r
+ <input type="hidden" name="guid" value="<?php echo $_SESSION['guid']; ?>" />\r
+ <!-- the page owner, this will be the profile owner -->\r
+ <input type="hidden" name="pageOwner" value="<?php echo page_owner(); ?>" />\r
+ <?php echo elgg_view('input/securitytoken'); ?>\r
+ <!-- submit messages input -->\r
+ <input type="submit" id="postit" value="<?php echo elgg_echo('profile:commentwall:add'); ?>">\r
+</form>\r
+</div>\r
--- /dev/null
+<?php\r
+/**\r
+ * Elgg profile comment wall\r
+ */\r
+?>\r
+<div id="profile_content">\r
+<?php\r
+if(isloggedin()){\r
+ echo elgg_view("profile/commentwall/commentwalladd");\r
+}\r
+echo elgg_view("profile/commentwall/commentwall", array('annotation' => $vars['comments']));\r
+?>\r
+</div>
\ No newline at end of file
case 'twitter':
$twitter = 'class="selected"';
break;
+
+ case 'commentwall':
+ $commentwall = 'class="selected"';
+ break;
case 'activity':
default:
<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){
echo elgg_view('profilenav/extend', $profile);
?>
</ul>
-</div>
+</div>
\ No newline at end of file